Open kettes-leulhetsz opened 5 years ago
Found LLVM: /data/data/com.termux/files/usr (found suitable version "8.0.1", minimum required is "3.9")
- is that our fork? It won't work without it (custom TLS emulation...).bin/ldc2 --version
to output the default triple of your native LDC and compare it to the cross-compiled termux-ldc.-DTARGET_SYSTEM='Android;Linux;UNIX'
in the CMake cmdline, as CMake doesn't detect Android (or at least used not to).LLVM is stock libllvm-static
from termux-stable. Default targets are the same though:
~/l/l/build> bin/ldc2 --version | grep Default
Default target: aarch64-linux-android
~/l/l/build> ldc2 --version | grep Default
Default target: aarch64--linux-android
The triples are not the same:
Warning: unknown target OS: android
), no explicit environmentSo setting env variable DFLAGS='-mtriple=aarch64--linux-android'
should get you somewhat further with stock LLVM. [The default triple can be customized in the LLVM CMake command line, see the Wiki.]
Tried building ldc-llvm with:
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_ENABLE_CXX1Y=OFF -DLLVM_PARALLEL_LINK_JOBS=5 -DLLVM_TARGETS_TO_BUILD="AArch64" -DLLVM_LINK_LLVM_DYLIB=ON -GNinja -DCMAKE_INSTALL_PREFIX=$PREFIX -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_ENABLE_LTO=Thin
/data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: lib/libLLVMSupport.a: error adding symbols: archive has no index; run ranlib to add one
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Thin LTO would've been nice for linker memory usage. Retrying without it.
Apparently there's UserLAnd which seems to be a Termux fork that runs full distros under proot, but ldc isn't packaged for its Ubuntu yet. I can't think of a use case where Termux comes out on top in comparison if this takes off.
Thin LTO would've been nice for linker memory usage.
Code generation at link time consumes less memory than linking machine-code objects and libraries? CMAKE_BUILD_TYPE=Release
probably helps with linker memory requirements.
Yes, it does. I've had it peak at 500 Mb on Chromium builds. The article also claims build times comparable to non-LTO builds due to parallel linking.
Yes, it does.
I don't see any mention of that in the linked article.
It's this picture, with the text
On the memory consumption side, the improvements are significant. Over the last two years, FullLTO was significantly improved, as shown on the chart below, but our measurement shows that ThinLTO keeps a large advantage.
That large advantage is an advantage over regular linking, too, for a large enough project.
That large advantage is an advantage over regular linking, too, for a large enough project.
Yeah but that's exactly what the article doesn't mention at all. ;)
How's it going, were you able to build LDC and the libraries successfully with termux-ldc?
Yeah but that's exactly what the article doesn't mention at all. ;)
That's why you need to run a source-based distro on underpowered hardware for a decade. You'll pick up these things :P
I do have a sneaking suspicion that rustc's parallelism and low memory usage was heavily influenced by ThinLTO. I'm seeing absurdly low mem usage even when it hogs all the CPUs and/or cargo builds all the things in parallel. Pouring a million man hours into a bad design can make it tolerable, who would've thought.
As for building ldc, I think I'll need to scale back on my ambitions for now. (You know you've picked the wrong hobby when bootstrapping an Exherbo in Arch in UserLAnd in Android seems like a reasonable idea...) Currently blocked on a bfd assert with no replacement linker. Should I keep this open?
Currently blocked on a bfd assert with no replacement linker.
Our Ubuntu-aarch64 CI is flooded with gold
warnings: Erratum 843419 found and fixed at ...
Maybe you need --fix-cortex-a53-843419
as additional linker flag?
All packages are termux-latest.