From patchwork Thu Feb 27 20:26:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 324931 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id E6DD82C02FC for ; Fri, 28 Feb 2014 07:32:16 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C523E4B679; Thu, 27 Feb 2014 21:32:14 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zylAZVIWzrUr; Thu, 27 Feb 2014 21:32:14 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8765F4B64D; Thu, 27 Feb 2014 21:30:50 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7C5714B5EB for ; Thu, 27 Feb 2014 21:29:07 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ij9ZwrDatMvW for ; Thu, 27 Feb 2014 21:29:05 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-oa0-f74.google.com (mail-oa0-f74.google.com [209.85.219.74]) by theia.denx.de (Postfix) with ESMTPS id 8CE3B4B5FF for ; Thu, 27 Feb 2014 21:28:17 +0100 (CET) Received: by mail-oa0-f74.google.com with SMTP id i11so183371oag.1 for ; Thu, 27 Feb 2014 12:28:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PpPYxj9OpIAXrBsVt6xYL3ZaXZS/pVYe7Apfbz8e1ak=; b=j1qtOzK6vDVarXfiV4xr8yRKSEs/FqzYIs3fx93HUGYgq2qxMehcGGVTMX3j4TNKVM /9ExyCSZwdJV47EC+n1Cd0PgtUacuZME13jgJWEAlCRxzhZz7i79B+HxwK3TqtWeMqOp 3vt44u5xoLBohIGsjDwvncfKnLlAnag/Q6Z1VYY+jy8EqxzUTsaDD9JOIQ2c/Ev3Nf6q 0Tx4nVBgu8r7khEosQltmWQ4tF9MY3rl0+Htk06Zt2L/8mTPWVD01WSlyWEX7mZFPvYs LaEWbFNP0GCI/ByyLGhGJY4VGdZ99KV5Ei+zweKVRKmTsEy4IEdRDjABr62w0N3CTnA0 lnwA== X-Gm-Message-State: ALoCoQn3UYJm9E1yjkMvxQ9h0dF70ltYAr9y7hb6JGhcCCz3/psR2oMCUUxmm0YLZuEeLs5AdfppV1l8pvQNqCUHeQ+Tg8hSA2KxTZEvZwAGRVVBeKn3Y5Vah3QFPoG+67l33j23F/nUi1QJb+dZUlGojDDQFKHsnx54DbWUJbEuSA4Z1047cXfVjU3+2xUvatuE3cYLWA6n X-Received: by 10.182.236.74 with SMTP id us10mr4954122obc.36.1393532896237; Thu, 27 Feb 2014 12:28:16 -0800 (PST) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id u63si950228yhm.6.2014.02.27.12.28.16 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Feb 2014 12:28:16 -0800 (PST) Received: from kaki.bld.corp.google.com (kaki.bld.corp.google.com [172.29.216.32]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 1EB9431C1CD; Thu, 27 Feb 2014 12:28:16 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id B672F221BE8; Thu, 27 Feb 2014 13:28:15 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Thu, 27 Feb 2014 13:26:21 -0700 Message-Id: <1393532785-9020-28-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.9.0.279.gdc9e3eb In-Reply-To: <1393532785-9020-1-git-send-email-sjg@chromium.org> References: <1393532785-9020-1-git-send-email-sjg@chromium.org> Cc: u-boot-review@google.com Subject: [U-Boot] [PATCH v2 27/31] sandbox: Deal with conflicting getenv() for SDL X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Unfortunately SDL requires getenv() to operate, since it wants to figure out the display type. U-Boot has its own getenv() and they conflict. As a work-around use #define to resolve the conflict. A better but more complex solution might be to rename some U-Boot symbols at link time. SDL audio is not functional at present, likely due to a related issue. Note: Vic Yank wrote a script for this, filed in crbug.com/271125. Reviewed-by: Simon Glass Signed-off-by: Simon Glass --- Changes in v2: None include/common.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/common.h b/include/common.h index 033b5d9..bbcfd97 100644 --- a/include/common.h +++ b/include/common.h @@ -359,6 +359,11 @@ int do_ext2load(cmd_tbl_t *, int, int, char * const []); int env_init (void); void env_relocate (void); int envmatch (uchar *, int); + +/* Avoid unfortunate conflict with libc's getenv() */ +#ifdef CONFIG_SANDBOX +#define getenv uboot_getenv +#endif char *getenv (const char *); int getenv_f (const char *name, char *buf, unsigned len); ulong getenv_ulong(const char *name, int base, ulong default_val);