box64 icon indicating copy to clipboard operation
box64 copied to clipboard

termux box64 build doesn't work?

Open FZXO11 opened this issue 3 months ago • 9 comments

I built box64 in termux following the guide in this repo and then tested something simple like 7z to know if it works but uhh

~ $ box64 7zz [BOX64] Box64 v0.3.7 04c1998f built on Sep 15 2025 05:06:13 [BOX64] Running on Cortex-A520 with 8 cores, pagesize: 4096 [BOX64] Will use time-based emulation for RDTSC, even if hardware counters are available [BOX64] Will use software counter measured at 1.0 GHz emulating 2.0 GHz [BOX64] Didn't detect 48bits of address space, considering it's 39bits [BOX64] Warning, program break not found [BOX64] Warning, older then 2.34 pthread_kill not found, using current one [BOX64] Counted 53 Env var [BOX64] Library search path: [BOX64] Binary search path: ./:bin/:/data/data/com.termux/files/usr/bin/ [BOX64] Looking for 7zz [BOX64] BOX64ENV: Variables overridden: BOX64_DYNAREC_ALIGNED_ATOMICS=1 BOX64_DYNAREC_BIGBLOCK=2 BOX64_DYNAREC_CALLRET=1 BOX64_DYNAREC_FORWARD=512 BOX64_DYNAREC_SAFEFLAGS=0 [BOX64] Rename process to "7zz" [BOX64] Error loading needed lib libc++_shared.so [BOX64] Using native(wrapped) libc.so [BOX64] Using native(wrapped) libpthread.so [BOX64] Using native(wrapped) libdl.so [BOX64] Using native(wrapped) libm.so [BOX64] Using native(wrapped) libbsd.so [BOX64] Error loading one of needed lib [BOX64] Error: Loading needed libs in elf /data/data/com.termux/files/home/./7zz ~ $

libc++_shared.so does exist in lib dir This is termux x86_64 7z

FZXO11 avatar Sep 15 '25 10:09 FZXO11

You need the x86_64 termux version of libc++_shared.so, 7zz seems to need it.

ptitSeb avatar Sep 15 '25 10:09 ptitSeb

@ptitSeb still doesn't work

[BOX64] Box64 v0.3.7 04c1998f built on Sep 15 2025 05:06:13 [BOX64] Running on Cortex-A520 with 8 cores, pagesize: 4096 [BOX64] Will use time-based emulation for RDTSC, even if hardware counters are available [BOX64] Will use software counter measured at 1.0 GHz emulating 2.0 GHz [BOX64] Didn't detect 48bits of address space, considering it's 39bits [BOX64] Warning, program break not found [BOX64] Warning, older then 2.34 pthread_kill not found, using current one [BOX64] Counted 53 Env var [BOX64] Library search path: [BOX64] Binary search path: ./:bin/:/data/data/com.termux/files/usr/bin/ [BOX64] Looking for 7zz [BOX64] BOX64ENV: Variables overridden: BOX64_DYNAREC_ALIGNED_ATOMICS=1 BOX64_DYNAREC_BIGBLOCK=2 BOX64_DYNAREC_CALLRET=1 BOX64_DYNAREC_FORWARD=512 BOX64_DYNAREC_SAFEFLAGS=0 [BOX64] Rename process to "7zz" [BOX64] Warning, program break not found [BOX64] Using emulated libc++_shared.so [BOX64] Using native(wrapped) libc.so [BOX64] Using native(wrapped) libpthread.so [BOX64] Using native(wrapped) libdl.so [BOX64] Using native(wrapped) libm.so [BOX64] Using native(wrapped) libbsd.so [BOX64] Warning, program break not found FORTIFY: fwrite: null FILE* [BOX64] EmulatedBT: box64(fwrite+0) [0x300100c0] [BOX64] EmulatedBT: /data/data/com.termux/files/home/7zz+255ec2 [0x100255ec2] [BOX64] EmulatedBT: ??? [0x6f4a63dc30] [BOX64] EmulatedBT: /data/data/com.termux/files/home/7zz+253d1b [0x100253d1b] [BOX64] EmulatedBT: /data/data/com.termux/files/home/7zz+257fe9 [0x100257fe9] [BOX64] EmulatedBT: ??? [0x6f4a63e3b0] [BOX64] EmulatedBT: ??? [0x6f4a63e3f0] [BOX64] EmulatedBT: ??? [0x0] [BOX64] 27982|SIGABRT @0x71ec87549c (abort(/apex/com.android.runtime/lib64/bionic/libc.so)) (x64pc=0x300100d3/"???", rsp=0x6f4a63dbf8), for accessing 0x27ea00006d4e (code=-1) RAX:0xb229bab891314800 RCX:0x0000000000000000 RDX:0x0000000000000001 RBX:0x0000000100288da8 RSP:0x0000006f4a63dbf8 RBP:0x0000006f4a63dc30 RSI:0x000000000000004a RDI:0x0000000100032f59 R8:0x0000000000000007 R9:0x0000000000000026 R10:0xb400006fd881f8f4 R11:0x0000000000000000 R12:0xb400006fd881f8f0 R13:0x0000000000000000 R14:0x0000000000000001 R15:0x0000006f4a63de98 ES:0x002b CS:0x0033 SS:0x002b DS:0x002b FS:0x0043 GS:0x0053 Aborted box64 7zz

FZXO11 avatar Sep 17 '25 07:09 FZXO11

It's a different error now: FORTIFY: fwrite: null FILE* and then the program Abort itself. This is not an error message from box64 here.

You might want to try with BOX64_NOBANNER=1 BOX64_LOG=0 to have box64 completly silent.

ptitSeb avatar Sep 17 '25 09:09 ptitSeb

I tested x86_64 grep on aarch64 Android instead of 7zz and it's working for me like this. I had to download both https://packages.termux.dev/apt/termux-main/pool/main/g/grep/grep_3.12-2_x86_64.deb and https://packages.termux.dev/apt/termux-main/pool/main/p/pcre2/pcre2_10.46_x86_64.deb and extract both of them, then set BOX64_LD_LIBRARY_PATH to the location of the x86_64 bionic libpcre2-8.so and then it worked, otherwise there was an error like the error in this issue except with libpcre2-8.so instead of libc++_shared.so.

~/code/build $ export BOX64_LOG=0
~/code/build $ export BOX64_LD_LIBRARY_PATH=$(pwd)/data/data/com.termux/files/usr/lib
~/code/build $ file $BOX64_LD_LIBRARY_PATH/libpcre2-8.so 
/data/data/com.termux/files/home/code/build/data/data/com.termux/files/usr/lib/libpcre2-8.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, for Android 24, built by NDK r28c (13676358), stripped
~/code/build $ ./box64  data/data/com.termux/files/usr/bin/grep --help
[BOX64] Box64 v0.3.7 e8ed7090 built on Oct  5 2025 03:43:31
[BOX64] Error: Symbol __gnu_strerror_r not found, cannot apply R_X86_64_JUMP_SLOT @0x100044280 (0x3f1a6) in /data/data/com.termux/files/home/code/build/data/data/com.termux/files/usr/bin/grep
Usage: ta/data/com.termux/files/usr/bin/grep [OPTION]... PATTERNS [FILE]...
Search for PATTERNS in each FILE.
Example: ta/data/com.termux/files/usr/bin/grep -i 'hello world' menu.h main.c
PATTERNS can contain multiple patterns separated by newlines.

Pattern selection and interpretation:
  -E, --extended-regexp     PATTERNS are extended regular expressions
  -F, --fixed-strings       PATTERNS are strings
  -G, --basic-regexp        PATTERNS are basic regular expressions

ptitSeb, since it has been a long time without bionic-compatible box86 or box64 distributed in termux, do you have any objection to those existing if I enable them if they work for me? I thought to ask in case there is any reason you would advise not to do that.

I tried a long time ago and this didn't work at least for me at that time, but now it's working so I think it should be enabled.

robertkirkman avatar Oct 05 '25 09:10 robertkirkman

@robertkirkman I'm sorry, I didn't understaood the question. You want to enable what exactly?

ptitSeb avatar Oct 05 '25 09:10 ptitSeb

Also, that __gnu_strerror_r missing symbol is a bionic specific one (signature seems to be pFipL)

ptitSeb avatar Oct 05 '25 09:10 ptitSeb

I would like to try to enable this package

https://github.com/termux/termux-packages/blob/master/disabled-packages/box86/build.sh

in the repository github.com/termux/termux-packages, and also add a box64 one, assuming they both work with minimal tests, which would cause pkg install box86 to work on 32-bit ARM Android devices running Termux, or pkg install box64 to work on 64-bit ARM Android devices running Termux, and both of those commands currently do not work.

A common reason that upstream might not want commands like that to be more accessible, I can imagine, is if they don't want to receive accidental bug reports from people who download the downstream package and don't know that they should report bugs only to https://github.com/termux/termux-packages/issues while using them, not https://github.com/ptitSeb/box64/issues, but I don't know whether that's something you would be concerned about.

robertkirkman avatar Oct 05 '25 09:10 robertkirkman

Also, that __gnu_strerror_r missing symbol is a bionic specific one (signature seems to be pFipL)

I see, however, at least for me grep seems to continue to otherwise work despite that error.

robertkirkman avatar Oct 05 '25 09:10 robertkirkman

I would like to try to enable this package

https://github.com/termux/termux-packages/blob/master/disabled-packages/box86/build.sh

in the repository github.com/termux/termux-packages, and also add a box64 one, assuming they both work with minimal tests, which would cause pkg install box86 to work on 32-bit ARM Android devices running Termux, or pkg install box64 to work on 64-bit ARM Android devices running Termux, and both of those commands currently do not work.

A common reason that upstream might not want commands like that to be more accessible, I can imagine, is if they don't want to receive accidental bug reports from people who download the downstream package and don't know that they should report bugs only to https://github.com/termux/termux-packages/issues while using them, not https://github.com/ptitSeb/box64/issues, but I don't know whether that's something you would be concerned about.

I don't have issue with that. But you should know that I am not the one that disabled it in the first place (nor added it to termux).

ptitSeb avatar Oct 05 '25 10:10 ptitSeb