On Wed, Jan 7, 2015 at 7:20 AM, Brian Drummond <brian@xxxxxxxxxxxxxxxxxx> wrote: > On Wed, 2015-01-07 at 12:17 +0000, Andrew Haley wrote: >> On 01/07/2015 12:14 PM, Cyd Haselton wrote: >> > Here goes. >> >> You mailer mangled that. As an attachment please. >> >> Andrew. >> > > Below is the relevant command I saw in the attachment (most .o filenames > redacted)... > > It ends with > fakechroot: dlopen: undefined symbol: dlopen > collect2: error: ld returned 1 exit status > make: *** [libgcc_s.so] Error 1 > > which I think reinforces your hypothesis that it is the ld program > itself which fails, rather than anything in the files being linked. > > I don't know if Cyd cc'ed you this message... > (I'll forward it to the list) > ---------------------------------------------------------------------- >> The following is a quote from the developer who created the >> environment I'm using: >> >> "Using libfakechroot to virtualize a root filesystem is a bit of a >> hack, to be honest, and its weaknesses are easily exposed. Most >> obviously, it will only filter dynamic calls to the Bionic C library >> (because that was the C library it itself is linked against). > ... >> I've been in contact with him regarding a number of other ports and >> he's confirmed that reverting to static linking would be a pain. >> >> Also, iIn case anyone reading this is interested: >> http://kevinboone.net/kbox2_how_it_works.html > ---------------------------------------------------------------------- > > which makes me wonder about Bionic's support for dlopen(). If I understand the android docs correctly, dlopen is supported, provided the libdl.so library is referenced. Dlopen isn't *in* bionic...I don't know if that differs from the standard Linux libc. >Cyd confirmed > that he uses the same binutils version for 4.8 and 4.9 so we may be > looking at a failure in a 2-step process > > (a) 4.9 assumes some capability from ld that 4.8 doesn't, which requires > a DLL to be opened > > (b) fakechroot layered over Bionic is failing to implement that > capability (we know from nm that dlopen is undefined in Cyd's > libfakechroot.so) > > Step (a) may be within the remit of gcc-help, what is the difference and > can it be worked round) but step (b) probably lies elsewhere : as a > first step, enquire about the missing dlopen() in fakechroot. > I'm not sure if it's missing so much as not included due to the vagaries of working within the Android environment. Then again, I only have a vague idea of how the linking process...both during build and at runtime...works, and what is required to make it work successfully. > -- Brian > > Failing command... > ------------------------------------------------------------------------------------------- > > /bld/gcc/builddir-4.9/./gcc/xgcc -v -Wl,--verbose > -B/bld/gcc/builddir-4.9/./gcc/ > -B/usr/gcc-4.9.2/arm-linux-androideabi/bin/ > -B/usr/gcc-4.9.2/arm-linux-androideabi/lib/ > -isystem /usr/gcc-4.9.2/arm-linux-androideabi/include > -isystem /usr/gcc-4.9.2/arm-linux-androideabi/sys-include > --sysroot=/usr/gcc-4.9.2/sysroot -O2 -DIN_GCC -W -Wall > -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format > -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition > -isystem ./include -fPIC -fno-inline -g -DIN_LIBGCC2 -fbuilding-libgcc > -fno-stack-protector -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 > -Wl,--version-script=libgcc.map -o ./libgcc_s.so.1.tmp -g -O2 -Wall -O > -mandroid -mbionic -B./ _thumb1_case_sqi_s.o _thumb1_case_uqi_s.o > _thumb1_case_shi_s.o _thumb1_case_uhi_s.o _thumb1_case_si_s.o > _udivsi3_s.o _divsi3_s.o _umodsi3_s.o _modsi3_s.o _bb_init_func_s.o > _call_via_rX_s.o _interwork_call_via_rX_s.o _lshrdi3_s.o _ashrdi3_s.o > _ashldi3_s.o _arm_negdf2_s.o _arm_addsubdf3_s.o _arm_muldivdf3_s.o > _arm_cmpdf2_s.o > ... > divdf3_s.o eqdf2_s.o gedf2_s.o ledf2_s.o muldf3_s.o negdf2_s.o > subdf3_s.o unorddf2_s.o fixdfsi_s.o floatsidf_s.o floatunsidf_s.o > extendsfdf2_s.o truncdfsf2_s.o enable-execute-stack_s.o unwind-arm_s.o > libunwind_s.o pr-support_s.o unwind-c_s.o emutls_s.o libgcc.a -lc -ldl > && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv > -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && > mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && (echo "/* GNU ld script"; echo > " Use the shared library, but some functions are only in"; echo " > the static library. */"; echo "GROUP ( libgcc_s.so.1 -ldl -lgcc )" ) >> ./libgcc_s.so > Reading specs from /bld/gcc/builddir-4.9/./gcc/specs > COLLECT_GCC=/bld/gcc/builddir-4.9/./gcc/xgcc > COLLECT_LTO_WRAPPER=/bld/gcc/builddir-4.9/./gcc/lto-wrapper > Target: arm-linux-androideabi > Configured with: ../gcc-4.9.2/configure --prefix=/usr/gcc-4.9.2 > --build=arm-linux-androideabi --host=arm-linux-androideabi > --target=arm-linux-androideabi --with-gmp=/usr/gcc-4.9.2 > --with-mpfr=/usr/gcc-4.9.2 --with-mpc=/usr/gcc-4.9.2 --disable-ld > --with-as=/usr/gcc-4.9.2/bin/as --with-ld=/usr/gcc-4.9.2/bin/ld > --enable-shared --enable-languages=c,c++ --disable-gold > --disable-fortran --disable-libssp --disable-libquadmath > --disable-libquadmath-support --disable-libada --disable-werror > --disable-multilib --disable-libgomp --disable-cloog > --with-build-time-tools=/usr/gcc-4.9.2/bin > --with-build-sysroot=/usr/gcc-4.9.2/sysroot CC='gcc > --sysroot=/usr/gcc-4.8.3/sysroot' CFLAGS='-Wall -O -mandroid -mbionic' > LDFLAGS='-Wl,--dynamic-linker=/system/bin/linker -lc -ldl -lgcc -lm > -lsupc++ -lgnustl_shared' LIBCFLAGS='-O2 -mandroid -mbionic' > LIBCPPFLAGS='-O2 -mandroid -mbionic' LIBCXXFLAGS='-O2 -mandroid -mbionic > -fno-implicit-templates' LIBS='-lc -ldl -lgcc -lm -lsupc++ > -lgnustl_shared' > Thread model: posix > gcc version 4.9.2 (GCC) > COMPILER_PATH=/bld/gcc/builddir-4.9/./gcc/:/usr/gcc-4.9.2/arm-linux-androideabi/bin/:/usr/gcc-4.9.2/arm-linux-androideabi/lib/:./ > LIBRARY_PATH=/bld/gcc/builddir-4.9/./gcc/:/usr/gcc-4.9.2/arm-linux-androideabi/bin/:/usr/gcc-4.9.2/arm-linux-androideabi/lib/:./:/usr/gcc-4.9.2/sysroot/usr/lib/ > COLLECT_GCC_OPTIONS='-v' '-B' '/bld/gcc/builddir-4.9/./gcc/' '-B' > '/usr/gcc-4.9.2/arm-linux-androideabi/bin/' '-B' > '/usr/gcc-4.9.2/arm-linux-androideabi/lib/' '-isystem' > '/usr/gcc-4.9.2/arm-linux-androideabi/include' '-isystem' > '/usr/gcc-4.9.2/arm-linux-androideabi/sys-include' '-O2' '-D' 'IN_GCC' > '-Wextra' '-Wno-narrowing' '-Wwrite-strings' '-Wcast-qual' '-Wformat=0' > '-Wstrict-prototypes' '-Wmissing-prototypes' '-Wold-style-definition' > '-isystem' './include' '-fPIC' '-fno-inline' '-g' '-D' 'IN_LIBGCC2' > '-fbuilding-libgcc' '-fno-stack-protector' '-shared' '-nodefaultlibs' > '-o' './libgcc_s.so.1.tmp' '-g' '-O2' '-Wall' '-O' '-mandroid' > '-mbionic' '-B' './' '-mtls-dialect=gnu' > /bld/gcc/builddir-4.9/./gcc/collect2 > -plugin /bld/gcc/builddir-4.9/./gcc/liblto_plugin.so > -plugin-opt=/bld/gcc/builddir-4.9/./gcc/lto-wrapper > -plugin-opt=-fresolution=/data/data/jackpal.androidterm/kbox2/tmp/cc757Z3H.res --sysroot=/usr/gcc-4.9.2/sysroot --eh-frame-hdr -shared -dynamic-linker /system/bin/linker -X -m armelf_linux_eabi -Bsymbolic -o ./libgcc_s.so.1.tmp /usr/gcc-4.9.2/sysroot/usr/lib/crtbegin_so.o -L/bld/gcc/builddir-4.9/./gcc -L/usr/gcc-4.9.2/arm-linux-androideabi/bin -L/usr/gcc-4.9.2/arm-linux-androideabi/lib -L. -L/usr/gcc-4.9.2/sysroot/usr/lib --verbose --soname=libgcc_s.so.1 --version-script=libgcc.map _thumb1_case_sqi_s.o _thumb1_case_uqi_s.o _thumb1_case_shi_s.o _thumb1_case_uhi_s.o _thumb1_case_si_s.o _udivsi3_s.o _divsi3_s.o _umodsi3_s.o _modsi3_s.o _bb_init_func_s.o _call_via_rX_s.o _interwork_call_via_rX_s.o _lshrdi3_s.o _ashrdi3_s.o _ashldi3_s.o _arm_negdf2_s.o _arm_addsubdf3_s.o _arm_muldivdf3_s.o _arm_cmpdf2_s.o > ... > divdf3_s.o eqdf2_s.o gedf2_s.o ledf2_s.o muldf3_s.o negdf2_s.o > subdf3_s.o unorddf2_s.o fixdfsi_s.o floatsidf_s.o floatunsidf_s.o > extendsfdf2_s.o truncdfsf2_s.o enable-execute-stack_s.o unwind-arm_s.o > libunwind_s.o pr-support_s.o unwind-c_s.o emutls_s.o libgcc.a -lc > -ldl /usr/gcc-4.9.2/sysroot/usr/lib/crtend_so.o > fakechroot: dlopen: undefined symbol: dlopen > collect2: error: ld returned 1 exit status > make: *** [libgcc_s.so] Error 1 > ------------------------------------------------------------------------------------------- >