diff --git a/clang-14.0.3.src.tar.xz b/clang-14.0.3.src.tar.xz deleted file mode 100644 index 83a6ef7..0000000 --- a/clang-14.0.3.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f85c55f192cb35b9d6af1f998b7d5abe90e369f8b16445503ffab1b02e75a6f0 -size 18536196 diff --git a/clang-14.0.4.src.tar.xz b/clang-14.0.4.src.tar.xz new file mode 100644 index 0000000..66c5611 --- /dev/null +++ b/clang-14.0.4.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:922bdc8341491d4f54548c51bafd77c0e737a3146fe33c762bce31a0fd151591 +size 18537140 diff --git a/clang-docs-14.0.3.src.tar.xz b/clang-docs-14.0.3.src.tar.xz deleted file mode 100644 index 9b33991..0000000 --- a/clang-docs-14.0.3.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ab321f9490d589ca9fe740975a5c7e619815ac36177192d1859453066681a071 -size 1413576 diff --git a/clang-docs-14.0.4.src.tar.xz b/clang-docs-14.0.4.src.tar.xz new file mode 100644 index 0000000..f054799 --- /dev/null +++ b/clang-docs-14.0.4.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c993f5d31b764f677ea57700965886550577abe000bf8d35ea50daee7994ae3 +size 1413580 diff --git a/clang-tools-extra-14.0.3.src.tar.xz b/clang-tools-extra-14.0.3.src.tar.xz deleted file mode 100644 index f435575..0000000 --- a/clang-tools-extra-14.0.3.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f2c85533d586d63784df9d5208e147a35c59a4caed7ff9a0a1f39992a88110a1 -size 2849308 diff --git a/clang-tools-extra-14.0.4.src.tar.xz b/clang-tools-extra-14.0.4.src.tar.xz new file mode 100644 index 0000000..538dab3 --- /dev/null +++ b/clang-tools-extra-14.0.4.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8bacb565da90bd1eb76ac267a70a4287e238680c48f7bd00f0a890ce0ae8fed +size 2849200 diff --git a/compiler-rt-14.0.3.src.tar.xz b/compiler-rt-14.0.3.src.tar.xz deleted file mode 100644 index 87d9e74..0000000 --- a/compiler-rt-14.0.3.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:26568ab40e440d54a0fe05f6055dcbe510eb723977afa39d3b56fc2a81f8d05f -size 2327000 diff --git a/compiler-rt-14.0.4.src.tar.xz b/compiler-rt-14.0.4.src.tar.xz new file mode 100644 index 0000000..546c16f --- /dev/null +++ b/compiler-rt-14.0.4.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02cbb6ca3ae3ebfb77245de0866faff886b16c48a806cd2ae32ac6ccbba8285b +size 2327868 diff --git a/libcxx-14.0.3.src.tar.xz b/libcxx-14.0.3.src.tar.xz deleted file mode 100644 index 6f83e0b..0000000 --- a/libcxx-14.0.3.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ae5f31fc7c759fe68ceff3bcdaea9f8d439865bb965ac8d21ed5d15c42311796 -size 3066368 diff --git a/libcxx-14.0.4.src.tar.xz b/libcxx-14.0.4.src.tar.xz new file mode 100644 index 0000000..f1da7a4 --- /dev/null +++ b/libcxx-14.0.4.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9aad37282b0086b09b6d5489630dc8399577d64674071ae6e4ecf340c7e058be +size 3066664 diff --git a/libcxxabi-14.0.3.src.tar.xz b/libcxxabi-14.0.3.src.tar.xz deleted file mode 100644 index 4f2c21f..0000000 --- a/libcxxabi-14.0.3.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:21193c6a29248ba5b6dde40beb1f6bdcc7cd13cad66605c764ec100f0fb19fe3 -size 561780 diff --git a/libcxxabi-14.0.4.src.tar.xz b/libcxxabi-14.0.4.src.tar.xz new file mode 100644 index 0000000..47360f5 --- /dev/null +++ b/libcxxabi-14.0.4.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f526943c9b70836364f90d42ca4fa3f90505d02b5d8fa739937cc7b79c0580ac +size 561788 diff --git a/lld-14.0.3.src.tar.xz b/lld-14.0.3.src.tar.xz deleted file mode 100644 index de23e88..0000000 --- a/lld-14.0.3.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a91716f59f8e78018246a7ab6cad1bfdddec270c4db6d3d2a394844ee8799c8f -size 1366044 diff --git a/lld-14.0.4.src.tar.xz b/lld-14.0.4.src.tar.xz new file mode 100644 index 0000000..a9ce1aa --- /dev/null +++ b/lld-14.0.4.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05e1284a65166d0a3a1139b9993f1c632b82930501316ae20c88a204170c2ba6 +size 1366056 diff --git a/lldb-14.0.3.src.tar.xz b/lldb-14.0.3.src.tar.xz deleted file mode 100644 index 949a892..0000000 --- a/lldb-14.0.3.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e1d1ea7779faadb4c6af6b0541c6fe3346f750bd26d14ddc57186fe3140d0502 -size 10088540 diff --git a/lldb-14.0.4.src.tar.xz b/lldb-14.0.4.src.tar.xz new file mode 100644 index 0000000..e158210 --- /dev/null +++ b/lldb-14.0.4.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9301073df20728a8a64aca8d741465264b999649996009c2c30ba7a705459ff0 +size 10088328 diff --git a/llvm-14.0.3.src.tar.xz b/llvm-14.0.3.src.tar.xz deleted file mode 100644 index c711fad..0000000 --- a/llvm-14.0.3.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1e09e8c26e1b67bc94a128b62e9b9c24b70c697a2436a479c9e5eedc4ae29654 -size 49653148 diff --git a/llvm-14.0.4.src.tar.xz b/llvm-14.0.4.src.tar.xz new file mode 100644 index 0000000..44175a6 --- /dev/null +++ b/llvm-14.0.4.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb8e90dfadae4073a7f8fc6384bacc0dda072400d82b9d25dabb5280a737ba22 +size 49656144 diff --git a/llvm-do-not-install-static-libraries.patch b/llvm-do-not-install-static-libraries.patch index 3340ec0..5bfa006 100644 --- a/llvm-do-not-install-static-libraries.patch +++ b/llvm-do-not-install-static-libraries.patch @@ -2,10 +2,10 @@ This has similar effect as simply deleting the static libraries which we don't want after installation. By not copying them in the first place we reduce the disk usage during installation. -Index: clang-14.0.3.src/cmake/modules/AddClang.cmake +Index: clang-14.0.4.src/cmake/modules/AddClang.cmake =================================================================== ---- a/clang-14.0.3.src/cmake/modules/AddClang.cmake -+++ b/clang-14.0.3.src/cmake/modules/AddClang.cmake +--- a/clang-14.0.4.src/cmake/modules/AddClang.cmake ++++ b/clang-14.0.4.src/cmake/modules/AddClang.cmake @@ -106,12 +106,15 @@ macro(add_clang_library name) if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN) @@ -68,10 +68,10 @@ Index: cmake/modules/AddLLVM.cmake endif() if (ARG_MODULE) set_target_properties(${name} PROPERTIES FOLDER "Loadable modules") -Index: lld-14.0.3.src/cmake/modules/AddLLD.cmake +Index: lld-14.0.4.src/cmake/modules/AddLLD.cmake =================================================================== ---- a/lld-14.0.3.src/cmake/modules/AddLLD.cmake -+++ b/lld-14.0.3.src/cmake/modules/AddLLD.cmake +--- a/lld-14.0.4.src/cmake/modules/AddLLD.cmake ++++ b/lld-14.0.4.src/cmake/modules/AddLLD.cmake @@ -17,13 +17,6 @@ macro(add_lld_library name) if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) @@ -86,10 +86,10 @@ Index: lld-14.0.3.src/cmake/modules/AddLLD.cmake if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) add_llvm_install_targets(install-${name} DEPENDS ${name} -Index: polly-14.0.3.src/cmake/polly_macros.cmake +Index: polly-14.0.4.src/cmake/polly_macros.cmake =================================================================== ---- a/polly-14.0.3.src/cmake/polly_macros.cmake -+++ b/polly-14.0.3.src/cmake/polly_macros.cmake +--- a/polly-14.0.4.src/cmake/polly_macros.cmake ++++ b/polly-14.0.4.src/cmake/polly_macros.cmake @@ -42,12 +42,14 @@ macro(add_polly_library name) llvm_config(${name} ${LLVM_LINK_COMPONENTS}) endif( LLVM_LINK_COMPONENTS ) @@ -110,10 +110,10 @@ Index: polly-14.0.3.src/cmake/polly_macros.cmake endmacro(add_polly_library) macro(add_polly_loadable_module name) -Index: polly-14.0.3.src/lib/CMakeLists.txt +Index: polly-14.0.4.src/lib/CMakeLists.txt =================================================================== ---- a/polly-14.0.3.src/lib/CMakeLists.txt -+++ b/polly-14.0.3.src/lib/CMakeLists.txt +--- a/polly-14.0.4.src/lib/CMakeLists.txt ++++ b/polly-14.0.4.src/lib/CMakeLists.txt @@ -74,7 +74,7 @@ set_target_properties(PollyCore PROPERTI # It depends on all library it needs, such that with # LLVM_POLLY_LINK_INTO_TOOLS=ON, its dependencies like PollyISL are linked as diff --git a/llvm-docs-14.0.3.src.tar.xz b/llvm-docs-14.0.3.src.tar.xz deleted file mode 100644 index fcc9942..0000000 --- a/llvm-docs-14.0.3.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b4833bddd0d6bc75fd223d4f185094903d6cce40ec8c3d3fc25cc7702ebfaa2c -size 6601060 diff --git a/llvm-docs-14.0.4.src.tar.xz b/llvm-docs-14.0.4.src.tar.xz new file mode 100644 index 0000000..010044f --- /dev/null +++ b/llvm-docs-14.0.4.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e56dbb0ca5395222d0a6b9b4803340f95fc6aa3ee6c9de23ce9224ca3f159bcd +size 6601068 diff --git a/llvm14.changes b/llvm14.changes index 7e4e60a..4370af0 100644 --- a/llvm14.changes +++ b/llvm14.changes @@ -1,3 +1,24 @@ +------------------------------------------------------------------- +Sat May 28 12:42:06 UTC 2022 - Aaron Puchert + +- Update to version 14.0.4. + * This release contains bug-fixes for the LLVM 14.0.0 release. + This release is API and ABI compatible with 14.0.0. +- Don't use gold for linking anymore: on s390x we use ld.bfd with + LLVMgold.so, on ppc64 we disable ThinLTO for now. +- Using ld.bfd on s390x exposed an issue with the existing + llvm_build_tablegen_component_as_shared_library.patch: linking + llvm-tblgen with libLLVM.so means we also have to link libraries + used for that (like LLVMTableGenGlobalISel) with libLLVM.so. +- Rewrite summary and description for llvm-gold to point out that + it can also be used with ld.bfd, recommend with binutils. +- Prefer RPM macros over shell scripting, so that we can better + inspect the build script with substitutions in place. +- More memory for stage 1 build jobs due to recent OOMs. +- Add %_libclang_sonum RPM macro to llvm-devel, since that might + now diverge from %_llvm_sonum. +- Rebase llvm-do-not-install-static-libraries.patch. + ------------------------------------------------------------------- Sat Apr 30 12:32:33 UTC 2022 - Aaron Puchert diff --git a/llvm14.spec b/llvm14.spec index 9bcef9c..60a6261 100644 --- a/llvm14.spec +++ b/llvm14.spec @@ -16,14 +16,14 @@ # -%define _relver 14.0.3 +%define _relver 14.0.4 %define _version %_relver%{?_rc:rc%_rc} %define _tagver %_relver%{?_rc:-rc%_rc} %define _minor 14.0 %define _sonum 14 %define _itsme14 1 # Integer version used by update-alternatives -%define _uaver 1403 +%define _uaver 1404 %define _soclang 13 %define _socxx 1 @@ -39,11 +39,10 @@ %bcond_with openmp %endif -# We use gold where we want to use ThinLTO, but where lld isn't supported (well). -%ifarch ppc64 s390x -%bcond_without gold +%ifarch s390x +%bcond_with use_lld %else -%bcond_with gold +%bcond_without use_lld %endif %ifarch x86_64 @@ -55,7 +54,7 @@ %endif # Disabled on ARM because it's awfully slow and often times out. (boo#1178070) -%ifarch %{ix86} ppc64 ppc64le s390x x86_64 +%ifarch %{ix86} ppc64le s390x x86_64 %bcond_without thin_lto %else %bcond_with thin_lto @@ -87,16 +86,14 @@ # Expands to -n if we're providing the distribution default for the given package. %define multisource() %{expand:%%{?_itsme%{expand:%%{!?product_libs_llvm_ver_%{1}:%%{_plv}}%%{?product_libs_llvm_ver_%{1}}}:-n}} -# set_jobs type memory -# Set max__jobs so that every job of the given type has at least the -# given amount of memory. -%define set_jobs() \ - max_%{1}_jobs="%{?jobs:%{jobs}}" \ - if test -n "$max_%{1}_jobs" -a "$max_%{1}_jobs" -gt 1 ; then \ - max_jobs="$(($avail_mem / %2))" \ - test "$max_%{1}_jobs" -gt "$max_jobs" && max_%{1}_jobs="$max_jobs" && echo "Warning: Reducing number of %{1} jobs to $max_jobs because of memory limits" \ - test "$max_%{1}_jobs" -le 0 && max_%{1}_jobs=1 && echo "Warning: Not %{1}ing in parallel at all because of memory limits" \ - fi +%global avail_mem %(awk '/MemAvailable/ { print $2 }' /proc/meminfo) +%global _max_jobs %{?jobs}%{?!jobs:%getncpus} +%define _min() %[%1 <= %2 ? %1 : %2] +%define _clamp() %{_min %[%1 >= %2 ? %1 : %2] %3} + +# Return a number of jobs so that every job has at least the given amount of +# memory, if possible. +%define num_jobs() %{_clamp %[%{avail_mem} / %1] 1 %{_max_jobs}} %define _dwz_low_mem_die_limit 40000000 %define _dwz_max_die_limit 200000000 @@ -169,9 +166,6 @@ Requires(post): update-alternatives Requires(postun):update-alternatives # llvm does not work on s390 ExcludeArch: s390 -%if %{with gold} -BuildRequires: binutils-gold -%endif %if %{with ffi} BuildRequires: pkgconfig(libffi) %endif @@ -365,14 +359,18 @@ Group: System/Libraries This package contains the link-time optimizer for LLVM. %package gold -Summary: Gold linker plugin for LLVM +Summary: LLVM LTO plugin for ld.bfd and ld.gold Group: Development/Tools/Building Conflicts: llvm-gold-provider < %{version} Provides: llvm-gold-provider = %{version} +Supplements: packageand(clang%{_sonum}:binutils) Supplements: packageand(clang%{_sonum}:binutils-gold) %description gold -This package contains the Gold linker plugin for LLVM. +This package contains a plugin for link-time optimization in binutils linkers. + +Despite the name, it can also be used with ld.bfd. It is required for using +Clang with -flto=full or -flto=thin when linking with one of those linkers. %package -n libomp%{_sonum}-devel Summary: MPI plugin for LLVM @@ -650,6 +648,8 @@ mv libcxxabi-%{_version}.src projects/libcxxabi %endif %build +%global sourcedir %{_builddir}/%{buildsubdir} + %define _lto_cflags %{nil} # Use optflags, but: @@ -657,17 +657,18 @@ mv libcxxabi-%{_version}.src projects/libcxxabi # hardening. The problem is in sanitizers from compiler-rt. # 2) Remove the -g. We don't want it in stage1 and it will be added by cmake in # the following stage. -flags=$(echo %{optflags} | sed 's/-D_FORTIFY_SOURCE=./-D_FORTIFY_SOURCE=0/;s/\B-g\b//g') +%global cleaned_flags %(echo %{optflags} | sed 's/-D_FORTIFY_SOURCE=./-D_FORTIFY_SOURCE=0/;s/\B-g\b//g') +%global flags %{cleaned_flags} %ifarch armv6hl -flags+=" -mfloat-abi=hard -mcpu=arm1176jzf-s -mfpu=vfpv2" +%global flags %{cleaned_flags} -mfloat-abi=hard -mcpu=arm1176jzf-s -mfpu=vfpv2 %endif %ifarch armv7hl -flags+=" -mfloat-abi=hard -march=armv7-a -mtune=cortex-a17 -mfpu=vfpv3-d16" +%global flags %{cleaned_flags} -mfloat-abi=hard -march=armv7-a -mtune=cortex-a17 -mfpu=vfpv3-d16 %endif -CFLAGS=$flags -CXXFLAGS=$flags +CFLAGS="%flags" +CXXFLAGS="%flags" # By default build everything TARGETS_TO_BUILD="all" @@ -693,25 +694,19 @@ TARGETS_TO_BUILD="host;BPF" EXPERIMENTAL_TARGETS_TO_BUILD= %endif -mem_per_compile_job=1000000 +%define mem_per_compile_job 1200000 %ifarch i586 ppc armv6hl armv7hl # 32-bit arches need less memory than 64-bit arches. -mem_per_compile_job=600000 +%define mem_per_compile_job 600000 %endif -mem_per_link_job=3000000 +%define mem_per_link_job 3000000 %ifarch riscv64 # Give RISCV link jobs more memory. -mem_per_link_job=4000000 +%define mem_per_link_job 4000000 %endif -echo "Available memory:" -cat /proc/meminfo -echo "System limits:" -ulimit -a -avail_mem=$(awk '/MemAvailable/ { print $2 }' /proc/meminfo) -%set_jobs link $mem_per_link_job -%set_jobs compile $mem_per_compile_job +%{echo:Available memory: %avail_mem} %define __builder ninja %define __builddir stage1 @@ -722,8 +717,8 @@ avail_mem=$(awk '/MemAvailable/ { print $2 }' /proc/meminfo) -DLLVM_HOST_TRIPLE=%{host_triple} \ -DLLVM_BUILD_LLVM_DYLIB:BOOL=OFF \ -DLLVM_LINK_LLVM_DYLIB:BOOL=OFF \ - -DLLVM_PARALLEL_COMPILE_JOBS="$max_compile_jobs" \ - -DLLVM_PARALLEL_LINK_JOBS="$max_link_jobs" \ + -DLLVM_PARALLEL_COMPILE_JOBS=%{num_jobs %mem_per_compile_job} \ + -DLLVM_PARALLEL_LINK_JOBS=%{num_jobs %mem_per_link_job} \ -DENABLE_LINKER_BUILD_ID=ON \ -DLLVM_BINUTILS_INCDIR=%{_includedir} \ -DLLVM_BUILD_TOOLS:BOOL=OFF \ @@ -744,10 +739,10 @@ avail_mem=$(awk '/MemAvailable/ { print $2 }' /proc/meminfo) ninja -v %{?_smp_mflags} clang llvm-tblgen clang-tblgen \ %if %{with thin_lto} llvm-ar llvm-ranlib \ -%if %{with gold} - LLVMgold -%else +%if %{with use_lld} lld +%else + LLVMgold %endif %endif @@ -760,72 +755,51 @@ find ./stage1 \( -name '*.o' -or -name '*.a' \) -delete # 3) Remove -fstack-clash-protection on architectures where it isn't supported. # Using it just prints a warning, but that warning prevents the configuration # step, which uses -Werror, from recognizing the availability of other flags. -if ! ${PWD}/stage1/bin/clang -c -xc -Werror -fstack-clash-protection -o /dev/null /dev/null; +if ! ./stage1/bin/clang -c -xc -Werror -fstack-clash-protection -o /dev/null /dev/null; then - flags=$(echo $flags | sed 's/-fstack-clash-protection//'); + flags=$(echo %flags | sed 's/-fstack-clash-protection//'); fi CFLAGS=$flags CXXFLAGS=$flags # Clang uses a bit less memory. -mem_per_compile_job=700000 +%define mem_per_compile_job 700000 %ifarch i586 ppc armv6hl armv7hl # 32-bit arches need less memory than 64-bit arches. -mem_per_compile_job=500000 -%endif - -%set_jobs compile $mem_per_compile_job -%if %{with thin_lto} -# A single ThinLTO job is fully parallel already. -max_link_jobs=1 +%define mem_per_compile_job 500000 %endif %define __builddir build %define build_ldflags -Wl,--build-id=sha1 -export PATH=${PWD}/stage1/bin:$PATH -export CC=${PWD}/stage1/bin/clang -export CXX=${PWD}/stage1/bin/clang++ -%if %{with thin_lto} -export LLVM_AR=${PWD}/stage1/bin/llvm-ar -export LLVM_RANLIB=${PWD}/stage1/bin/llvm-ranlib -export LLD=${PWD}/stage1/bin/ld.lld -%endif -export LLVM_TABLEGEN=${PWD}/stage1/bin/llvm-tblgen -export CLANG_TABLEGEN=${PWD}/stage1/bin/clang-tblgen -# Build is using absolute paths assuming the monorepo layout, so we need this. -export CLANG_TOOLS_EXTRA_DIR=${PWD}/tools/clang/tools/extra # The build occasionally uses tools linking against previously built # libraries (mostly libLLVM.so), but we don't want to set RUNPATHs. -export LD_LIBRARY_PATH=${PWD}/build/%{_lib} +export LD_LIBRARY_PATH=%{sourcedir}/build/%{_lib} %cmake \ + -DCMAKE_C_COMPILER="%{sourcedir}/stage1/bin/clang" \ + -DCMAKE_CXX_COMPILER="%{sourcedir}/stage1/bin/clang++" \ -DBUILD_SHARED_LIBS:BOOL=OFF \ -DLLVM_HOST_TRIPLE=%{host_triple} \ -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \ -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ -DCLANG_LINK_CLANG_DYLIB:BOOL=ON \ - -DLLVM_PARALLEL_COMPILE_JOBS="$max_compile_jobs" \ - -DLLVM_PARALLEL_LINK_JOBS="$max_link_jobs" \ + -DLLVM_PARALLEL_COMPILE_JOBS=%{num_jobs %mem_per_compile_job} \ + -DLLVM_PARALLEL_LINK_JOBS=%{?with_thin_lto:1}%{!?with_thin_lto:%{num_jobs %mem_per_link_job}} \ %if %{with thin_lto} -DLLVM_ENABLE_LTO=Thin \ - -DCMAKE_AR="${LLVM_AR}" \ - -DCMAKE_RANLIB="${LLVM_RANLIB}" \ -%if %{with gold} - -DCMAKE_LINKER=%{_bindir}/ld.gold \ - -DLLVM_USE_LINKER=gold \ -%else - -DCMAKE_LINKER=${LLD} \ - -DLLVM_USE_LINKER=${LLD} \ + -DCMAKE_AR="%{sourcedir}/stage1/bin/llvm-ar" \ + -DCMAKE_RANLIB="%{sourcedir}/stage1/bin/llvm-ranlib" \ +%if %{with use_lld} + -DCMAKE_LINKER="%{sourcedir}/stage1/bin/ld.lld" \ + -DLLVM_USE_LINKER="%{sourcedir}/stage1/bin/ld.lld" \ %endif -%else - -DCMAKE_LINKER=%{_bindir}/ld \ %endif %ifarch %arm ppc s390 %{ix86} -DCMAKE_C_FLAGS_RELWITHDEBINFO="-g1" \ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-g1" \ %endif -DENABLE_LINKER_BUILD_ID=ON \ - -DLLVM_TABLEGEN="${LLVM_TABLEGEN}" \ - -DCLANG_TABLEGEN="${CLANG_TABLEGEN}" \ + -DLLVM_TABLEGEN="%{sourcedir}/stage1/bin/llvm-tblgen" \ + -DCLANG_TABLEGEN="%{sourcedir}/stage1/bin/clang-tblgen" \ -DLLVM_ENABLE_RTTI:BOOL=ON \ -DLLVM_ENABLE_ASSERTIONS=OFF \ -DLLVM_ENABLE_PIC=ON \ @@ -879,7 +853,7 @@ cd .. %install # Installation seems to build some files not contained in "all". -export LD_LIBRARY_PATH=${PWD}/build/%{_lib} +export LD_LIBRARY_PATH=%{sourcedir}/build/%{_lib} %cmake_install # Install FileCheck needed for testing Rust boo#1192629 @@ -1103,6 +1077,7 @@ cat > %{buildroot}%{_rpmconfigdir}/macros.d/macros.llvm <