schwabe / ics-openvpn

OpenVPN for Android
3.38k stars 1.21k forks source link

problem generating signed apk #1274

Closed siromidz closed 3 years ago

siromidz commented 3 years ago

hi I have problem when generating signed apk. this is the full error log:

Build command failed. Error while executing process D:\Programs\programming\android\sdk\sdk25.02\cmake\3.10.2.4988404\bin\ninja.exe with arguments {-C E:\ics-openvpn-git\ics-openvpn\main.cxx\cmake\uiRelease\arm64-v8a jbcrypto libovpnexec.so openvpn opvpnutil osslspeedtest ovpn3} ninja: Entering directory `E:\ics-openvpn-git\ics-openvpn\main.cxx\cmake\uiRelease\arm64-v8a' [1/10] cmd.exe /C "cd /D E:\ics-openvpn-git\ics-openvpn\main.cxx\cmake\uiRelease\arm64-v8a && D:\Programs\programming\android\sdk\sdk25.02\cmake\3.10.2.4988404\bin\cmake.exe -E make_directory E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/../../../build/ovpnassets" [2/10] Linking C shared library libosslspeedtest.so FAILED: libosslspeedtest.so cmd.exe /C "cd . && D:\Programs\programming\android\sdk\sdk25.02\ndk\22.0.6917172\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=aarch64-none-linux-android21 --gcc-toolchain=D:/Programs/programming/android/sdk/sdk25.02/ndk/22.0.6917172/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=D:/Programs/programming/android/sdk/sdk25.02/ndk/22.0.6917172/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -O2 -DNDEBUG -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_real.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libosslspeedtest.so -o libosslspeedtest.so CMakeFiles/osslspeedtest.dir/opvpnutil/sslspeed.c.o -llog libcrypto.a libssl.a libcrypto.a -latomic -lm && cd ." ld: error: relocation R_AARCH64_ADR_PREL_LO21 cannot be used against symbol poly1305_blocks; recompile with -fPIC

defined in libcrypto.a(poly1305-armv8.S.o) referenced by poly1305-armv8.S:43 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/poly1305/asm\poly1305-armv8.S:43) poly1305-armv8.S.o:(poly1305_init) in archive libcrypto.a

ld: error: relocation R_AARCH64_ADR_PREL_LO21 cannot be used against symbol poly1305_emit; recompile with -fPIC

defined in libcrypto.a(poly1305-armv8.S.o) referenced by poly1305-armv8.S:45 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/poly1305/asm\poly1305-armv8.S:45) poly1305-armv8.S.o:(poly1305_init) in archive libcrypto.a

ld: error: relocation R_AARCH64_PREL64 cannot be used against symbol OPENSSL_armcap_P; recompile with -fPIC

defined in libcrypto.a(armcap.c.o) referenced by poly1305-armv8.S:852 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/poly1305/asm\poly1305-armv8.S:852) poly1305-armv8.S.o:(.text+0x9A0) in archive libcrypto.a

ld: error: relocation R_AARCH64_PREL64 cannot be used against symbol OPENSSL_armcap_P; recompile with -fPIC

defined in libcrypto.a(armcap.c.o) referenced by sha1-armv8.S:1204 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/sha/asm\sha1-armv8.S:1204) sha1-armv8.S.o:(.text+0x1240) in archive libcrypto.a

ld: error: relocation R_AARCH64_PREL64 cannot be used against symbol OPENSSL_armcap_P; recompile with -fPIC

defined in libcrypto.a(armcap.c.o) referenced by sha256-armv8.S:1041 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/sha/asm\sha256-armv8.S:1041) sha256-armv8.S.o:(.text+0xF88) in archive libcrypto.a

ld: error: relocation R_AARCH64_PREL64 cannot be used against symbol OPENSSL_armcap_P; recompile with -fPIC

defined in libcrypto.a(armcap.c.o) referenced by sha512-armv8.S:1039 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/sha/asm\sha512-armv8.S:1039) sha512-armv8.S.o:(.text+0x1108) in archive libcrypto.a clang: error: linker command failed with exit code 1 (use -v to see invocation) [3/10] Linking C shared library libopenvpn.so FAILED: libopenvpn.so cmd.exe /C "cd . && D:\Programs\programming\android\sdk\sdk25.02\ndk\22.0.6917172\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=aarch64-none-linux-android21 --gcc-toolchain=D:/Programs/programming/android/sdk/sdk25.02/ndk/22.0.6917172/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=D:/Programs/programming/android/sdk/sdk25.02/ndk/22.0.6917172/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -O2 -DNDEBUG -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_real.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libopenvpn.so -o libopenvpn.so CMakeFiles/openvpn.dir/openvpn/src/compat/compat-basename.c.o CMakeFiles/openvpn.dir/openvpn/src/compat/compat-daemon.c.o CMakeFiles/openvpn.dir/openvpn/src/compat/compat-dirname.c.o CMakeFiles/openvpn.dir/openvpn/src/compat/compat-gettimeofday.c.o CMakeFiles/openvpn.dir/openvpn/src/compat/compat-inet_ntop.c.o CMakeFiles/openvpn.dir/openvpn/src/compat/compat-inet_pton.c.o CMakeFiles/openvpn.dir/openvpn/src/compat/compat-lz4.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/argv.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/auth_token.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/base64.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/buffer.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/clinat.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/console.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/console_builtin.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/crypto.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/crypto_openssl.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/crypto_mbedtls.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/cryptoapi.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/dhcp.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/error.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/event.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/env_set.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/fdmisc.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/forward.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/fragment.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/gremlin.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/helper.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/httpdigest.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/init.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/interval.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/list.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/lladdr.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/lzo.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/manage.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/mbuf.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/misc.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/mroute.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/mss.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/mstats.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/mtcp.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/mtu.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/mudp.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/multi.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/ntlm.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/occ.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/openvpn.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/options.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/otime.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/packet_id.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/perf.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/pf.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/ping.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/pkcs11.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/pkcs11_openssl.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/platform.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/plugin.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/pool.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/proto.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/proxy.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/ps.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/push.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/reliable.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/route.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/run_command.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/schedule.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/session_id.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/shaper.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/sig.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/socket.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/socks.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/ssl.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/ssl_openssl.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/ssl_mbedtls.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/ssl_ncp.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/ssl_verify.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/ssl_verify_openssl.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/ssl_verify_mbedtls.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/status.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/tls_crypt.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/tun.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/vlan.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/comp-lz4.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/comp.c.o CMakeFiles/openvpn.dir/openvpn/src/openvpn/compstub.c.o libcrypto.a libssl.a liblzo.a libcrypto.a -latomic -lm && cd ." ld: error: relocation R_AARCH64_ADR_PREL_LO21 cannot be used against symbol poly1305_blocks; recompile with -fPIC defined in libcrypto.a(poly1305-armv8.S.o) referenced by poly1305-armv8.S:43 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/poly1305/asm\poly1305-armv8.S:43) poly1305-armv8.S.o:(poly1305_init) in archive libcrypto.a

ld: error: relocation R_AARCH64_ADR_PREL_LO21 cannot be used against symbol poly1305_emit; recompile with -fPIC

defined in libcrypto.a(poly1305-armv8.S.o) referenced by poly1305-armv8.S:45 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/poly1305/asm\poly1305-armv8.S:45) poly1305-armv8.S.o:(poly1305_init) in archive libcrypto.a

ld: error: relocation R_AARCH64_PREL64 cannot be used against symbol OPENSSL_armcap_P; recompile with -fPIC

defined in libcrypto.a(armcap.c.o) referenced by poly1305-armv8.S:852 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/poly1305/asm\poly1305-armv8.S:852) poly1305-armv8.S.o:(.text+0x9A0) in archive libcrypto.a

ld: error: relocation R_AARCH64_PREL64 cannot be used against symbol OPENSSL_armcap_P; recompile with -fPIC

defined in libcrypto.a(armcap.c.o) referenced by sha1-armv8.S:1204 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/sha/asm\sha1-armv8.S:1204) sha1-armv8.S.o:(.text+0x1240) in archive libcrypto.a

ld: error: relocation R_AARCH64_PREL64 cannot be used against symbol OPENSSL_armcap_P; recompile with -fPIC

defined in libcrypto.a(armcap.c.o) referenced by sha256-armv8.S:1041 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/sha/asm\sha256-armv8.S:1041) sha256-armv8.S.o:(.text+0xF88) in archive libcrypto.a

ld: error: relocation R_AARCH64_PREL64 cannot be used against symbol OPENSSL_armcap_P; recompile with -fPIC

defined in libcrypto.a(armcap.c.o) referenced by sha512-armv8.S:1039 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/sha/asm\sha512-armv8.S:1039) sha512-armv8.S.o:(.text+0x1108) in archive libcrypto.a clang: error: linker command failed with exit code 1 (use -v to see invocation) [4/10] Linking CXX shared library libovpn3.so FAILED: libovpn3.so cmd.exe /C "cd . && D:\Programs\programming\android\sdk\sdk25.02\ndk\22.0.6917172\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android21 --gcc-toolchain=D:/Programs/programming/android/sdk/sdk25.02/ndk/22.0.6917172/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=D:/Programs/programming/android/sdk/sdk25.02/ndk/22.0.6917172/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -O2 -DNDEBUG -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_real.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libovpn3.so -o libovpn3.so CMakeFiles/ovpn3.dir/openvpn3/client/ovpncli.cpp.o CMakeFiles/ovpn3.dir/ovpncli_wrap.cxx.o libcrypto.a libssl.a liblzo.a liblz4.a libcrypto.a -latomic -lm && cd ." ld: error: relocation R_AARCH64_ADR_PREL_LO21 cannot be used against symbol poly1305_blocks; recompile with -fPIC defined in libcrypto.a(poly1305-armv8.S.o) referenced by poly1305-armv8.S:43 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/poly1305/asm\poly1305-armv8.S:43) poly1305-armv8.S.o:(poly1305_init) in archive libcrypto.a

ld: error: relocation R_AARCH64_ADR_PREL_LO21 cannot be used against symbol poly1305_emit; recompile with -fPIC

defined in libcrypto.a(poly1305-armv8.S.o) referenced by poly1305-armv8.S:45 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/poly1305/asm\poly1305-armv8.S:45) poly1305-armv8.S.o:(poly1305_init) in archive libcrypto.a

ld: error: relocation R_AARCH64_PREL64 cannot be used against symbol OPENSSL_armcap_P; recompile with -fPIC

defined in libcrypto.a(armcap.c.o) referenced by poly1305-armv8.S:852 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/poly1305/asm\poly1305-armv8.S:852) poly1305-armv8.S.o:(.text+0x9A0) in archive libcrypto.a

ld: error: relocation R_AARCH64_PREL64 cannot be used against symbol OPENSSL_armcap_P; recompile with -fPIC

defined in libcrypto.a(armcap.c.o) referenced by sha1-armv8.S:1204 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/sha/asm\sha1-armv8.S:1204) sha1-armv8.S.o:(.text+0x1240) in archive libcrypto.a

ld: error: relocation R_AARCH64_PREL64 cannot be used against symbol OPENSSL_armcap_P; recompile with -fPIC

defined in libcrypto.a(armcap.c.o) referenced by sha256-armv8.S:1041 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/sha/asm\sha256-armv8.S:1041) sha256-armv8.S.o:(.text+0xF88) in archive libcrypto.a

ld: error: relocation R_AARCH64_PREL64 cannot be used against symbol OPENSSL_armcap_P; recompile with -fPIC

defined in libcrypto.a(armcap.c.o) referenced by sha512-armv8.S:1039 (E:/ics-openvpn-git/ics-openvpn/main/src/main/cpp/openssl/crypto/sha/asm\sha512-armv8.S:1039) sha512-armv8.S.o:(.text+0x1108) in archive libcrypto.a clang++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.

siromidz commented 3 years ago

any idea for solving this problem?

schwabe commented 3 years ago

Absolutely none. I never seen that. Is that somehow an unclean build or something like that?

schwabe commented 3 years ago

It seems you are using NDK 22 when both the download page (https://developer.android.com/ndk/downloads) and my android studio don't offer me any version newer than 21

siromidz commented 3 years ago

thank you using NDK21 solved my problem.