From 697be5db384445543bb487944934028cbbf14fcf Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 9 Sep 2015 11:42:43 +0300 Subject: [PATCH] Support Android API level 21 (fix 'link_map redefinition' error on Android with API level 21+) * dyn_load.c (link_map, r_debug): Do not define if android-21 (or higher) API is used; update comment. --- dyn_load.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dyn_load.c b/dyn_load.c index 3b907185..326bd2de 100644 --- a/dyn_load.c +++ b/dyn_load.c @@ -109,9 +109,9 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0; # undef EM_ALPHA # endif # include -# if !defined(GC_DONT_DEFINE_LINK_MAP) - /* link_map and r_debug should be defined explicitly, */ - /* as only bionic/linker/linker.h defines them but the header */ +# if !defined(GC_DONT_DEFINE_LINK_MAP) && !(__ANDROID_API__ >= 21) + /* link_map and r_debug are defined in link.h of NDK r10+. */ + /* bionic/linker/linker.h defines them too but the header */ /* itself is a C++ one starting from Android 4.3. */ struct link_map { uintptr_t l_addr; -- 2.40.0