Commit 3d2d815
committed
rmpkg(main/binutils-is-llvm): make LLVM binutils default in Termux
- My idea of a different solution to:
- #8191
- #9715
- #16588
- Reverts:
- #10012
- #13045
- Make Termux behave more similarly to the LLVM-based desktop Linux distro, Chimera Linux
- Preserve `as` name for GNU `as`, since `llvm-as` is not compatible with software expecting GNU `as`, and Chimera Linux also gives that name to GNU `as`: #11218
- Source code and runtime behavior of Chimera Linux observed to design this PR https://chimera-linux.org/
| Binutil | Chimera Linux | Vanilla Android | Termux Current | Termux This PR |
|:----------- |:------------- |:----------------- |:-------------- |:-------------- |
| `addr2line` | LLVM | `llvm-` name only | Variable | LLVM |
| `ar` | LLVM | `llvm-` name only | Variable | LLVM |
| `as` | GNU | `llvm-` name only | GNU | GNU |
| `c++filt` | LLVM | `llvm-` name only | Variable | LLVM |
| `elfedit` | LLVM | `llvm-` name only | Variable | LLVM |
| `ld` | LLVM | LLVM | Variable | LLVM |
| `nm` | LLVM | `llvm-` name only | Variable | LLVM |
| `objcopy` | LLVM | `llvm-` name only | Variable | LLVM |
| `objdump` | LLVM | `llvm-` name only | Variable | LLVM |
| `prof` | LLVM | `llvm-` name only | Variable | LLVM |
| `ranlib` | LLVM | `llvm-` name only | Variable | LLVM |
| `readelf` | LLVM | `llvm-` name only | Variable | LLVM |
| `size` | LLVM | `llvm-` name only | Variable | LLVM |
| `strings` | LLVM | `llvm-` name only | Variable | LLVM |
| `strip` | LLVM | `llvm-` name only | Variable | LLVM |
- This is **not** a project to move Termux away from GNU in general. It is a project to make Termux have a consistent default implementation of a component that is among the group of components for which most distros pick a default and stick to it:
| Component | GNU/Linux | Alpine Linux | Chimera Linux | FreeBSD | MacOS | Vanilla Android | Termux Current | Termux This PR |
|:----------- |:--------- |:------------ |:------------- |:------- |:----- |:--------------- |:-------------- |:-------------- |
| C stdlib | GNU | musl | musl | BSD | BSD | bionic | bionic | bionic |
| C++ stdlib | GNU | GNU | LLVM | LLVM | LLVM | LLVM | LLVM | LLVM |
| Compiler | GNU | GNU | LLVM | LLVM | LLVM | LLVM | LLVM | LLVM |
| Binutils | GNU | GNU | LLVM | LLVM | LLVM | LLVM | **Variable** | LLVM |
| Make | GNU | GNU | GNU | BSD | BSD | GNU | GNU | GNU |
| Coreutils | GNU | busybox | BSD | BSD | BSD | toybox | GNU | GNU |
most LLVM-based distros and operating systems choose the LLVM binutils, so choosing the LLVM binutils for Termux is reasonable and will contribute to the consistency of the wider LLVM-based distro ecosystem.
- After #28438 , it is now impossible to have `binutils-is-llvm` and `ldd`, `binutils-bin` or `lua-language-server` installed simultaneously.
- This disturbance to the prior status quo might inconvenience users of `ldd`, `lua-language-server`, `binutils-bin` or similar packages who are trying to build Termux packages on-device.
- This is considered to have occurred due to the difficulty of maintaining multiple packages that provide binutils simultaneously, so the goal is now to reevaluate the default binutils executables provided in Termux, and make changes that solve the problem without reverting #28438 while aligning Termux more closely with the current choices used by an LLVM-based desktop Linux distro that also provides a GNU binutils package, Chimera Linux.
After this, it will unfortunately be more difficult to compile certain software in Termux.
Here is one example that I know of:
```bash
git clone https://github.com/paullouisageneau/libjuice.git
cd libjuice
make
```
It would work before this PR if `binutils` was installed, but after this PR, it will show this error:
```
ar: error: unknown option f
```
(yes, this error also happens when building libjuice in Chimera Linux)
Before this PR, it could be worked around by using `pkg install binutils`,
but after this PR, it will only be possible to work around by either changing the invocation of `ar` to `gar` or removing the argument `f` from the instance of call to `ar` in `Makefile`.
However:
- it is already more difficult to compile software in Termux that has problems with Clang but not GCC, or problems with libc++ but not libstdc++, or problems with alternative libc but not glibc, and the additional limitation imposed by defaulting to LLVM binutils is expected to be relatively minimal
- libjuice is not an official Termux package, and if it were, it would have already had to be patched to avoid this error anyway, because Termux currently has `ar` set to `llvm-ar` for building in multiple places:
https://github.com/termux/termux-packages/blob/eaad7e0549ccf2fc3aa4919dc15b8306ce61dffc/scripts/build/toolchain/termux_setup_toolchain_29.sh#L11
https://github.com/termux/termux-packages/blob/eaad7e0549ccf2fc3aa4919dc15b8306ce61dffc/scripts/setup-termux.sh#L14
- This will make the default behavior of building software in Termux more consistently similar not only to the behavior of the vanilla Android NDK, and not only to behavior of the `termux_setup_toolchain_29()` and `setup-termux.sh` of termux-packages, but also to the behavior of the LLVM-based desktop Linux distro, Chimera Linux.
- Any time `clang` is installed, all of the LLVM binutils in the `llvm` package are also already installed, just with `llvm-` prepended to their names, so for most situations, the `binutils` package is implementing duplicate functionality while taking up additional space
%ci:no-build1 parent 0ed8d82 commit 3d2d815
20 files changed
Lines changed: 142 additions & 78 deletions
File tree
- disabled-packages/binutils-is-llvm
- packages
- atool
- binutils
- debootstrap
- flang
- gauche
- ldc
- ldd
- libllvm
- opencl-vendor-driver
- termux-apt-repo
- termux-create-package
- scripts
- build/setup
- x11-packages/xarchiver
File renamed without changes.
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
0 commit comments