Open manizzle opened 7 years ago
Cannot build for Android AARCH64.
I'm not surprised. You're probably the first person to try this.
Since ARM Linux, AArch64 Linux and ARM Android are implemented, perhaps AArch64 Android won't need a lot of extra work, but I don't know much about what's needed for Android. Derek, do you have any thoughts on this? Can you foresee any particular obstacles?
DR has to emulate the system loader, and Android's loader has unique behavior and interdependencies with Bionic. Emulating it is not implemented for A64. Mostly it's about setting up the first thread's pthread data structure. Xref https://github.com/DynamoRIO/dynamorio/issues/1701#issuecomment-175200703, #1920, #1862.
You could disable the Bionic stuff and plain DR will work (just no clients except ones with no deps)
I'm successfully building DR for Android AArch64, but even libinscount.so could not work.
/data/dynamorio # LD_LIBRARY_PATH=/system/lib ./bin64/drrun -debug -loglevel 4 -c samples/bin64/libinscount.so -- ls
WARNING: linker: Fixed LD_LIBRARY_PATH: /system/lib64
<log dir=/data/dynamorio/bin64/../logs/toybox.19361.00000000>
<Starting application /system/bin/toybox (19361)>
<Initial options = -no_dynamic_options -loglevel 4 -client_lib '/data/dynamorio/samples/bin64/libinscount.so;0;' -code_api -stack_size 56K -signal_stack_size 32K -max_elide_jmp 0 -max_elide_call 0 -early_inject -emulate_brk -no_inline_ignored_syscalls -native_exec_default_list '' -no_native_exec_managed_code -no_indcall2direct >
Trap
Could someone give a routine to fix DR working on Android-AArch64?
seems running without client work.
/data/dynamorio # LD_LIBRARY_PATH=/system/lib ./bin64/drrun -- ls
WARNING: linker: Fixed LD_LIBRARY_PATH: /system/lib64
<Starting application /system/bin/toybox (19479)>
<Initial options = -no_dynamic_options -code_api -stack_size 56K -signal_stack_size 32K -max_elide_jmp 0 -max_elide_call 0 -early_inject -emulate_brk -no_inline_ignored_syscalls -native_exec_default_list '' -no_native_exec_managed_code -no_indcall2direct >
<Paste into GDB to debug DynamoRIO clients:
set confirm off
add-symbol-file '/data/dynamorio/lib64/debug/libdynamorio.so' 0x00000075fdcf2f18
>
<get_memory_info mismatch! (can happen if os combines entries in /proc/pid/maps)
os says: 0x00000075fe4df000-0x00000075fe4ea000 prot=0x00000003
cache says: 0x00000075fe4e2000-0x00000075fe4e3000 prot=0x00000003
>
<CURIOSITY : out_data->alignment == alignment in file /home/xm1994/Projects/dynamorio/core/unix/module.c line 474
version 7.0.17871, custom build
-no_dynamic_options -code_api -stack_size 56K -signal_stack_size 32K -max_elide_jmp 0 -max_elide_call 0 -early_inject -emulate_brk -no_inline_ignored_syscalls -native_exec_default_list '' -no_native_exec_managed_code -no_indcall2direct
0x00000075e9cc96e0 0x00000075fe008aac
0x00000075e9cc9870 0x00000075fe014930
0x00000075e9cc9900 0x00000075fe007880
0x00000075e9cc99c0 0x00000075fde87a90
0x00000075e9cc9a50 0x00000075fde88200
0x00000075e9cc9aa0 0x00000075fdfe6ae8
0x00000075e9cc9b00 0x00000075fdfe6f7c
0x00000075e9cc9c20 0x00000075fdfe7c58
0x00000075e9cc9ca0 0x00000075fdd97260
0x00000075e9cc9e50 0x00000075fdd8d68c
0x00000075e9cc9e80 0x00000075fdd88e38
0x00000075e9cc9f40 0x00000075fe3b89e8
0x0000007ffa7baf20 0x00000075fe3b8584
0x0000007ffa7baf40 0x00000075fe3a4778
0x0000007ffa7baf70 0x00000075fe3a3e78>
<CURIOSITY : out_data->alignment == alignment in file /home/xm1994/Projects/dynamorio/core/unix/module.c line 474
version 7.0.17871, custom build
-no_dynamic_options -code_api -stack_size 56K -signal_stack_size 32K -max_elide_jmp 0 -max_elide_call 0 -early_inject -emulate_brk -no_inline_ignored_syscalls -native_exec_default_list '' -no_native_exec_managed_code -no_indcall2direct
0x00000075e9cc96e0 0x00000075fe008aac
0x00000075e9cc9870 0x00000075fe014930
0x00000075e9cc9900 0x00000075fe007880
0x00000075e9cc99c0 0x00000075fde87a90
0x00000075e9cc9a50 0x00000075fde88200
0x00000075e9cc9aa0 0x00000075fdfe6ae8
0x00000075e9cc9b00 0x00000075fdfe6f7c
0x00000075e9cc9c20 0x00000075fdfe7c58
0x00000075e9cc9ca0 0x00000075fdd97260
0x00000075e9cc9e50 0x00000075fdd8d68c
0x00000075e9cc9e80 0x00000075fdd88e38
0x00000075e9cc9f40 0x00000075fe3b89e8
0x0000007ffa7baf20 0x00000075fe3b8584
0x0000007ffa7baf40 0x00000075fe3a4778
0x0000007ffa7baf70 0x00000075fe3a3e78>
ACKNOWLEDGEMENTS License.txt README bin32 bin64 cmake ext include lib32 lib64 logs samples tools
<Stopping application /system/bin/toybox (19479)>
Help wanted. Probably reviving and finishing PR #3547 would be a good first step.
sounds good will take a look on the weekend
Has this issue been resolved now?
any update here?
New developers are needed to work on Android support. It sounds like there is interest: please consider contributing time.
Xref someone successfully building and running: https://groups.google.com/g/dynamorio-users/c/5lphjcB0Bwc/m/xzsJrOMlAAAJ
Cannot build for Android AARCH64.
Build for Android ARM32 works fine.
I initialize my toolchain like,
Replace linkers:
works fine.
Then if I try to do the same, but for aarch64 it fails:
I tried this cmake line:
and it errors with
So I tried with:
The cmake runs fine, but then when I build it with make -j, it errors with: