From 7298104a8699ad58226e9995ef7a8417932b2110 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Wed, 7 Aug 2024 09:30:14 -0500 Subject: user/llvm18: Tweaks and fixes * DWARFLinker and friends: most of the test errors are related to musl's thread stack size. Use chelf instead of disabling the tests. They pass on gwyn now, but there are still two flaky dsymutil tests. * Ensure the libLLVM.so.18 library is still present in /usr/lib/llvm18. * Install llvm-gtest, needed for Clang's test suite. --- user/llvm18/APKBUILD | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'user/llvm18') diff --git a/user/llvm18/APKBUILD b/user/llvm18/APKBUILD index 8bcd3067f..d727afc2a 100644 --- a/user/llvm18/APKBUILD +++ b/user/llvm18/APKBUILD @@ -80,23 +80,12 @@ prepare() { rm test/tools/llvm-size/radix.test;; esac - # https://github.com/llvm/llvm-project/issues/96734 case $CARCH in ppc64|ppc|mips64|mips) # Appears to be a endianness issue. for _broken in eh_frame linker-llvm-union-fwd-decl; do rm test/tools/dsymutil/X86/$_broken.test; done - for _broken in accelerator-dwarf4 accelerator-dwarf5 \ - dwarf4-macro-short; do - rm test/tools/llvm-dwarfutil/ELF/X86/$_broken.test; - done - for _broken in inlined-static-variable.cpp keep-func.test \ - odr-fwd-declaration2.test odr-member-functions.cpp \ - odr-predictable-output2.test odr-string.test \ - odr-types-in-subprogram1.test odr-uniquing.cpp; do - rm test/tools/dsymutil/X86/DWARFLinkerParallel/$_broken - done;; esac case $CTARGET_ARCH in @@ -133,10 +122,6 @@ prepare() { done esac - # appears to be an issue on musl and glibc, but only fails on musl: - # https://github.com/NixOS/nixpkgs/blob/bb7e9e46/pkgs/development/compilers/llvm/8/llvm.nix#L74 - # rm -f test/CodeGen/AArch64/wineh4.mir - #1053 rm -fr \ test/tools/UpdateTestChecks \ @@ -183,6 +168,7 @@ build() { -DLLVM_HOST_TRIPLE="$CHOST" \ -DLLVM_INCLUDE_BENCHMARKS=OFF \ -DLLVM_INCLUDE_EXAMPLES=OFF \ + -DLLVM_INSTALL_GTEST=ON \ -DLLVM_INSTALL_UTILS=ON \ -DLLVM_LINK_LLVM_DYLIB=ON \ -DLLVM_TARGETS_TO_BUILD='AArch64;AMDGPU;ARM;BPF;Hexagon;Lanai;Mips;MSP430;PowerPC;RISCV;Sparc;SystemZ;WebAssembly;X86;XCore' \ @@ -194,6 +180,13 @@ build() { make -C build python3 utils/lit/setup.py build + + # Thread 3 requires a lot of stack space to LTO when targeting ARM. + # Note that this occurs even when crossing (on a ppc64 host). + chelf -s 1048576 build/bin/llvm-lto2 + # Needed for parallel-linker support (pthread stack size). + chelf -s 1048576 build/bin/dsymutil + chelf -s 1048576 build/bin/llvm-dwarfutil } check() { @@ -210,10 +203,6 @@ package() { | awk -F: '$2~/ELF/{print $1}' \ | xargs -r chrpath -d - # Thread 3 requires a lot of stack space to LTO when targeting ARM. - # Note that this occurs even when crossing (on a ppc64 host). - chelf -s 1048576 bin/llvm-lto2 - # Symlink files from /usr/lib/llvm*/bin to /usr/bin. mkdir -p "$pkgdir"/usr/bin for full_name in bin/*; do @@ -263,7 +252,11 @@ libs() { # dynamically linked with libLLVM, so they can find it on default path. mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/$_prefix/lib/$main_soname "$subpkgdir"/usr/lib/ - mv "$pkgdir"/$_prefix/lib/libLLVM.so.$_majorver* "$subpkgdir"/usr/lib/ + _solinks=$(ls "$pkgdir"/$_prefix/lib/libLLVM.so.$_majorver*) + for link in $_solinks; do + _real_link=$(basename $link) + mv "$pkgdir"/$_prefix/lib/$_real_link "$subpkgdir"/usr/lib/ + done ln -s $main_soname "$subpkgdir"/usr/lib/$ver_soname strip "$subpkgdir"/usr/lib/$ver_soname #797 @@ -272,6 +265,10 @@ libs() { ln -s ../../$main_soname "$subpkgdir"/$_prefix/lib/$main_soname ln -s ../../$main_soname "$subpkgdir"/$_prefix/lib/$ver_soname ln -s ../../$main_soname "$subpkgdir"/$_prefix/lib/libLLVM.so + for link in $_solinks; do + _real_link=$(basename $link) + ln -s ../../$main_soname "$subpkgdir"/$_prefix/lib/$_real_link + done } dev() { -- cgit v1.2.3-70-g09d2