termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
36.94k stars 3.88k forks source link

[Bug]: TLS Segment Alignment Error on ARM64 Bionic in Termux #4225

Closed yuuuuuuan closed 1 month ago

yuuuuuuan commented 1 month ago

Problem description

I encountered an alignment error when running an executable on Termux. The error message is as follows:

error: "/data/data/com.termux/files/home/.foundry/bin/forge": executable's TLS segment is underaligned: alignment is 16, needs to be at least 64 for ARM64 Bionic
Aborted

Steps to reproduce the behavior.

curl -L https://foundry.paradigm.xyz | bash
foundryup
forge build

What is the expected behavior?

No response

System information

sylirre commented 1 month ago
  1. Sideloaded binaries really are not expected to work: https://wiki.termux.com/wiki/Differences_from_Linux
  2. Use termux-elf-cleaner $HOME/.foundry/bin/forge to fix alignment.

Alignment quirks related to operating system behavior. Termux is fully dependent on Android OS, it is not a standalone environment like Linux distribution chroot.