From 8960de2413dbac1d1bdd6963698bfaa7b71a0eea67c9d736343c7b6086045b7a Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Sat, 14 Jan 2023 14:15:05 +0000 Subject: [PATCH 1/5] - Update to version 15.0.7. * This release contains bug-fixes for the LLVM 15.0.0 release. This release is API and ABI compatible with 15.0.0. - Rebase llvm-do-not-install-static-libraries.patch. - Build stage 2 with -fno-plt if we're using LTO: since building with -Wl,-z,now the PLT stubs are basically dead code, and eliminating the indirection should improve code locality and reduce BTB pressure for the quite frequent cross-DSO calls. With LTO we should not need linker relaxation. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm15?expand=0&rev=15 --- clang-15.0.6.src.tar.xz | 3 --- clang-15.0.7.src.tar.xz | 3 +++ clang-docs-15.0.6.src.tar.xz | 3 --- clang-docs-15.0.7.src.tar.xz | 3 +++ clang-tools-extra-15.0.6.src.tar.xz | 3 --- clang-tools-extra-15.0.7.src.tar.xz | 3 +++ cmake-15.0.6.src.tar.xz | 3 --- cmake-15.0.7.src.tar.xz | 3 +++ compiler-rt-15.0.6.src.tar.xz | 3 --- compiler-rt-15.0.7.src.tar.xz | 3 +++ libcxx-15.0.6.src.tar.xz | 3 --- libcxx-15.0.7.src.tar.xz | 3 +++ libcxxabi-15.0.6.src.tar.xz | 3 --- libcxxabi-15.0.7.src.tar.xz | 3 +++ lld-15.0.6.src.tar.xz | 3 --- lld-15.0.7.src.tar.xz | 3 +++ lldb-15.0.6.src.tar.xz | 3 --- lldb-15.0.7.src.tar.xz | 3 +++ llvm-15.0.6.src.tar.xz | 3 --- llvm-15.0.7.src.tar.xz | 3 +++ llvm-do-not-install-static-libraries.patch | 24 +++++++++++----------- llvm-docs-15.0.6.src.tar.xz | 3 --- llvm-docs-15.0.7.src.tar.xz | 3 +++ llvm15.changes | 13 ++++++++++++ llvm15.spec | 15 +++++++++++--- openmp-15.0.6.src.tar.xz | 3 --- openmp-15.0.7.src.tar.xz | 3 +++ polly-15.0.6.src.tar.xz | 3 --- polly-15.0.7.src.tar.xz | 3 +++ 29 files changed, 76 insertions(+), 54 deletions(-) delete mode 100644 clang-15.0.6.src.tar.xz create mode 100644 clang-15.0.7.src.tar.xz delete mode 100644 clang-docs-15.0.6.src.tar.xz create mode 100644 clang-docs-15.0.7.src.tar.xz delete mode 100644 clang-tools-extra-15.0.6.src.tar.xz create mode 100644 clang-tools-extra-15.0.7.src.tar.xz delete mode 100644 cmake-15.0.6.src.tar.xz create mode 100644 cmake-15.0.7.src.tar.xz delete mode 100644 compiler-rt-15.0.6.src.tar.xz create mode 100644 compiler-rt-15.0.7.src.tar.xz delete mode 100644 libcxx-15.0.6.src.tar.xz create mode 100644 libcxx-15.0.7.src.tar.xz delete mode 100644 libcxxabi-15.0.6.src.tar.xz create mode 100644 libcxxabi-15.0.7.src.tar.xz delete mode 100644 lld-15.0.6.src.tar.xz create mode 100644 lld-15.0.7.src.tar.xz delete mode 100644 lldb-15.0.6.src.tar.xz create mode 100644 lldb-15.0.7.src.tar.xz delete mode 100644 llvm-15.0.6.src.tar.xz create mode 100644 llvm-15.0.7.src.tar.xz delete mode 100644 llvm-docs-15.0.6.src.tar.xz create mode 100644 llvm-docs-15.0.7.src.tar.xz delete mode 100644 openmp-15.0.6.src.tar.xz create mode 100644 openmp-15.0.7.src.tar.xz delete mode 100644 polly-15.0.6.src.tar.xz create mode 100644 polly-15.0.7.src.tar.xz diff --git a/clang-15.0.6.src.tar.xz b/clang-15.0.6.src.tar.xz deleted file mode 100644 index 544118b..0000000 --- a/clang-15.0.6.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:10119ae195f1b4f979fe42e67b781e175b0c0d4e982fd6a2f44c4aa7fc925233 -size 18838320 diff --git a/clang-15.0.7.src.tar.xz b/clang-15.0.7.src.tar.xz new file mode 100644 index 0000000..ffbd699 --- /dev/null +++ b/clang-15.0.7.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6b673ef15377fb46062d164e8ddc4d05c348ff8968f015f7f4af03f51000067 +size 18540648 diff --git a/clang-docs-15.0.6.src.tar.xz b/clang-docs-15.0.6.src.tar.xz deleted file mode 100644 index fee79b4..0000000 --- a/clang-docs-15.0.6.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:066a5a80a12de5b65ac1be649da5fd6e0de1501e63b72731a903e78ed7edf75f -size 1540960 diff --git a/clang-docs-15.0.7.src.tar.xz b/clang-docs-15.0.7.src.tar.xz new file mode 100644 index 0000000..d262801 --- /dev/null +++ b/clang-docs-15.0.7.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c654a42885113db4cd7de9a0bd44e379f95d48cbd17cec7885ceaea3f0375a8e +size 1541164 diff --git a/clang-tools-extra-15.0.6.src.tar.xz b/clang-tools-extra-15.0.6.src.tar.xz deleted file mode 100644 index befc20c..0000000 --- a/clang-tools-extra-15.0.6.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:92b1714294efe13906d3b3f87d3273ea9eb38cb7f3b78631820086f0b0173b25 -size 3080252 diff --git a/clang-tools-extra-15.0.7.src.tar.xz b/clang-tools-extra-15.0.7.src.tar.xz new file mode 100644 index 0000000..752b85a --- /dev/null +++ b/clang-tools-extra-15.0.7.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:809a2ef46d46be3b83ca389356404ac041fa6d8f5496cb02ec35d252afb64fd1 +size 3075708 diff --git a/cmake-15.0.6.src.tar.xz b/cmake-15.0.6.src.tar.xz deleted file mode 100644 index b1996e7..0000000 --- a/cmake-15.0.6.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7613aeeaba9b8b12b35224044bc349b5fa45525919625057fa54dc882dcb4c86 -size 6972 diff --git a/cmake-15.0.7.src.tar.xz b/cmake-15.0.7.src.tar.xz new file mode 100644 index 0000000..5774201 --- /dev/null +++ b/cmake-15.0.7.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8986f29b634fdaa9862eedda78513969fe9788301c9f2d938f4c10a3e7a3e7ea +size 6972 diff --git a/compiler-rt-15.0.6.src.tar.xz b/compiler-rt-15.0.6.src.tar.xz deleted file mode 100644 index a9f4ccb..0000000 --- a/compiler-rt-15.0.6.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b46f5b5b02402ef3acd92e7adf2d551e0b2a8ed19fce66800472dc0ad2a81fbc -size 2351240 diff --git a/compiler-rt-15.0.7.src.tar.xz b/compiler-rt-15.0.7.src.tar.xz new file mode 100644 index 0000000..2f2544e --- /dev/null +++ b/compiler-rt-15.0.7.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:353832c66cce60931ea0413b3c071faad59eefa70d02c97daa8978b15e4b25b7 +size 2350132 diff --git a/libcxx-15.0.6.src.tar.xz b/libcxx-15.0.6.src.tar.xz deleted file mode 100644 index 1d3f76e..0000000 --- a/libcxx-15.0.6.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4a31567ec0176a3b5615e0fe9f1b16c123c2fb26b3c884c8e453fb126a5390a8 -size 3343472 diff --git a/libcxx-15.0.7.src.tar.xz b/libcxx-15.0.7.src.tar.xz new file mode 100644 index 0000000..9def697 --- /dev/null +++ b/libcxx-15.0.7.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d4eaff1cb6e41439fbf3ededb46998a0a3564d66dd289f661bdd459c9277c11 +size 3337404 diff --git a/libcxxabi-15.0.6.src.tar.xz b/libcxxabi-15.0.6.src.tar.xz deleted file mode 100644 index 1282a87..0000000 --- a/libcxxabi-15.0.6.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:567a5816a57793246023da3546192bda4cc1da27f94837187cdb9681187f1042 -size 568780 diff --git a/libcxxabi-15.0.7.src.tar.xz b/libcxxabi-15.0.7.src.tar.xz new file mode 100644 index 0000000..6aa6764 --- /dev/null +++ b/libcxxabi-15.0.7.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b42f3951d845232e4cd58a0a9841838292dac138af19d4f8d0c08bd41004f43 +size 568764 diff --git a/lld-15.0.6.src.tar.xz b/lld-15.0.6.src.tar.xz deleted file mode 100644 index 6502f67..0000000 --- a/lld-15.0.6.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:29fd83b61a1171c6bd51963ca54d0d7b577255e77fcd5ff03c0548fcc5b27b4f -size 1407396 diff --git a/lld-15.0.7.src.tar.xz b/lld-15.0.7.src.tar.xz new file mode 100644 index 0000000..3380f4c --- /dev/null +++ b/lld-15.0.7.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dba5c70c3fe88b3a38b9180df82fbc9d1dfd55d68f41fddd6a90f9e17f8e5df9 +size 1407476 diff --git a/lldb-15.0.6.src.tar.xz b/lldb-15.0.6.src.tar.xz deleted file mode 100644 index da82685..0000000 --- a/lldb-15.0.6.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7d5bd5b2d1ea90d0155f6f26762ab2047ab09a162cdb4e0e8648cc64cbb6f088 -size 10298404 diff --git a/lldb-15.0.7.src.tar.xz b/lldb-15.0.7.src.tar.xz new file mode 100644 index 0000000..9c295b9 --- /dev/null +++ b/lldb-15.0.7.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f64d5533661c766a2ff97062af5a0523b9e2cd56aa3d95d9624c418e120d1427 +size 10254276 diff --git a/llvm-15.0.6.src.tar.xz b/llvm-15.0.6.src.tar.xz deleted file mode 100644 index 70cf8c7..0000000 --- a/llvm-15.0.6.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0b32199401f27e2e0353846a8c5fbadd77beca2570654fb9ef7ac9b7f26967e3 -size 53525892 diff --git a/llvm-15.0.7.src.tar.xz b/llvm-15.0.7.src.tar.xz new file mode 100644 index 0000000..59d032e --- /dev/null +++ b/llvm-15.0.7.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ad8b2cc8003c86d0078d15d987d84e3a739f24aae9033865c027abae93ee7a4 +size 52935892 diff --git a/llvm-do-not-install-static-libraries.patch b/llvm-do-not-install-static-libraries.patch index e5c699f..6e58545 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-15.0.6.src/cmake/modules/AddClang.cmake +Index: clang-15.0.7.src/cmake/modules/AddClang.cmake =================================================================== ---- a/clang-15.0.6.src/cmake/modules/AddClang.cmake -+++ b/clang-15.0.6.src/cmake/modules/AddClang.cmake +--- a/clang-15.0.7.src/cmake/modules/AddClang.cmake ++++ b/clang-15.0.7.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-15.0.6.src/cmake/modules/AddLLD.cmake +Index: lld-15.0.7.src/cmake/modules/AddLLD.cmake =================================================================== ---- a/lld-15.0.6.src/cmake/modules/AddLLD.cmake -+++ b/lld-15.0.6.src/cmake/modules/AddLLD.cmake +--- a/lld-15.0.7.src/cmake/modules/AddLLD.cmake ++++ b/lld-15.0.7.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-15.0.6.src/cmake/modules/AddLLD.cmake if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) add_llvm_install_targets(install-${name} DEPENDS ${name} -Index: polly-15.0.6.src/cmake/polly_macros.cmake +Index: polly-15.0.7.src/cmake/polly_macros.cmake =================================================================== ---- a/polly-15.0.6.src/cmake/polly_macros.cmake -+++ b/polly-15.0.6.src/cmake/polly_macros.cmake +--- a/polly-15.0.7.src/cmake/polly_macros.cmake ++++ b/polly-15.0.7.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-15.0.6.src/cmake/polly_macros.cmake endmacro(add_polly_library) macro(add_polly_loadable_module name) -Index: polly-15.0.6.src/lib/CMakeLists.txt +Index: polly-15.0.7.src/lib/CMakeLists.txt =================================================================== ---- a/polly-15.0.6.src/lib/CMakeLists.txt -+++ b/polly-15.0.6.src/lib/CMakeLists.txt +--- a/polly-15.0.7.src/lib/CMakeLists.txt ++++ b/polly-15.0.7.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-15.0.6.src.tar.xz b/llvm-docs-15.0.6.src.tar.xz deleted file mode 100644 index 4790209..0000000 --- a/llvm-docs-15.0.6.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bf59f6f72ee1c8a2397b13523b6a8ed53c35262f7f99b05b7cb69b144e853a88 -size 6846028 diff --git a/llvm-docs-15.0.7.src.tar.xz b/llvm-docs-15.0.7.src.tar.xz new file mode 100644 index 0000000..f3d4c90 --- /dev/null +++ b/llvm-docs-15.0.7.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:329c2858718e329818bbb567113e3b238c872957842bb602627431735350e7fb +size 6846476 diff --git a/llvm15.changes b/llvm15.changes index 9787731..adf010c 100644 --- a/llvm15.changes +++ b/llvm15.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Sat Jan 14 14:06:38 UTC 2023 - Aaron Puchert + +- Update to version 15.0.7. + * This release contains bug-fixes for the LLVM 15.0.0 release. + This release is API and ABI compatible with 15.0.0. +- Rebase llvm-do-not-install-static-libraries.patch. +- Build stage 2 with -fno-plt if we're using LTO: since building + with -Wl,-z,now the PLT stubs are basically dead code, and + eliminating the indirection should improve code locality and + reduce BTB pressure for the quite frequent cross-DSO calls. + With LTO we should not need linker relaxation. + ------------------------------------------------------------------- Sun Dec 4 21:43:38 UTC 2022 - Aaron Puchert diff --git a/llvm15.spec b/llvm15.spec index 079dc52..1b9bc4b 100644 --- a/llvm15.spec +++ b/llvm15.spec @@ -1,7 +1,7 @@ # # spec file for package llvm15 # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,14 +16,14 @@ # -%define _relver 15.0.6 +%define _relver 15.0.7 %define _version %_relver%{?_rc:rc%_rc} %define _tagver %_relver%{?_rc:-rc%_rc} %define _minor 15.0 %define _sonum 15 %define _itsme15 1 # Integer version used by update-alternatives -%define _uaver 1506 +%define _uaver 1507 %define _soclang 13 %define _socxx 1 @@ -979,6 +979,15 @@ if ! ./stage1/bin/clang -c -xc -Werror -fstack-clash-protection -o /dev/null /de then flags=$(echo %flags | sed 's/-fstack-clash-protection//'); fi +# 4) Add -fno-plt: With -Wl,-z,now we don't need the PLT anymore, allowing us to +# reduce the number of branches for the quite frequent cross-DSO calls. This +# is good for code locality and reduces the pressure on the BTB. +# However, do this only when we're using LTO, since otherwise indirect +# branches have to be relaxed by the linker, which might cause regressions. +%if %{with thin_lto} +flags=$flags -fno-plt +%endif + CFLAGS=$flags CXXFLAGS=$flags diff --git a/openmp-15.0.6.src.tar.xz b/openmp-15.0.6.src.tar.xz deleted file mode 100644 index 058a1dd..0000000 --- a/openmp-15.0.6.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1ac6f159d81625d852a42676ff6d8820cb744c18d825a56d56a6d7aa389f5ac9 -size 1184608 diff --git a/openmp-15.0.7.src.tar.xz b/openmp-15.0.7.src.tar.xz new file mode 100644 index 0000000..6cea856 --- /dev/null +++ b/openmp-15.0.7.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f168d38e7a37b928dcb94b33ce947f75d81eef6fa6a4f9d16b6dc5511c07358 +size 1184544 diff --git a/polly-15.0.6.src.tar.xz b/polly-15.0.6.src.tar.xz deleted file mode 100644 index 9eedf42..0000000 --- a/polly-15.0.6.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:481e8ee1438917a337d58ff879b8e8a5e3c031e35fa93af6cfdc0b5857c28d92 -size 9363780 diff --git a/polly-15.0.7.src.tar.xz b/polly-15.0.7.src.tar.xz new file mode 100644 index 0000000..387d0bf --- /dev/null +++ b/polly-15.0.7.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1053610cace401c0b4e6d430d441277b0283dd4112581e2acc90e174d3192819 +size 9361200 From fd7506d9e161c301fd7b81280d0021b4a55bbda3ae1beef900592ff7766fbe96 Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Sat, 14 Jan 2023 15:26:22 +0000 Subject: [PATCH 2/5] - Drop line breaks from flags. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm15?expand=0&rev=16 --- llvm15.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm15.spec b/llvm15.spec index 1b9bc4b..90f2bd0 100644 --- a/llvm15.spec +++ b/llvm15.spec @@ -900,7 +900,7 @@ 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. -%global cleaned_flags %(echo %{optflags} | sed 's/-D_FORTIFY_SOURCE=./-D_FORTIFY_SOURCE=0/;s/\\B-g\\b//g') +%global cleaned_flags %(echo -n %{optflags} | sed 's/-D_FORTIFY_SOURCE=./-D_FORTIFY_SOURCE=0/;s/\\B-g\\b//g') %global flags %{cleaned_flags} %ifarch armv6hl @@ -977,7 +977,7 @@ find ./stage1 \( -name '*.o' -or -name '*.a' \) -delete # step, which uses -Werror, from recognizing the availability of other flags. 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 -n %flags | sed 's/-fstack-clash-protection//'); fi # 4) Add -fno-plt: With -Wl,-z,now we don't need the PLT anymore, allowing us to # reduce the number of branches for the quite frequent cross-DSO calls. This From 04d8fe57b7e4205f787170bf4c8795c27ee7fca519de072779580ec2e895f0ea Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Sat, 14 Jan 2023 17:06:31 +0000 Subject: [PATCH 3/5] - Use quotes to prevent a line break. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm15?expand=0&rev=17 --- llvm15.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm15.spec b/llvm15.spec index 90f2bd0..5c20842 100644 --- a/llvm15.spec +++ b/llvm15.spec @@ -985,7 +985,7 @@ fi # However, do this only when we're using LTO, since otherwise indirect # branches have to be relaxed by the linker, which might cause regressions. %if %{with thin_lto} -flags=$flags -fno-plt +flags="$flags -fno-plt" %endif CFLAGS=$flags From cdc7a4110282d30caa25666855928848fc87031cb137e454b3605ec8890bb384 Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Thu, 19 Jan 2023 20:24:57 +0000 Subject: [PATCH 4/5] - Add llvm-workaround-superfluous-branches.patch: hints LLVM to eliminate branches until gh#llvm/llvm-project#28804 is solved. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm15?expand=0&rev=18 --- llvm-workaround-superfluous-branches.patch | 14 ++++++++++++++ llvm15.changes | 11 ++++++----- llvm15.spec | 15 +++++++++------ 3 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 llvm-workaround-superfluous-branches.patch diff --git a/llvm-workaround-superfluous-branches.patch b/llvm-workaround-superfluous-branches.patch new file mode 100644 index 0000000..8f0c9dc --- /dev/null +++ b/llvm-workaround-superfluous-branches.patch @@ -0,0 +1,14 @@ +diff --git a/llvm/include/llvm/Support/Casting.h b/llvm/include/llvm/Support/Casting.h +index b6bbff8..1b68640 100644 +--- a/llvm/include/llvm/Support/Casting.h ++++ b/llvm/include/llvm/Support/Casting.h +@@ -605,6 +605,9 @@ LLVM_NODISCARD inline decltype(auto) dyn_cast(From &Val) { + + template + LLVM_NODISCARD inline decltype(auto) dyn_cast(From *Val) { ++#if defined(__clang__) && defined(NDEBUG) ++ __builtin_assume(Val); ++#endif + return CastInfo::doCastIfPossible(Val); + } + diff --git a/llvm15.changes b/llvm15.changes index adf010c..a152056 100644 --- a/llvm15.changes +++ b/llvm15.changes @@ -5,11 +5,12 @@ Sat Jan 14 14:06:38 UTC 2023 - Aaron Puchert * This release contains bug-fixes for the LLVM 15.0.0 release. This release is API and ABI compatible with 15.0.0. - Rebase llvm-do-not-install-static-libraries.patch. -- Build stage 2 with -fno-plt if we're using LTO: since building - with -Wl,-z,now the PLT stubs are basically dead code, and - eliminating the indirection should improve code locality and - reduce BTB pressure for the quite frequent cross-DSO calls. - With LTO we should not need linker relaxation. +- Build stage 2 with -fno-plt on x86_64: since building with + -Wl,-z,now the PLT stubs are basically dead code, so eliminating + the indirection reduces the number of branches and improves code + locality for the quite frequent cross-DSO calls. +- Add llvm-workaround-superfluous-branches.patch: hints LLVM to + eliminate branches until gh#llvm/llvm-project#28804 is solved. ------------------------------------------------------------------- Sun Dec 4 21:43:38 UTC 2022 - Aaron Puchert diff --git a/llvm15.spec b/llvm15.spec index 5c20842..262346a 100644 --- a/llvm15.spec +++ b/llvm15.spec @@ -367,6 +367,8 @@ Patch13: llvm-normally-versioned-libllvm.patch Patch14: llvm-do-not-install-static-libraries.patch # PATCH-FIX-OPENSUSE (or -UPSTREAM?): we disable RPATHs, but the test driver drops LD_LIBRARY_PATH. Patch15: libcxx-test-library-path.patch +# PATCH-FIX-UPSTREAM (?): Work around gh#llvm/llvm-project#28804 by hinting with __builtin_assume. +Patch16: llvm-workaround-superfluous-branches.patch Patch20: llvm_build_tablegen_component_as_shared_library.patch Patch21: tests-use-python3.patch Patch22: llvm-better-detect-64bit-atomics-support.patch @@ -807,6 +809,7 @@ This package contains the development files for Polly. %patch5 -p1 %patch13 -p1 %patch14 -p1 +%patch16 -p2 %patch20 -p1 %patch21 -p1 %patch22 -p1 @@ -979,12 +982,12 @@ if ! ./stage1/bin/clang -c -xc -Werror -fstack-clash-protection -o /dev/null /de then flags=$(echo -n %flags | sed 's/-fstack-clash-protection//'); fi -# 4) Add -fno-plt: With -Wl,-z,now we don't need the PLT anymore, allowing us to -# reduce the number of branches for the quite frequent cross-DSO calls. This -# is good for code locality and reduces the pressure on the BTB. -# However, do this only when we're using LTO, since otherwise indirect -# branches have to be relaxed by the linker, which might cause regressions. -%if %{with thin_lto} +# 4) Add -fno-plt: With -Wl,-z,now the PLT is basically dead code, so we can +# now go the direct route for quite frequent cross-DSO calls. This reduces +# branches in a typical execution by ~5 percent, instructions/cycles +# by ~4 percent, and reduces pressure on the instruction cache. We do this +# only on x86_64 where it doesn't increase the code size significantly. +%ifarch x86_64 flags="$flags -fno-plt" %endif From d0057caff289dbb27c0003e551b019a8abccc12ce6fc3d8c954ff4aa7f5fa3af Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Thu, 19 Jan 2023 22:47:39 +0000 Subject: [PATCH 5/5] - Undo unnecessary changes. OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm15?expand=0&rev=19 --- llvm15.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm15.spec b/llvm15.spec index 262346a..bc219da 100644 --- a/llvm15.spec +++ b/llvm15.spec @@ -903,7 +903,7 @@ 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. -%global cleaned_flags %(echo -n %{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 @@ -980,7 +980,7 @@ find ./stage1 \( -name '*.o' -or -name '*.a' \) -delete # step, which uses -Werror, from recognizing the availability of other flags. if ! ./stage1/bin/clang -c -xc -Werror -fstack-clash-protection -o /dev/null /dev/null; then - flags=$(echo -n %flags | sed 's/-fstack-clash-protection//'); + flags=$(echo %flags | sed 's/-fstack-clash-protection//'); fi # 4) Add -fno-plt: With -Wl,-z,now the PLT is basically dead code, so we can # now go the direct route for quite frequent cross-DSO calls. This reduces