Open ChanChunSong opened 4 years ago
I had similar problems with other calls that can be easily resolved (I already fixed them for other symbols), the problem is the current toolchain is unable to link static binary, what version of ndk are you using?
I've force pushed a fix, android ndk team cheats to have to buid less versions of static bionic btw 64bit static build still fails for relocation overflow in the link stage
I used android-ndk-r21c. Do you mean the earlier ndk version can build static binary ?
@ChanChunSong I've fixed the problem you encountered, static build still fail on aarch64 but does work on arm
I modified the CONFIG_STATIC=y in .config file. But I got these error message usr/local/google/home/worker/codebase/tool/android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: /usr/local/google/home/worker/codebase/tool/android-toolchain/bin/../sysroot/usr/lib/arm-linux-androideabi/21/libc.a(syscalls-arm.o): multiple definition of 'adjtimex' /usr/local/google/home/worker/codebase/tool/android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: libbb/lib.a(missing_syscalls.o): previous definition here /usr/local/google/home/worker/codebase/tool/android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: /usr/local/google/home/worker/codebase/tool/android-toolchain/bin/../sysroot/usr/lib/arm-linux-androideabi/21/libc.a(syscalls-arm.o): multiple definition of 'getsid' /usr/local/google/home/worker/codebase/tool/android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: libbb/lib.a(missing_syscalls.o): previous definition here /usr/local/google/home/worker/codebase/tool/android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: /usr/local/google/home/worker/codebase/tool/android-toolchain/bin/../sysroot/usr/lib/arm-linux-androideabi/21/libc.a(syscalls-arm.o): multiple definition of 'sethostname' /usr/local/google/home/worker/codebase/tool/android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: libbb/lib.a(missing_syscalls.o): previous definition here /usr/local/google/home/worker/codebase/tool/android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: /usr/local/google/home/worker/codebase/tool/android-toolchain/bin/../sysroot/usr/lib/arm-linux-androideabi/21/libc.a(syscalls-arm.o): multiple definition of 'swapoff' /usr/local/google/home/worker/codebase/tool/android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: libbb/lib.a(missing_syscalls.o): previous definition here /usr/local/google/home/worker/codebase/tool/android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: /usr/local/google/home/worker/codebase/tool/android-toolchain/bin/../sysroot/usr/lib/arm-linux-androideabi/21/libc.a(syscalls-arm.o): multiple definition of 'swapon' /usr/local/google/home/worker/codebase/tool/android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: libbb/lib.a(missing_syscalls.o): previous definition here clang90: error: linker command failed with exit code 1 (use -v to see invocation)
Did I miss something ?