From: Ivan Maidanski Date: Fri, 22 Feb 2013 04:25:27 +0000 (+0400) Subject: Workaround 'ELF_DATA/EM_ALPHA redefined' warning in Android linker.h X-Git-Tag: gc7_4_0~88 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4758d24f837b788c857971387db2e0488910a006;p=gc Workaround 'ELF_DATA/EM_ALPHA redefined' warning in Android linker.h * dyn_load.c: Include asm/elf.h and linux/elf-em.h explicitly, and undefine ELF_DATA and EM_ALPHA (if PLATFORM_ANDROID and BIONIC_ELFDATA_REDEF_BUG are defined) to workaround a bug (avoiding "macro redefined" warnings) in Android 4.1 (and 4.2) Bionic which has the mismatching macro definitions in headers included from linker.h. --- diff --git a/dyn_load.c b/dyn_load.c index 9d9700fe..a6f4a865 100644 --- a/dyn_load.c +++ b/dyn_load.c @@ -93,6 +93,15 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0; /* The header file is in "bionic/linker" folder of Android sources. */ /* If you don't need the "dynamic loading" feature, you may build */ /* the collector with -D IGNORE_DYNAMIC_LOADING. */ +# ifdef BIONIC_ELFDATA_REDEF_BUG + /* Workaround a problem in Android 4.1 (and 4.2) Bionic which has */ + /* mismatching ELF_DATA definitions in sys/exec_elf.h and */ + /* asm/elf.h included from linker.h file (similar to EM_ALPHA). */ +# include +# include +# undef ELF_DATA +# undef EM_ALPHA +# endif # include # else # include