From patchwork Tue Sep 29 18:43:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1373562 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=Wq97jZFw; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C17Z76gD6z9sSf for ; Wed, 30 Sep 2020 04:43:27 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 825638174F; Tue, 29 Sep 2020 20:43:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="Wq97jZFw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3B8F281996; Tue, 29 Sep 2020 20:43:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C93EC808F1 for ; Tue, 29 Sep 2020 20:43:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1601404998; bh=0ed8KWR7J55BE8QlZEmeDoVaNdC1VJDoc4V3Umwd25k=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=Wq97jZFws2Psd+dFdAewHZ6PeNZCxJ0SaSmwb+QOSzz92Q8dwZ5a2bYFjKyNtbM1p d2lm2HxaNbBmBLZAHkMz0XVw7KJriaQyxsXmwDbxezbj9+u9Q3R5Ffj6FvmQe26zhH b43NJBADd6exHND4ulhUjkArnmjTMrJJLUuDMlJQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([178.202.41.107]) by mail.gmx.com (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MeCpR-1kwfsP0xN9-00bHCp; Tue, 29 Sep 2020 20:43:18 +0200 From: Heinrich Schuchardt To: Tom Rini Cc: Simon Glass , u-boot@lists.denx.de, Wolfgang Denk , Heinrich Schuchardt Subject: [PATCH v2 1/1] sandbox: redefine getc() Date: Tue, 29 Sep 2020 20:43:12 +0200 Message-Id: <20200929184312.44941-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:scW6CaLBBXeTSx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Gu+DxuLZadIWxZXu4l6eMICgEPS313x6UVid4ufFMsFNdhM3iAJdFz SHinatWIsqcWEJKNHl05TeQwSmS6WnQiao0azz/oktmNChAm+LzHc4c99s9M9fYTB22mVpkES 0AxUhfGZjG0Xeke46fDeVlrPTcQNFA5cDiYLX4JJs3gk/im/DbzdZXq/L5uWTbuhEdqLiMhea Sy3oj2sWC0FirU7iSN9aov9lEwApF7SS5fFReoTi5Z8JEDTJWI8+c6pNd1VVdlZ80yLFt+Bpd c6B2b/QVEovawpo4hA+iTwusK9d3A/bsT/uobSfzhg4zUZZPQIGWEgVxiQe1DKYEoCGiEr0KK FAAac5s/9CmzjeWeo3d73gSNUjTASPIT+78ztHxTb4UoQn3AUvhpgYrLfv4xa3B9YC9lof92w PmpZyp+NwWmbR7GBMsNfUQx8bUbFgpQXC358Y0g== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The sandbox is built with the SDL2 library with invokes the X11 library which in turn calls getc(). But getc() in glibc is defined as int getc(FILE *) This does not match our definition. int getc(void) The sandbox crashes when called with parameter -l. Rename our library symbol to be called _u_boot_getc(). To keep the coding changes minimal use a define on the sandbox only. Signed-off-by: Heinrich Schuchardt --- v2: apply changes only to the sandbox --- include/stdio.h | 5 +++++ 1 file changed, 5 insertions(+) -- 2.28.0 diff --git a/include/stdio.h b/include/stdio.h index aedf374452..43cba1dde5 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -4,6 +4,11 @@ #include #include +/* The SDL library invokes getc() but this should not be our getc(). */ +#ifdef CONFIG_SANDBOX +#define getc _u_boot_getc +#endif + /* stdin */ int getc(void); int tstc(void);