Open lry127 opened 9 months ago
It seems the toolchain you're using (NDK clang on linux-x86_64
) does not support the specified target architecture (aarch64-none-linux-android27
). Could you please provide the output of the following command?
$ /home/ubuntu/Android/Sdk/ndk/25.0.8775105/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -print-targets
Is there aarch64-linux-android27-clang++
under /home/ubuntu/Android/Sdk/ndk/25.0.8775105/toolchains/llvm/prebuilt/linux-x86_64/bin
?
thanks for your help and here is the output
$ /home/ubuntu/Android/Sdk/ndk/25.0.8775105/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -print-targets
Registered Targets:
aarch64 - AArch64 (little endian)
aarch64_32 - AArch64 (little endian ILP32)
aarch64_be - AArch64 (big endian)
arm - ARM
arm64 - ARM64 (little endian)
arm64_32 - ARM64 (little endian ILP32)
armeb - ARM (big endian)
bpf - BPF (host endian)
bpfeb - BPF (big endian)
bpfel - BPF (little endian)
thumb - Thumb
thumbeb - Thumb (big endian)
x86 - 32-bit X86: Pentium-Pro and above
x86-64 - 64-bit X86: EM64T and AMD64
there is a c++ compiler on that path and in fact if i don't specify -fpass-plugin
flag, code compiles without problem.
ubuntu@ubuntu:~$ ls /home/ubuntu/Android/Sdk/ndk/25.0.8775105/toolchains/llvm/prebuilt/linux-x86_64/bin | grep aarch64-linux-android27-clang++
aarch64-linux-android27-clang++
the full error logs are here: CMakeOutput.log CMakeError.log
and the ndk was downloaded from the offical sdk manager
here is my gradle project with all sensitive information removed. project.tar.gz my environmental varibles are:
ubuntu@ubuntu:~/AndroidStudioProjects$ echo $LD_LIBRARY_PATH
/home/ubuntu/Android/Sdk/ndk/25.0.8775105/toolchains/llvm/prebuilt/linux-x86_64/lib64
ubuntu@ubuntu:~/AndroidStudioProjects$ echo $OMVLL_CONFIG
/home/ubuntu/AndroidStudioProjects/NativeObfuscateTest3/ollvm-cfg.py
ubuntu@ubuntu:~/AndroidStudioProjects$ echo $OMVLL_PYTHONPATH
/home/ubuntu/AndroidStudioProjects/NativeObfuscateTest3/Python-3.10.7/Lib
I followed the documentation found here and the version of o-mvll so file was release 1.0.3. thanks for your kind help :)
Thanks for the output. We are evaluating a few solutions, meanwhile would you disable break_control_flow
in the config file for now? We tested it internally and it works correctly. We experienced other orthogonal issues in the execution though, so you may need to disable obfuscate_string
too.
Thanks for your advice. Code now compiles and executes correctly. I also found that obfuscate_string
will still work provided that obfuscate_string
returns omvll.StringEncOptGlobal()
rather than omvll.StringEncOptStack()
.
obfuscate_string
works if the config file returns omvll.StringEncOptGlobal()
and there's only one file contains string literals. Otherwise, errors are emitted by the linker because of duplicate symbol. For example, if two source files, say foo.cpp and bar.cpp, are compiled into one shared library and each contains one string literal, the linker will report the following error.
ld: error: duplicate symbol: __omvll_decode
>>> defined at foo.cpp
>>> CMakeFiles/nativeobfuscatetest3.dir/foo.cpp.o:(__omvll_decode)
>>> defined at bar.cpp
>>> CMakeFiles/nativeobfuscatetest3.dir/bar.cpp.o:(.text.__omvll_decode+0x0)
Dear lry127,
Many thanks for your input. We managed to reproduce the issue but couldn't find a quick solution to it. Our focus right now is on iOS, so it might take a while until we can fix this, but eventually we will.
Best regards, Marc
I'm trying to compile the library on my own and studying the source code, I think maybe I can help with the android part after understanding major part of the code. :-)
Awesome! Please let us know if you need any assistance, we'd be more than happy to help!
Re-opening the issue as there's a bug that we have to figure out at some point, even if it doesn't have top prio
Closing this, as implicitly solved by bd1440f5ce8660781113d9ebb31d5852873b6e61, thanks @lry127 for the additional feedback.
Hi @antoniofrighetto ,
I kept this open because of the issue related to break_control_flow
. So I am reopening it and changing the title to avoid future confusion.
BR, Marc
cmake can't compile a test program host: ubuntu 2204 x86_64 app.gradle:
C++ compiler (assembler) output:
config file: