From 74ed84af668f99520d297a1502972b8a14b9b63b Mon Sep 17 00:00:00 2001 From: PktSurf Date: Sun, 10 Nov 2024 16:21:45 +0530 Subject: [PATCH] Added binutils 2.40 to base Split base/llvm package into base/llvm,clang,lld Updated base buildlist Discarded old heavybuilds/firefox patch --- base/.buildlist.base | 3 + ...gnu.attributes-are-not-checked-for-s.patch | 55 ++++++++++++++ .../binutils-ld-fix-static-linking.patch | 46 ++++++++++++ base/binutils/smbuild | 61 +++++++++++++++ base/clang/10-add-musl-triples.patch | 39 ++++++++++ base/clang/clang-003-as-needed.patch | 31 ++++++++ base/clang/smbuild | 74 +++++++++++++++++++ base/lld/smbuild | 58 +++++++++++++++ base/llvm/install-prefix.patch | 4 +- base/llvm/llvm-stack-size.patch | 23 ++++++ base/llvm/smbuild | 74 +++++++------------ heavybuilds/firefox/.old/fix-tools.patch | 13 ---- 12 files changed, 419 insertions(+), 62 deletions(-) create mode 100644 base/binutils/0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch create mode 100644 base/binutils/binutils-ld-fix-static-linking.patch create mode 100755 base/binutils/smbuild create mode 100644 base/clang/10-add-musl-triples.patch create mode 100644 base/clang/clang-003-as-needed.patch create mode 100644 base/clang/smbuild create mode 100644 base/lld/smbuild create mode 100644 base/llvm/llvm-stack-size.patch delete mode 100644 heavybuilds/firefox/.old/fix-tools.patch diff --git a/base/.buildlist.base b/base/.buildlist.base index f9d6ba9..6a9de9e 100644 --- a/base/.buildlist.base +++ b/base/.buildlist.base @@ -131,6 +131,7 @@ gmp mpfr mpc gcc +binutils libcroco libexif fribidi @@ -296,6 +297,8 @@ python-glad kernel-headers highlight llvm +clang +lld rust cbindgen libplist diff --git a/base/binutils/0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch b/base/binutils/0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch new file mode 100644 index 0000000..6e1fa77 --- /dev/null +++ b/base/binutils/0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch @@ -0,0 +1,55 @@ +From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Tue, 21 Sep 2021 14:53:13 +0000 +Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared + libraries" + +This revert is needed to avoid wrongly tagging objects with the incompatible +IBM long double ABI, which is not supported by musl and will result in +linking errors if used. + +This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba. +--- + bfd/elf32-tic6x.c | 3 --- + ld/ldlang.c | 10 ++++------ + 2 files changed, 4 insertions(+), 9 deletions(-) + +diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c +index 5754f3cb860..3ad1d612749 100644 +--- a/bfd/elf32-tic6x.c ++++ b/bfd/elf32-tic6x.c +@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info) + + case Tag_ABI_PIC: + case Tag_ABI_PID: +- /* Don't transfer these tags from dynamic objects. */ +- if ((ibfd->flags & DYNAMIC) != 0) +- continue; + if (out_attr[i].i > in_attr[i].i) + out_attr[i].i = in_attr[i].i; + break; +diff --git a/ld/ldlang.c b/ld/ldlang.c +index 37b64c89ee1..f13beaef9d9 100644 +--- a/ld/ldlang.c ++++ b/ld/ldlang.c +@@ -7071,13 +7071,11 @@ lang_check (void) + bfd_printable_name (input_bfd), input_bfd, + bfd_printable_name (link_info.output_bfd)); + } +- +- /* If the input bfd has no contents, it shouldn't set the +- private data of the output bfd. */ +- else if (!file->flags.just_syms +- && ((input_bfd->flags & DYNAMIC) != 0 +- || bfd_count_sections (input_bfd) != 0)) ++ else if (bfd_count_sections (input_bfd)) + { ++ /* If the input bfd has no contents, it shouldn't set the ++ private data of the output bfd. */ ++ + bfd_error_handler_type pfn = NULL; + + /* If we aren't supposed to warn about mismatched input +-- +2.33.0 + diff --git a/base/binutils/binutils-ld-fix-static-linking.patch b/base/binutils/binutils-ld-fix-static-linking.patch new file mode 100644 index 0000000..bc5d762 --- /dev/null +++ b/base/binutils/binutils-ld-fix-static-linking.patch @@ -0,0 +1,46 @@ +This fixes static linking for our hardened toolchain +diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc +index e8126cb..9532bfb 100644 +--- a/ld/scripttempl/elf.sc ++++ b/ld/scripttempl/elf.sc +@@ -235,8 +235,8 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS=" + if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then + SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))" + SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))" +- CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors" +- DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors" ++ CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .ctors" ++ DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .dtors" + else + SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))" + SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))" +@@ -270,15 +270,14 @@ CTOR=".ctors ${CONSTRUCTING-0} : + doesn't matter which directory crtbegin.o + is in. */ + +- KEEP (*crtbegin.o(.ctors)) +- KEEP (*crtbegin?.o(.ctors)) ++ KEEP (*crtbegin*.o(.ctors)) + + /* We don't want to include the .ctor section from + the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + +- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors)) ++ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + ${CONSTRUCTING+${CTOR_END}} +@@ -286,9 +285,8 @@ CTOR=".ctors ${CONSTRUCTING-0} : + DTOR=".dtors ${CONSTRUCTING-0} : + { + ${CONSTRUCTING+${DTOR_START}} +- KEEP (*crtbegin.o(.dtors)) +- KEEP (*crtbegin?.o(.dtors)) +- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors)) ++ KEEP (*crtbegin*.o(.dtors)) ++ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + ${CONSTRUCTING+${DTOR_END}} diff --git a/base/binutils/smbuild b/base/binutils/smbuild new file mode 100755 index 0000000..f8892ea --- /dev/null +++ b/base/binutils/smbuild @@ -0,0 +1,61 @@ +# Maintainer: PktSurf +app=binutils +version=2.40 +build=1sml +homepage="https://www.gnu.org/software/binutils/" +download="https://ftp.gnu.org/gnu/binutils/binutils-$version.tar.lz" +desc="Collection of utilities for examining ELF binaries" +requires="zlib zstd" +noautoconfsite=1 + +prepbuilddir() { + mkandenterbuilddir + rm -rf $app-$version + + tar xf $srcdir/$app-$version.tar.?z* + cd $app-$version + fixbuilddirpermissions + + applypatch $srcdir/0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch + applypatch $srcdir/binutils-ld-fix-static-linking.patch +} + +build() { + ./configure \ + --prefix=/usr \ + --libdir="/usr/lib" \ + --with-sysroot=/ \ + --enable-deterministic-archives \ + --enable-gold \ + --enable-64-bit-bfd \ + --enable-relro \ + --enable-threads \ + --enable-shared \ + --enable-plugins \ + --enable-default-hash-style=gnu \ + --enable-colored-disassembly \ + --enable-default-execstack=no \ + --enable-ld=default \ + --enable-new-dtags \ + --enable-targets=x86_64-pep \ + --with-pic \ + --with-mmap \ + --with-system-zlib \ + --disable-multilib \ + --disable-nls \ + --disable-gdb \ + --disable-werror \ + --disable-gprofng + + make + make install DESTDIR="$pkg" + + cp COPYING $pkgdocs + + mkfinalpkg +} +sha512sums=" +182c189285733adcc9bdcf9eaf047a558c025354db395f450ce346075a42eb8c05d7ebc6ffe84a439f094be27216f020812c2754507199e481922f0bc041b194 binutils-2.40.tar.lz +70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch +ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch +" diff --git a/base/clang/10-add-musl-triples.patch b/base/clang/10-add-musl-triples.patch new file mode 100644 index 0000000..a43574d --- /dev/null +++ b/base/clang/10-add-musl-triples.patch @@ -0,0 +1,39 @@ +--- a/lib/Driver/ToolChains/Gnu.cpp ++++ b/lib/Driver/ToolChains/Gnu.cpp +@@ -2073,7 +2073,7 @@ + static const char *const AArch64LibDirs[] = {"/lib64", "/lib"}; + static const char *const AArch64Triples[] = { + "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux", +- "aarch64-suse-linux"}; ++ "aarch64-suse-linux", "aarch64-linux-musl"}; + static const char *const AArch64beLibDirs[] = {"/lib"}; + static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu", + "aarch64_be-linux-gnu"}; +@@ -2085,7 +2085,9 @@ + "armv7l-linux-musleabihf", + "armv7hl-redhat-linux-gnueabi", + "armv6hl-suse-linux-gnueabi", +- "armv7hl-suse-linux-gnueabi"}; ++ "armv7hl-suse-linux-gnueabi", ++ "arm-linux-musleabihf", ++ "armv7l-linux-musleabihf"}; + static const char *const ARMebLibDirs[] = {"/lib"}; + static const char *const ARMebTriples[] = {"armeb-linux-gnueabi"}; + static const char *const ARMebHFTriples[] = { +@@ -2101,7 +2103,7 @@ + "x86_64-redhat-linux", "x86_64-suse-linux", + "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", + "x86_64-slackware-linux", "x86_64-unknown-linux", +- "x86_64-amazon-linux"}; ++ "x86_64-amazon-linux", "x86_64-pc-linux-musl"}; + static const char *const X32Triples[] = {"x86_64-linux-gnux32", + "x86_64-pc-linux-gnux32"}; + static const char *const X32LibDirs[] = {"/libx32", "/lib"}; +@@ -2110,6 +2112,7 @@ + "i586-linux-gnu", "i686-linux-gnu", "i686-pc-linux-gnu", + "i386-redhat-linux6E", "i686-redhat-linux", "i386-redhat-linux", + "i586-suse-linux", "i686-montavista-linux", "i686-gnu", ++ "i686-linux-musl", + }; + + static const char *const M68kLibDirs[] = {"/lib"}; diff --git a/base/clang/clang-003-as-needed.patch b/base/clang/clang-003-as-needed.patch new file mode 100644 index 0000000..a92836f --- /dev/null +++ b/base/clang/clang-003-as-needed.patch @@ -0,0 +1,31 @@ +forces as-needed regardless of ldflags +From f59f126a9344f265e3766003766d7a66b6a638e3 Mon Sep 17 00:00:00 2001 +From: Daniel Kolesa +Date: Sun, 23 Oct 2022 01:26:37 +0200 +Subject: [PATCH 3/4] clang: use --as-needed by default + +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index f203cae1d..9e181a79a 100644 +--- a/lib/Driver/ToolChains/Gnu.cpp ++++ b/lib/Driver/ToolChains/Gnu.cpp +@@ -560,6 +560,13 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, + bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs); + bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs); + addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs); ++ ++ // Use --as-needed by default for all explicit linker inputs on Linux ++ // We don't reset it afterwards because explicit argument does not ++ // get reset either (and that is permitted, so it should be fine) ++ if (Triple.isOSLinux()) ++ CmdArgs.push_back("--as-needed"); ++ + AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA); + + addHIPRuntimeLibArgs(ToolChain, Args, CmdArgs); +-- +2.38.0 + diff --git a/base/clang/smbuild b/base/clang/smbuild new file mode 100644 index 0000000..629920e --- /dev/null +++ b/base/clang/smbuild @@ -0,0 +1,74 @@ +# Maintainer: PktSurf +app=clang +version=17.0.6 +build=1sml +homepage="http://llvm.org/" +download="https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/llvm-$version.src.tar.xz" +desc="Clang from LLVM compiler toolkit" +requires="libffi libxml2 perl cmake" + +prepbuilddir() { + mkandenterbuilddir + rm -rf $app-$version.src + + tar xf $srcdir/$app-$version.src.tar.?z* + cd $app-$version.src + + ( + cd ../ + tar xf $srcdir/cmake-$version.src.tar.?z* + mv cmake-$version.src cmake + ) + + tar xf $srcdir/clang-tools-extra-$version.src.tar.?z* + mv clang-tools-extra-$version.src tools/extra + + tar xf $srcdir/third-party-$version.src.tar.?z* + mv third-party-$version.src third-party + + tar xf $srcdir/clang-tools-extra-$version.src.tar.?z* + mv clang-tools-extra-$version.src tools/extra + fixbuilddirpermissions + + applypatch $srcdir/10-add-musl-triples.patch + applypatch $srcdir/clang-003-as-needed.patch +} + +build() { + unset CFLAGS CXXFLAGS + + mkdir -p build + cmake -B build -G Ninja -Wno-dev \ + -DCMAKE_BUILD_TYPE=Release \ + -DCLANG_BUILT_STANDALONE=ON \ + -DCLANG_CONFIG_FILE_SYSTEM_DIR=/etc/clang \ + -DCLANG_DEFAULT_PIE_ON_LINUX=ON \ + -DCLANG_INCLUDE_TESTS=OFF \ + -DCLANG_LINK_CLANG_DYLIB=ON \ + -DCLANG_PLUGIN_SUPPORT=ON \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DENABLE_LINKER_BUILD_ID=ON \ + -DLLVM_INCLUDE_TESTS=OFF \ + -DLLVM_ENABLE_RTTI=ON \ + -DLLVM_LINK_LLVM_DYLIB=ON \ + -DLLVM_MAIN_SRC_DIR=../../llvm-$version.src \ + -DCMAKE_MODULE_PATH=../cmake/Modules + + ninja -C build clang-tblgen + ninja -C build + DESTDIR=$pkg cmake --install build + + cp LICENSE.TXT $pkgdocs/ + + mkfinalpkg +} + +sha512sums=" +9dee9b2897f8bc9eeb86cd726df706d6451f223bfc612c2c722aca3b70495546688bb28f6d6753e177731cb041d6a78d407a00215317d6cb17e56671c09ead59 clang-17.0.6.src.tar.lz +7c9b0def78f84fa6f2a5ef2a0f780d81638b27f1f40aaf98e199710404dfbc95d500a59a5dcc7714b8a472b9f259ceb42cc92412a6fcefdcd2f675b38ffb3485 clang-tools-extra-17.0.6.src.tar.lz +4ea1adcd10729f73e84d00e5800cb2f40daf7c3c91d6717fc7572d2db95902c927daed0b403c660beae673973431aecf854eeafa966bd2145ee917a8b090f78a cmake-17.0.6.src.tar.lz +0eb60df337875c110dfac112f6bb4e7686919f09c8e007b77a9f6e0f723c31721f09902e7b8bed07acea00aa5c02e07e3aee756fdf0caf74f01c4f9488107bbf llvm-17.0.6.src.tar.lz +242dada4800c5e558f5f243e6aa0905d90ca3f82cc81baf14c60de543a7e737d4c2f3471122f2c641dc4f0724e4ebf5cf137761a231b34aab2a12f1cfc902c53 third-party-17.0.6.src.tar.xz +606e7938a1f3402e38cbf38667154352e9e695f8120fa837836107d9878a152b3758ce4658f3192d6a509df3ead803a69c4f8ca599819331c7518f3479f8333d 10-add-musl-triples.patch +5f98f147d7d66315e9a56ae6fee602a053d40e57a8b1ee4f2ef1764203bb6fdb9082c8e825c535a9388213a38b49d2702b1e936fcf56560c4a2a56b7e6dd232c clang-003-as-needed.patch +" diff --git a/base/lld/smbuild b/base/lld/smbuild new file mode 100644 index 0000000..cf7f012 --- /dev/null +++ b/base/lld/smbuild @@ -0,0 +1,58 @@ +# Maintainer: PktSurf +app=lld +version=17.0.6 +build=1sml +homepage="http://llvm.org/" +download="https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/llvm-$version.src.tar.xz" +desc="lld linker from LLVM compiler toolkit" +requires="libffi libxml2 perl cmake" + +prepbuilddir() { + mkandenterbuilddir + rm -rf $app-$version.src + + tar xf $srcdir/$app-$version.src.tar.?z* + cd $app-$version.src + + ( + cd ../ + [[ -d cmake ]] && rm -r cmake + tar xf $srcdir/cmake-$version.src.tar.?z* + mv cmake-$version.src cmake + ) + + tar xf $srcdir/libunwind-$version.src.tar.?z* + mv libunwind-$version.src libunwind + cp -r libunwind/include/mach-o include/ + fixbuilddirpermissions +} + +build() { + unset CFLAGS CXXFLAGS + + mkdir -p build + + CC="clang" \ + CXX="clang++" \ + cmake -B build -G Ninja -Wno-dev \ + -DCMAKE_BUILD_TYPE=Release \ + -DLLD_BUILT_STANDALONE=ON \ + -DLLVM_INCLUDE_TESTS=OFF \ + -DCMAKE_SKIP_INSTALL_RPATH=ON \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_EXE_LINKER_FLAGS="-Wl,-z,stack-size=2097152" + + cmake --build build + DESTDIR=$pkg cmake --install build + + cp LICENSE.TXT $pkgdocs/ + + mkfinalpkg +} + +sha512sums=" +4ea1adcd10729f73e84d00e5800cb2f40daf7c3c91d6717fc7572d2db95902c927daed0b403c660beae673973431aecf854eeafa966bd2145ee917a8b090f78a cmake-17.0.6.src.tar.lz +93313c449a58f8f81a13231fd1e3168267bd504689fb5c6e9a0d8a99e3dfe0be68968f5614e00836808bd7a730121bc94f459ada8cf6cf010d13178a8446ae7e libunwind-17.0.6.src.tar.lz +8c313ba8f40015c10f6826bad5d7553ec1fc6c634b4a384789611f541bf210fd69fdd77f13a6bb8ee8fb2283d5a2c08dbbccf8603c7a2cec9904eb18c5fcc403 lld-17.0.6.src.tar.lz +" \ No newline at end of file diff --git a/base/llvm/install-prefix.patch b/base/llvm/install-prefix.patch index 7b8ce03..90f6c3e 100644 --- a/base/llvm/install-prefix.patch +++ b/base/llvm/install-prefix.patch @@ -9,8 +9,8 @@ always be correct, and what cmake tries to autodetect anyway. also see: https://reviews.llvm.org/D29969 this is supposedly fixed now, but for some reason it still isn't ---- a/cmake/modules/CMakeLists.txt -+++ b/cmake/modules/CMakeLists.txt +--- a/llvm/cmake/modules/CMakeLists.txt ++++ b/llvm/cmake/modules/CMakeLists.txt @@ -41,6 +41,8 @@ # diff --git a/base/llvm/llvm-stack-size.patch b/base/llvm/llvm-stack-size.patch new file mode 100644 index 0000000..0a05315 --- /dev/null +++ b/base/llvm/llvm-stack-size.patch @@ -0,0 +1,23 @@ +Patch-Source: https://github.com/chimera-linux/cports/blob/8c0359f31b9d888e59ced0320e93ca8ad79ba1f9/main/llvm/patches/0010-always-set-a-larger-stack-size-explicitly.patch +From 18e09846d9333b554e3dfbbd768ada6643bf92c0 Mon Sep 17 00:00:00 2001 +From: Daniel Kolesa +Date: Sat, 27 Nov 2021 01:03:28 +0100 +Subject: [PATCH 10/22] always set a larger stack size explicitly + +--- + llvm/lib/Support/Threading.cpp | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/llvm/lib/Support/Threading.cpp b/llvm/lib/Support/Threading.cpp +index 923935bbc..26594aac8 100644 +--- a/llvm/lib/Support/Threading.cpp ++++ b/llvm/lib/Support/Threading.cpp +@@ -77,7 +77,7 @@ unsigned llvm::ThreadPoolStrategy::compute_thread_count() const { + // keyword. + #include "llvm/Support/thread.h" + +-#if defined(__APPLE__) ++#if 1 + // Darwin's default stack size for threads except the main one is only 512KB, + // which is not enough for some/many normal LLVM compilations. This implements + // the same interface as std::thread but requests the same stack size as the diff --git a/base/llvm/smbuild b/base/llvm/smbuild index c2fb5af..9abf88b 100644 --- a/base/llvm/smbuild +++ b/base/llvm/smbuild @@ -6,56 +6,29 @@ homepage="http://llvm.org/" download="https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/llvm-$version.src.tar.xz" desc="LLVM compiler toolkit" requires="libffi libxml2 perl cmake" +preservestaticlibs=1 prepbuilddir() { mkandenterbuilddir - rm -rf $app-$version.src + rm -rf $app-project-$version.src # In case the user decides to resume an incomplete build [[ -d cmake ]] && rm -r cmake - tar xf $srcdir/$app-$version.src.tar.?z* - cd $app-$version.src + tar xf $srcdir/$app-project-$version.src.tar.?z* + cd $app-project-$version.src fixbuilddirpermissions - #applypatch $srcdir/install-prefix.patch - - buildtargets='X86;AMDGPU;BPF' - - # cmake modules directory needs to one level up - ( - cd .. - tar xf $srcdir/cmake-$version.src.tar.?z - mv cmake-$version.src cmake - ) - - ( - cd tools - tar xf $srcdir/clang-$version.src.tar.?z - mv clang-$version.src clang - tar xf $srcdir/lld-$version.src.tar.?z - mv lld-$version.src lld - ) - - ( - cd projects - tar xf $srcdir/libunwind-$version.src.tar.?z - mv libunwind-$version.src libunwind - ) - - ( - mkdir -p smbuild && cd smbuild - mkdir -p include - - cp -r ../projects/libunwind/include/mach-o include/ - rm -r ../projects/libunwind - ) + applypatch $srcdir/install-prefix.patch + applypatch $srcdir/llvm-stack-size.patch } build() { unset CFLAGS CXXFLAGS + + buildtargets="X86;AMDGPU;BPF" - cd smbuild - cmake .. -G Ninja -Wno-dev \ + mkdir -p build + cmake -B build -G Ninja -Wno-dev -S llvm \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DLLVM_BUILD_DOCS=OFF \ @@ -72,21 +45,28 @@ build() { -DLLVM_INCLUDE_EXAMPLES=OFF \ -DLLVM_BUILD_LLVM_DYLIB=ON \ -DLLVM_LINK_LLVM_DYLIB=ON \ - -DCLANG_RESOURCE_DIR="../lib/clang/$version" + -DLLVM_ENABLE_ZSTD=ON \ + -DLLVM_ENABLE_ZLIB=ON \ + -DLLVM_ENABLE_DUMP=ON \ + -DLLVM_BUILD_TESTS=OFF \ + -DLLVM_ENABLE_LIBCXX=OFF \ + -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON \ + -DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-pc-linux-musl" \ + -DLLVM_HOST_TRIPLE="x86_64-pc-linux-musl" - ninja $MAKEFLAGS - DESTDIR="$pkg" ninja install + cmake --build build + python3 llvm/utils/lit/setup.py build - cp ../LICENSE.TXT $pkgdocs/ + DESTDIR="$pkg" cmake --install build + python3 llvm/utils/lit/setup.py install --root="$pkg" + + cp LICENSE.TXT $pkgdocs/ mkfinalpkg } sha512sums=" -9dee9b2897f8bc9eeb86cd726df706d6451f223bfc612c2c722aca3b70495546688bb28f6d6753e177731cb041d6a78d407a00215317d6cb17e56671c09ead59 clang-17.0.6.src.tar.lz -4ea1adcd10729f73e84d00e5800cb2f40daf7c3c91d6717fc7572d2db95902c927daed0b403c660beae673973431aecf854eeafa966bd2145ee917a8b090f78a cmake-17.0.6.src.tar.lz -93313c449a58f8f81a13231fd1e3168267bd504689fb5c6e9a0d8a99e3dfe0be68968f5614e00836808bd7a730121bc94f459ada8cf6cf010d13178a8446ae7e libunwind-17.0.6.src.tar.lz -8c313ba8f40015c10f6826bad5d7553ec1fc6c634b4a384789611f541bf210fd69fdd77f13a6bb8ee8fb2283d5a2c08dbbccf8603c7a2cec9904eb18c5fcc403 lld-17.0.6.src.tar.lz -0eb60df337875c110dfac112f6bb4e7686919f09c8e007b77a9f6e0f723c31721f09902e7b8bed07acea00aa5c02e07e3aee756fdf0caf74f01c4f9488107bbf llvm-17.0.6.src.tar.lz -c2ca2124370ec43b9a2fa769aa5580f908453041450479d60458f03aa54e89604bd4225b5991cac0cb8c424cdb2e4e121b78e4175e591955f2fba2c3b0fd0851 install-prefix.patch +f369236cc5b96283ce9251b0abdc6b320f0d651182547622a8116df29a7540f6f818f3a20917e02b6afc1bc68a1e142d3c0abb87dc3d7df72308a646e6facc80 llvm-project-17.0.6.src.tar.lz +ebc0be314c129ef38f00c8c2be9d589658cae89ac8cda109e35933b5044e775a3d370c0c584d3e501e4d43167b8523d8c5e5a85653d8ebe853571697ae40fb35 install-prefix.patch +2123f01d8075a15cf8c2d8091fc8c92cb99807b1d654af13b436690ddb55f3e893a494593b3c92aeab26e50db4e0500ac688129ab6bc11e4765c0308b90db101 llvm-stack-size.patch " diff --git a/heavybuilds/firefox/.old/fix-tools.patch b/heavybuilds/firefox/.old/fix-tools.patch deleted file mode 100644 index 94de423..0000000 --- a/heavybuilds/firefox/.old/fix-tools.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/tools/profiler/core/platform-linux-android.cpp 2019-01-29 12:09:40.980448579 +0100 -+++ b/tools/profiler/core/platform-linux-android.cpp 2019-01-29 12:11:09.689590967 +0100 -@@ -497,8 +501,10 @@ - ucontext_t sSyncUContext; - - void Registers::SyncPopulate() { -+#if defined(__GLIBC__) - if (!getcontext(&sSyncUContext)) { - PopulateRegsFromContext(*this, &sSyncUContext); - } -+#endif - } - #endif