[Gc] gc 7.4.0 on Android

Manuel.Serrano at inria.fr Manuel.Serrano at inria.fr
Tue Dec 3 23:51:42 PST 2013


Hi everyone,

I have tried to compile the GC version 7.4.0 on Android but it has failed with 
the following error message. I'm using the NDK version r8e and the eclair
version of bionic.

-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----
libtool: compile:  /users/serrano/android/bigloo4.1a/arch/android/droid-gcc -DHAVE_CONFIG_H -I./include -I./include -I./libatomic_ops/src -I./libatomic_ops/src -fexceptions -O3 -fdata-sections -ffunction-sections -DBGL_ANDROID -DPLATFORM_ANDROID -DFINALIZE_ON_DEMAND -I/users/serrano/android/bigloo4.1a/lib/4.1a -fPIC -MT dyn_load.lo -MD -MP -MF .deps/dyn_load.Tpo -c dyn_load.c  -fPIC -DPIC -o .libs/dyn_load.o
dyn_load.c:111:21: error: link.h: No such file or directory
dyn_load.c:432: warning: 'struct dl_phdr_info' declared inside parameter list
dyn_load.c:432: warning: its scope is only this definition or declaration, which is probably not what you want
dyn_load.c:470: warning: 'struct dl_phdr_info' declared inside parameter list
dyn_load.c: In function 'GC_register_dynlib_callback':
dyn_load.c:472: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
dyn_load.c:472: error: 'p' undeclared (first use in this function)
dyn_load.c:472: error: (Each undeclared identifier is reported only once
dyn_load.c:472: error: for each function it appears in.)
dyn_load.c:477: error: invalid use of undefined type 'struct dl_phdr_info'
dyn_load.c:478: error: dereferencing pointer to incomplete type
dyn_load.c:481: error: dereferencing pointer to incomplete type
dyn_load.c:482: error: dereferencing pointer to incomplete type
dyn_load.c:517: error: 'PT_LOAD' undeclared (first use in this function)
dyn_load.c:520: error: 'PF_W' undeclared (first use in this function)
dyn_load.c:521: error: dereferencing pointer to incomplete type
dyn_load.c:524: error: dereferencing pointer to incomplete type
dyn_load.c: In function 'GC_register_dynamic_libraries_dl_iterate_phdr':
dyn_load.c:587: warning: passing argument 1 of 'dl_iterate_phdr' from incompatible pointer type
dyn_load.c: At top level:
dyn_load.c:675: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_DYNAMIC'
dyn_load.c: In function 'GC_FirstDLOpenedLinkMap':
dyn_load.c:680: error: 'Elf32_Dyn' undeclared (first use in this function)
dyn_load.c:680: error: 'dp' undeclared (first use in this function)
dyn_load.c:683: error: '_DYNAMIC' undeclared (first use in this function)
dyn_load.c:695: error: 'DT_DEBUG' undeclared (first use in this function)
dyn_load.c: In function 'GC_register_dynamic_libraries':
dyn_load.c:718: error: 'Elf32_Ehdr' undeclared (first use in this function)
dyn_load.c:718: error: 'e' undeclared (first use in this function)
dyn_load.c:719: error: 'Elf32_Phdr' undeclared (first use in this function)
dyn_load.c:719: error: 'p' undeclared (first use in this function)
dyn_load.c:724: error: expected expression before ')' token
dyn_load.c:729: error: expected expression before ')' token
dyn_load.c:733: error: 'PT_LOAD' undeclared (first use in this function)
dyn_load.c:735: error: 'PF_W' undeclared (first use in this function)
Makefile:1462: recipe for target 'dyn_load.lo' failed
make[4]: *** [dyn_load.lo] Error 1
make[4]: Leaving directory '/misc/virtual/android/bigloo4.1a/gc/gc-7.4.0'
Makefile:1877: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/misc/virtual/android/bigloo4.1a/gc/gc-7.4.0'
Makefile-gc-7.4.0:24: recipe for target 'gc-7.4.0/.libs/libgc.so' failed
make[2]: *** [gc-7.4.0/.libs/libgc.so] Error 2
make[2]: Leaving directory '/misc/virtual/android/bigloo4.1a/gc'
Makefile-gc-7.4.0:13: recipe for target 'boot-gc' failed
make[1]: *** [boot-gc] Error 2
make[1]: Leaving directory '/misc/virtual/android/bigloo4.1a/gc'
Makefile:165: recipe for target 'boot' failed
make: *** [boot] Error 2
-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----

I have then tried to replace the include of link.h with an include of
linker.h (as in the gc-7.3alpha3-20130330) but this is not
sufficient. This raises the error:

-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----
dyn_load.c:116: error: redefinition of 'struct link_map'
dyn_load.c:123: error: redefinition of 'struct r_debug'
Makefile:1462: recipe for target 'dyn_load.lo' failed
make[4]: *** [dyn_load.lo] Error 1
Makefile:1877: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
Makefile-gc-7.4.0:24: recipe for target 'gc-7.4.0/.libs/libgc.so' failed
make[2]: *** [gc-7.4.0/.libs/libgc.so] Error 2
Makefile-gc-7.4.0:13: recipe for target 'boot-gc' failed
make[1]: *** [boot-gc] Error 2
Makefile:165: recipe for target 'boot' failed
make: *** [boot] Error 2
-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----

Line 112 of dyn_load.c there is this guard

#   if !defined(GC_DONT_DEFINE_LINK_MAP)

but I don't see any piece of code that could potentially defines 
GC_DONT_DEFINE_LINK_MAP. Hence I'm not sure about what to do. I will be glad
to help. Just tell me what you would like me to try.

Thanks in advance for your help.

Cheers,

-- 
Manuel


ps: For your information, I have never been able to have an operational GC
on Android that supports dynamic loading and multithreading. Using only
multithreading works like a charm but multithreading+dynamic loading crashes
for me all the time.


More information about the Gc mailing list