From 4758d24f837b788c857971387db2e0488910a006 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 22 Feb 2013 08:25:27 +0400 Subject: [PATCH] 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. --- dyn_load.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- 2.40.0