]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sandbox: Deal with conflicting getenv() for SDL
authorSimon Glass <sjg@chromium.org>
Thu, 27 Feb 2014 20:26:21 +0000 (13:26 -0700)
committerSimon Glass <sjg@chromium.org>
Tue, 18 Mar 2014 02:05:49 +0000 (20:05 -0600)
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 <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
include/common.h

index 090fcde5d0e0474e977f778d1463386be8c58a00..968334b588b15bd5f0698ac2ee21d7a62e893d48 100644 (file)
@@ -360,6 +360,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);