Android compilation
Hello, sorry. I'm currently looking through the docs and haven't found how to manually compile a box64 for Android. Maybe I haven't found it yet, so I'd like to ask you. If I were to compile, on this side, I'm using the cross-compilation toolchain on the virtual machine Ubuntu. Could you recommend which toolchain I should use for the compilation? Thank you! Because I also want to do the compilation manually and enjoy the process.
I'm very curious about the specific steps for compiling Box64 (an Android-compatible version) on Ubuntu.
I saw that you have already created box64 for Android which is usable on Android. Is it necessary to modify the source code of box64?
@lumui I have tried to setup the Box64 and Wine combination in Termux for Android for some weeks in spare time, without paying too much attention on it. I never succeeded. Looks like some DLL is pointing to a wrong memory address or something. I could see the Winlator project having some commits changing the memory addresses (I think it was in a virtual.c), maybe this was the fix, dont know
I tried RyanFortner Box64 build and building Box64 too, but no luck. Same for Wine, only tried the Kron4ek builds (many different versions), because the Wine build can be more complex
In almost every combination, I get the same error, but I dont have the knowledge to check logs and debug it and, as said, didnt pay too much attention to it. The following shows the error, in case it helps you:
Welcome to Termux
Docs: https://doc.termux.com
Community: https://community.termux.com
Working with packages:
- Search: pkg search <query>
- Install: pkg install <package>
- Upgrade: pkg upgrade
Report issues at https://bugs.termux.com
~ $ proot-distro login debian
Warning: CPU doesn't support 32-bit instructions, some software may not work.
bash: export: `/aarch64-linux-gnu/:/usr/lib/arm-linux-gnueabihf/:/usr/lib/i386-linux-gnu/': not a valid identifier
bash: export: `-linux-gnu/:/lib/arm-linux-gnueabihf/:/usr/lib/aarch64-linux-gnu/:/usr/lib/arm-linux-gnueabihf/:/usr/lib/i386-linux-gnu': not a valid identifier
bash: export: `/:/usr/lib/x86_64-linux-gnu': not a valid identifier
root@localhost:~# box64 wine64 notepad++.exe
[BOX64] Box64 arm64 v0.3.5 a8adde92 with Dynarec built on May 10 2025 06:40:19
[BOX64] Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT AFP RNDR
[BOX64] Running on - with 8 cores, pagesize: 4096
[BOX64] Will use hardware counter measured at 19.2 MHz emulating 2.4 GHz
[BOX64] Wine64 detected, WINEPRELOADRESERVE=""
[BOX64] Didn't detect 48bits of address space, considering it's 39bits
[BOX64] Warning, program break not found
[BOX64] WINE prereserve of 0x10000:0x8000 done
[BOX64] WINE prereserve of 0x7f000000:0x3000000 done
[BOX64] Detected running wine with "notepad++.exe"
[BOX64] Counted 27 Env var
[BOX64] Library search path:
[BOX64] Binary search path: /root/wine64/bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/:/data/data/com.termux/files/usr/bin/:/system/bin/:/system/xbin/
[BOX64] Looking for wine64
[BOX64] BOX64ENV: Variables overridden via env and/or RC file:
BOX64_LD_LIBRARY_PATH=/root/wine64/lib/i386-unix/:/root/wine64/lib/wine/x86_64-unix/:/lib/i386-linux-gnu/:/lib/x86_64-linux-gnu:/lib/aarch64
BOX64_MAXCPU=64
BOX64_PATH=/root/wine64/bin/
[BOX64] argv[1]="notepad++.exe"
[BOX64] Rename process to "wine64"
[BOX64] Using native(wrapped) libdl.so.2
[BOX64] Using native(wrapped) libpthread.so.0
[BOX64] Using native(wrapped) libc.so.6
[BOX64] Using native(wrapped) ld-linux-x86-64.so.2
[BOX64] Using native(wrapped) libutil.so.1
[BOX64] Using native(wrapped) librt.so.1
[BOX64] Using native(wrapped) libbsd.so.0
[BOX64] Using emulated /root/wine64/bin/../lib/wine/x86_64-unix/ntdll.so
[BOX64] Using emulated /usr/lib/box64-x86_64-linux-gnu/libgcc_s.so.1
[BOX64] Box64 arm64 v0.3.5 a8adde92 with Dynarec built on May 10 2025 06:40:19
[BOX64] Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT AFP RNDR
[BOX64] Running on - with 8 cores, pagesize: 4096
[BOX64] Will use hardware counter measured at 19.2 MHz emulating 2.4 GHz
[BOX64] Wine64 detected, WINEPRELOADRESERVE=""
[BOX64] Didn't detect 48bits of address space, considering it's 39bits
[BOX64] Warning, program break not found
[BOX64] WINE prereserve of 0x10000:0x8000 done
[BOX64] WINE prereserve of 0x7f000000:0x3000000 done
[BOX64] Detected running wine with "notepad++.exe"
[BOX64] Counted 30 Env var
[BOX64] Library search path:
[BOX64] Binary search path: /root/wine64/bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/:/data/data/com.termux/files/usr/bin/:/system/bin/:/system/xbin/
[BOX64] Looking for /root/wine64/bin/wine64
[BOX64] BOX64ENV: Variables overridden via env and/or RC file:
BOX64_LD_LIBRARY_PATH=/root/wine64/lib/i386-unix/:/root/wine64/lib/wine/x86_64-unix/:/lib/i386-linux-gnu/:/lib/x86_64-linux-gnu:/lib/aarch64
BOX64_MAXCPU=64
BOX64_PATH=/root/wine64/bin/
[BOX64] argv[1]="notepad++.exe"
[BOX64] Rename process to "wine64"
[BOX64] Using native(wrapped) libdl.so.2
[BOX64] Using native(wrapped) libpthread.so.0
[BOX64] Using native(wrapped) libc.so.6
[BOX64] Using native(wrapped) ld-linux-x86-64.so.2
[BOX64] Using native(wrapped) libutil.so.1
[BOX64] Using native(wrapped) librt.so.1
[BOX64] Using native(wrapped) libbsd.so.0
[BOX64] Using emulated /root/wine64/bin/../lib/wine/x86_64-unix/ntdll.so
[BOX64] Using emulated /usr/lib/box64-x86_64-linux-gnu/libgcc_s.so.1
[BOX64] posix_spawn(0x7a6893680c, "/root/wine64/bin/wineserver", (nil), (nil), 0x7a68936810["/root/wine64/bin/wineserver", "", ...], 0x7a68936c78), IsX64=1, IsX86=0 IsScript=0 envp is context->envv
[BOX64] => posix_spawn(0x7a6893680c, "/usr/local/bin/box64", (nil), (nil), 0x7fdb522d20 ["/usr/local/bin/box64", "/root/wine64/bin/wineserver", ""...:1], 0x7fdb5234f8)
[BOX64] posix_spawn returned 0
[BOX64] Box64 arm64 v0.3.5 a8adde92 with Dynarec built on May 10 2025 06:40:19
[BOX64] Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT AFP RNDR
[BOX64] Running on - with 8 cores, pagesize: 4096
[BOX64] Will use hardware counter measured at 19.2 MHz emulating 2.4 GHz
[BOX64] Didn't detect 48bits of address space, considering it's 39bits
[BOX64] Warning, program break not found
[BOX64] Counted 30 Env var
[BOX64] Library search path:
[BOX64] Binary search path: /root/wine64/bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/:/data/data/com.termux/files/usr/bin/:/system/bin/:/system/xbin/
[BOX64] Looking for /root/wine64/bin/wineserver
[BOX64] BOX64ENV: Variables overridden via env and/or RC file:
BOX64_LD_LIBRARY_PATH=/root/wine64/lib/i386-unix/:/root/wine64/lib/wine/x86_64-unix/:/lib/i386-linux-gnu/:/lib/x86_64-linux-gnu:/lib/aarch64
BOX64_PATH=/root/wine64/bin/
[BOX64] Rename process to "wineserver"
[BOX64] Using native(wrapped) libdl.so.2
[BOX64] Using native(wrapped) libc.so.6
[BOX64] Using native(wrapped) ld-linux-x86-64.so.2
[BOX64] Using native(wrapped) libpthread.so.0
[BOX64] Using native(wrapped) libutil.so.1
[BOX64] Using native(wrapped) librt.so.1
[BOX64] Using native(wrapped) libbsd.so.0
002c:err:virtual:map_fixed_area out of memory for 0x6ffffff40000-0x6fffffff0000
002c:err:virtual:try_map_free_area mmap() error Cannot allocate memory, range 0x7ffffff40000-0x7fffffff0000, unix_prot 0x7.
002c:err:virtual:map_image_into_view failed to set 60500020 protection on L"\\??\\C:\\windows\\system32\\ntdll.dll" section .text, noexec filesystem?
002c:err:virtual:virtual_setup_exception stack overflow 1344 bytes addr 0xfffaddfc stack 0x7fff0ac0 (0x7fff0000-0x7fff1000-0x801f0000)
0024:err:virtual:map_fixed_area out of memory for 0x6ffffff40000-0x6fffffff0000
0024:err:virtual:try_map_free_area mmap() error Cannot allocate memory, range 0x7ffffff40000-0x7fffffff0000, unix_prot 0x7.
0024:err:virtual:map_image_into_view failed to set 60500020 protection on L"\\??\\C:\\windows\\system32\\ntdll.dll" section .text, noexec filesystem?
0024:err:virtual:virtual_setup_exception stack overflow 1344 bytes addr 0xfffaddfc stack 0x7fff0ac0 (0x7fff0000-0x7fff1000-0x801f0000)