diff --git a/.gitignore b/.gitignore index a52f899..94e50e8 100644 --- a/.gitignore +++ b/.gitignore @@ -186,3 +186,7 @@ /clang-tools-extra-14.0.0.src.tar.xz.sig /clang-14.0.0.src.tar.xz.sig /llvm-13.0.1.src.tar.xz +/clang-14.0.5.src.tar.xz +/clang-14.0.5.src.tar.xz.sig +/clang-tools-extra-14.0.5.src.tar.xz +/clang-tools-extra-14.0.5.src.tar.xz.sig diff --git a/clang.spec b/clang.spec index 2b6a144..9ea33ec 100644 --- a/clang.spec +++ b/clang.spec @@ -1,10 +1,10 @@ %bcond_with compat_build -%bcond_without bundle_compat_lib +%bcond_with bundle_compat_lib %bcond_without check %global maj_ver 14 %global min_ver 0 -%global patch_ver 0 +%global patch_ver 5 %global clang_version %{maj_ver}.%{min_ver}.%{patch_ver} %if %{with compat_build} @@ -73,8 +73,6 @@ Patch3: 0001-Driver-Add-a-gcc-equivalent-triple-to-the-list-of-tr.patch Patch4: 0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch # This patch can be dropped once gcc-12.0.1-0.5.fc36 is in the repo. Patch5: 0001-Work-around-gcc-miscompile.patch -# https://github.com/llvm/llvm-project/commit/fed96f31bb5b68f77dd617ee8e698dd8171ee71b -Patch6: m-branch-protection.patch Patch7: 0010-PATCH-clang-Produce-DWARF4-by-default.patch Patch8: disable-recommonmark.patch @@ -644,6 +642,9 @@ false %endif %changelog +* Mon Jun 20 2022 Timm Bäder - 14.0.5-1 +- Update to 14.0.5 + * Fri Apr 22 2022 Timm Bäder - 14.0.0-1 - 14.0.0 Release diff --git a/m-branch-protection.patch b/m-branch-protection.patch deleted file mode 100644 index 7586c7d..0000000 --- a/m-branch-protection.patch +++ /dev/null @@ -1,44 +0,0 @@ -commit fed96f31bb5b68f77dd617ee8e698dd8171ee71b -Author: Tom Stellard -Date: Tue Mar 22 23:17:39 2022 -0700 - - Re-commit: Driver: Don't warn on -mbranch-protection when linking - - This is a re-commit of 98fd3b359866f474ab1c097c22fb5c3be356b996. The - newly added test was failing on the bots, and I've fixed the test now so - that it doesn't actually invoke the linker. - -diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td -index d37d3a31fe07..6ed87f9a464d 100644 ---- a/clang/include/clang/Driver/Options.td -+++ b/clang/include/clang/Driver/Options.td -@@ -3444,6 +3444,7 @@ def msign_return_address_EQ : Joined<["-"], "msign-return-address=">, - Flags<[CC1Option]>, Group, Values<"none,all,non-leaf">, - HelpText<"Select return address signing scope">; - def mbranch_protection_EQ : Joined<["-"], "mbranch-protection=">, -+ Group, - HelpText<"Enforce targets of indirect branches and function returns">; - - def mharden_sls_EQ : Joined<["-"], "mharden-sls=">, -diff --git a/clang/test/Driver/aarch64-security-options.c b/clang/test/Driver/aarch64-security-options.c -index 6ea4b8ae5838..4bd73e06d255 100644 ---- a/clang/test/Driver/aarch64-security-options.c -+++ b/clang/test/Driver/aarch64-security-options.c -@@ -27,6 +27,9 @@ - // RUN: %clang -target aarch64--none-eabi -c %s -### -mbranch-protection=bar 2>&1 | \ - // RUN: FileCheck %s --check-prefix=BAD-BP-PROTECTION --check-prefix=WARN - -+// RUN: %clang -target aarch64--none-eabi -### -o /dev/null -mbranch-protection=standard /dev/null 2>&1 | \ -+// RUN: FileCheck --allow-empty %s --check-prefix=LINKER-DRIVER -+ - // WARN-NOT: warning: ignoring '-mbranch-protection=' option because the 'aarch64' architecture does not support it [-Wbranch-protection] - - // RA-OFF: "-msign-return-address=none" -@@ -46,3 +49,7 @@ - - // BAD-B-KEY-COMBINATION: invalid branch protection option 'b-key' in '-mbranch-protection={{.*}}' - // BAD-LEAF-COMBINATION: invalid branch protection option 'leaf' in '-mbranch-protection={{.*}}' -+ -+// Check that the linker driver doesn't warn about -mbranch-protection=standard -+// as an unused option. -+// LINKER-DRIVER-NOT: warning: diff --git a/sources b/sources index 0f88c1f..7549359 100644 --- a/sources +++ b/sources @@ -1,6 +1,4 @@ -SHA512 (clang-14.0.0.src.tar.xz) = 26e701c0c24eefee1f0c1651cba7d16dca9a463e4d41c8bbc33d7b93a68c3dac0aeef6846d836eddc07afafa8116b81c95737223296f336897f2b75e1b3895f1 -SHA512 (clang-tools-extra-14.0.0.src.tar.xz) = fdf06a46a4c3d689076b41fcc0c42eedbe95924b1611a8f8fe693e4ac1013274cdea97482b48659172f133ed51607a9e979d9d717df4082b50b0c176be2515e5 -SHA512 (clang-tools-extra-14.0.0.src.tar.xz.sig) = 7a6fe5037d462eab4966946dc6ae4d5c53751da3f3a0ea3396a10add2b0e41d4cd26752c9dc82c6f69cefdcab63818e4e1f87ff601ef8c5bdacb81489a30b787 -SHA512 (clang-14.0.0.src.tar.xz.sig) = 579f20b2a7ffee8fa077002272d7029c9f82e9904b52a720c46ac882679b08f6b68f92918593abce916fd4d55aceb1aa4fe26142b7f742e286d0aaa0b2809efd -SHA512 (llvm-13.0.1.src.tar.xz) = 05fbe8708ac3d0dfef3a9135ee88185a95ed492095429a97d33b8aadb0187e59ad42d1a7184f02b5c84fdd31f3d7227c65bd292ed0aa039b29522e59cf90a965 -SHA512 (clang-13.0.1.src.tar.xz) = 10abb601ce33ec0ec1e966221d958dd6206cfd5b178f8af0850408ed6adf2a9e193afb87a6449d65bb636e70a4debc3818035ab7bfcddf35a54a603851779d57 +SHA512 (clang-14.0.5.src.tar.xz) = e69faea16e06c8eb4c7cf9969573a5af7dfad9c280d1858dc9655007129e83744dbca3bf928a040e9b66fc84738f76eccd8ae5bc61cf11be7e62d79dafabb5a2 +SHA512 (clang-14.0.5.src.tar.xz.sig) = f727ddf5c4995645c6782c396a7e83d62c62c0a16afd9320ab5205ef497886ccb9ab3de24879cdab4e4a4edd4f281b371e26686d0ab721a5edec7781929ce40f +SHA512 (clang-tools-extra-14.0.5.src.tar.xz) = 9b729f04f769f8209a7bcca909d8a98b76d4789ab32707d5a55f7588a653c3b08a39c2f1bc61325a807315580069aa2dcb5c9fe1e5b1853a58fc548593154490 +SHA512 (clang-tools-extra-14.0.5.src.tar.xz.sig) = 5146c238eba412afeb6839352f5974247470d92efcb5a30c876c76a112554d029d7d9e9bc3e748fc2e44db15857ddf81f226548372ca7f1f04bf7359b338570a diff --git a/tests/build-gating-libomp.fmf b/tests/build-gating-libomp.fmf index f33a598..1ddd29e 100644 --- a/tests/build-gating-libomp.fmf +++ b/tests/build-gating-libomp.fmf @@ -11,6 +11,10 @@ adjust: environment+: WITH_SCL: "scl enable llvm-toolset-13.0" when: "collection == llvm-toolset-13.0" + - because: "When testing SCL-ized LLVM, the collection must be enabled first" + environment+: + WITH_SCL: "scl enable llvm-toolset-14.0" + when: "collection == llvm-toolset-14.0" - because: "libomp not supported in s390x" when: arch == s390x diff --git a/tests/build-gating.fmf b/tests/build-gating.fmf index d769b47..b0b49be 100644 --- a/tests/build-gating.fmf +++ b/tests/build-gating.fmf @@ -23,6 +23,10 @@ adjust: environment+: WITH_SCL: "scl enable llvm-toolset-13.0" when: "collection == llvm-toolset-13.0" + - because: "When testing SCL-ized LLVM, the collection must be enabled first" + environment+: + WITH_SCL: "scl enable llvm-toolset-14.0" + when: "collection == llvm-toolset-14.0" # Unfortunately, TMT does not support more declarative approach, we need to run commands on our own. - because: "On RHEL, CRB must be enabled to provide rarer packages" @@ -31,19 +35,17 @@ adjust: how: shell script: dnf config-manager --set-enabled rhel-CRB when: >- - distro == centos - or distro == rhel-9 + distro == rhel-9 or distro == rhel-8 - # Unfortunatelly, TMT does not support more declarative approach, we need to run commands on our own. - - because: "On RHEL-7, EPEL must be enabled to provided rarer packages" + # Unfortunately, TMT does not support more declarative approach, we need to run commands on our own. + - because: "On CentOS, CRB must be enabled to provide rarer packages" prepare+: - - name: Enable EPEL + - name: Enable CRB how: shell - script: | - rpm -q epel-release || yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - yum-config-manager --enable epel - when: distro == rhel-7 + script: dnf config-manager --set-enabled crb + when: >- + distro == centos discover: - name: clang-tests diff --git a/tests/clang-format-diff/main.fmf b/tests/clang-format-diff/main.fmf index 16bcfcc..06ed176 100644 --- a/tests/clang-format-diff/main.fmf +++ b/tests/clang-format-diff/main.fmf @@ -10,3 +10,6 @@ adjust: - require: - llvm-toolset-13.0-clang-tools-extra when: "collection == llvm-toolset-13.0" + - require: + - llvm-toolset-14.0-clang-tools-extra + when: "collection == llvm-toolset-14.0" diff --git a/tests/fedora-flags/main.fmf b/tests/fedora-flags/main.fmf index cc6405b..02f6ce5 100644 --- a/tests/fedora-flags/main.fmf +++ b/tests/fedora-flags/main.fmf @@ -2,6 +2,7 @@ summary: fedora-flags test: "$WITH_SCL ./test.sh" require: - annobin + - clang - redhat-rpm-config adjust: - because: s390x does not have epel repo which is required to provide rpm macros diff --git a/tests/libomp/main.fmf b/tests/libomp/main.fmf index 230c118..960bccb 100644 --- a/tests/libomp/main.fmf +++ b/tests/libomp/main.fmf @@ -28,3 +28,9 @@ adjust: - llvm-toolset-13.0-libomp - llvm-toolset-13.0-libomp-devel when: "collection == llvm-toolset-13.0" + - require: + - llvm-toolset-14.0-clang + - llvm-toolset-14.0-clang-libs + - llvm-toolset-14.0-libomp + - llvm-toolset-14.0-libomp-devel + when: "collection == llvm-toolset-14.0" \ No newline at end of file diff --git a/tests/llvm-test-suite/main.fmf b/tests/llvm-test-suite/main.fmf index 5587061..7d61dfb 100644 --- a/tests/llvm-test-suite/main.fmf +++ b/tests/llvm-test-suite/main.fmf @@ -13,5 +13,6 @@ test: "$WITH_SCL ./test.sh" require: - git - clang + - ninja-build - llvm-test-suite duration: 1h diff --git a/tests/openmp-rpm/main.fmf b/tests/openmp-rpm/main.fmf new file mode 100644 index 0000000..2344193 --- /dev/null +++ b/tests/openmp-rpm/main.fmf @@ -0,0 +1,30 @@ +summary: Test build a simple RPM package to ensure that -fopenmp works +test: "$WITH_SCL ./runtest.sh" +require: + - rpm-build +adjust: + - because: "libomp not supported in s390x" + when: arch == s390x + enabled: false + + - because: "Use yum in RHEL < 8" + require+: + - yum-utils + environment+: + BUILDDEP_CMD: "yum-builddep" + when: distro < rhel-8 + + - because: "Use dnf in RHEL >= 8, Fedora and CentOS" + require+: + - dnf-plugins-core + environment+: + BUILDDEP_CMD: "dnf builddep" + when: distro >= rhel-8 or distro != rhel + + # Requirements for SCL-ized LLVM + - require+: + - llvm-toolset-13.0-build + when: "collection == llvm-toolset-13.0" + - require+: + - llvm-toolset-14.0-build + when: "collection == llvm-toolset-14.0" \ No newline at end of file diff --git a/tests/openmp-rpm/runtest.sh b/tests/openmp-rpm/runtest.sh new file mode 100755 index 0000000..37647fe --- /dev/null +++ b/tests/openmp-rpm/runtest.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -ex + +${BUILDDEP_CMD} -y test.spec +rpmbuild --define '_sourcedir .' --define '_builddir .' -bb test.spec diff --git a/tests/openmp-rpm/test.c b/tests/openmp-rpm/test.c new file mode 100644 index 0000000..b20d164 --- /dev/null +++ b/tests/openmp-rpm/test.c @@ -0,0 +1,7 @@ +int main(int argc, char **argv) { + int res = 1; +#pragma omp parallel +#pragma omp single + res = 0; + return res; +} diff --git a/tests/openmp-rpm/test.spec b/tests/openmp-rpm/test.spec new file mode 100644 index 0000000..e317a6a --- /dev/null +++ b/tests/openmp-rpm/test.spec @@ -0,0 +1,36 @@ +%global toolchain clang +%{?scl:%global scl_prefix %{scl}-} + +Name: test +Version: 1 +Release: 1 +Summary: Test package for checking that RPM packages using -fopenmp build correctly +License: MIT + +BuildRequires: %{?scl_prefix}clang +BuildRequires: %{?scl_prefix}libomp + +Source0: test.c + +%description +clang was adding RUNPATH to binaries that use OpenMP, and since RUNPATH +is prohibited in Fedora builds, this was causing packages using clang +and OpenMP to fail to build. + +References: +https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild +https://github.com/llvm/llvm-project/commit/9b9d08111b618d74574ba03e5cc3d752ecc56f55 + +%build +clang ${CFLAGS} -c %{SOURCE0} -o test.o +clang ${LDFLAGS} -fopenmp test.o -o main + +%check +./main + +%install +install -d %{buildroot}%{_bindir} +install main %{buildroot}%{_bindir} + +%files +%{_bindir}/main diff --git a/tests/ppc64le-long-double/main.fmf b/tests/ppc64le-long-double/main.fmf new file mode 100644 index 0000000..c341e3c --- /dev/null +++ b/tests/ppc64le-long-double/main.fmf @@ -0,0 +1,31 @@ +summary: Test that gcc and clang use the same long double format on ppc64le +test: $WITH_SCL ./runtest.sh +duration: 1h +adjust: + # Common requirements when LLVM is not SCL-ized + - require+: + - clang + when: "collection is not defined" + + - because: "Fedora CI runs in x86_64 only, emulate with qemu and mock" + require+: + - qemu-user-static + - mock + test: ./runtest-fedora.sh + when: distro == fedora and arch == x86_64 + continue: false + + - enabled: false + when: arch != ppc64le + + - require+: + - gcc + when: distro != fedora + + # Requirements for SCL-ized LLVM + - require+: + - llvm-toolset-13.0-clang + when: "collection == llvm-toolset-13.0" + - require+: + - llvm-toolset-14.0-clang + when: "collection == llvm-toolset-14.0" diff --git a/tests/ppc64le-long-double/runtest-fedora.sh b/tests/ppc64le-long-double/runtest-fedora.sh new file mode 100755 index 0000000..25dbb9c --- /dev/null +++ b/tests/ppc64le-long-double/runtest-fedora.sh @@ -0,0 +1,14 @@ +set -e + +fedora_release=`rpm -E %{fedora}` +mock_root=fedora-$fedora_release-ppc64le +triple=ppc64le-redhat-linux + +mock -r $mock_root --isolation=simple --install gcc +gcc_output=$(mock -r $mock_root --isolation=simple -q --shell gcc -E -dM -x c /dev/null | grep -e __LONG_DOUBLE_IEEE128__ -e __LONG_DOUBLE_IBM128__) +clang_output=$(clang -target $triple -E -dM -x c /dev/null | grep -e __LONG_DOUBLE_IEEE128__ -e __LONG_DOUBLE_IBM128__) + +echo "gcc: $gcc_output" +echo "clang: $clang_output" + +test "$gcc_output" = "$clang_output" diff --git a/tests/ppc64le-long-double/runtest.sh b/tests/ppc64le-long-double/runtest.sh new file mode 100755 index 0000000..8061bd7 --- /dev/null +++ b/tests/ppc64le-long-double/runtest.sh @@ -0,0 +1,9 @@ +set -e + +gcc_output=$(gcc -E -dM -x c /dev/null | grep -e __LONG_DOUBLE_IEEE128__ -e __LONG_DOUBLE_IBM128__) +clang_output=$(clang -E -dM -x c /dev/null | grep -e __LONG_DOUBLE_IEEE128__ -e __LONG_DOUBLE_IBM128__) + +echo "gcc: $gcc_output" +echo "clang: $clang_output" + +test "$gcc_output" = "$clang_output" diff --git a/tests/rhbz_1647130/main.fmf b/tests/rhbz_1647130/main.fmf index 53a4d0c..3445a1b 100644 --- a/tests/rhbz_1647130/main.fmf +++ b/tests/rhbz_1647130/main.fmf @@ -13,3 +13,7 @@ adjust: - llvm-toolset-13.0-clang - llvm-toolset-13.0-clang-analyzer when: "collection == llvm-toolset-13.0" + - require+: + - llvm-toolset-14.0-clang + - llvm-toolset-14.0-clang-analyzer + when: "collection == llvm-toolset-14.0" \ No newline at end of file diff --git a/tests/rhbz_1657544/main.fmf b/tests/rhbz_1657544/main.fmf index 3e7b320..a775439 100644 --- a/tests/rhbz_1657544/main.fmf +++ b/tests/rhbz_1657544/main.fmf @@ -11,3 +11,6 @@ adjust: - require+: - llvm-toolset-13.0-clang when: "collection == llvm-toolset-13.0" + - require+: + - llvm-toolset-14.0-clang + when: "collection == llvm-toolset-14.0" diff --git a/tests/rhbz_482491/main.fmf b/tests/rhbz_482491/main.fmf index a2f8800..f0929e9 100644 --- a/tests/rhbz_482491/main.fmf +++ b/tests/rhbz_482491/main.fmf @@ -12,3 +12,6 @@ adjust: - require+: - llvm-toolset-13.0-clang when: "collection == llvm-toolset-13.0" + - require+: + - llvm-toolset-14.0-clang + when: "collection == llvm-toolset-14.0" \ No newline at end of file diff --git a/tests/toolchains/main.fmf b/tests/toolchains/main.fmf index 8f6907e..9b8975b 100644 --- a/tests/toolchains/main.fmf +++ b/tests/toolchains/main.fmf @@ -13,9 +13,6 @@ adjust: - compiler-rt - lld when: "collection is not defined" - - require-: - - lld - when: collection is not defined and arch == s390x # Requirements for SCL-ized LLVM - require+: @@ -23,9 +20,19 @@ adjust: - llvm-toolset-13.0-compiler-rt - llvm-toolset-13.0-lld when: "collection == llvm-toolset-13.0" + - require+: + - llvm-toolset-14.0-clang + - llvm-toolset-14.0-compiler-rt + - llvm-toolset-14.0-lld + when: "collection == llvm-toolset-14.0" + + # lld not supported in s390x or ppc64. If any lld package was added to + # requirements, remove it. - require-: + - lld - llvm-toolset-13.0-lld - when: collection == llvm-toolset-13.0 and arch == s390x + - llvm-toolset-14.0-lld + when: arch == s390x or arch == ppc64 - environment+: CXXLIBS: "libc++" diff --git a/tests/toolchains/test.sh b/tests/toolchains/test.sh index b481961..65594e6 100755 --- a/tests/toolchains/test.sh +++ b/tests/toolchains/test.sh @@ -80,8 +80,10 @@ for compiler in clang clang++; do args="$args -pthread" fi - # lld is not supported in s390x - if [[ "$(uname -m)" = "s390x" && "$linker" = "lld" ]]; then + # lld is not supported in s390x and ppc64 + if [[ "$(uname -m)" = "s390x" || "$(uname -m)" = "ppc64" ]] \ + && [[ "$linker" = "lld" ]]; + then continue fi diff --git a/tests/use-dwarf4-by-default/main.fmf b/tests/use-dwarf4-by-default/main.fmf new file mode 100644 index 0000000..3151d7e --- /dev/null +++ b/tests/use-dwarf4-by-default/main.fmf @@ -0,0 +1,20 @@ +summary: Test that clang uses DWARFv4 by default +test: "$WITH_SCL ./test.sh" +require: + - libgcc +adjust: + # Common requirements when LLVM is not SCL-ized + - require+: + - clang + - llvm + when: "collection is not defined" + + # Requirements for SCL-ized LLVM + - require+: + - llvm-toolset-13.0-clang + - llvm-toolset-13.0-llvm + when: "collection == llvm-toolset-13.0" + - require+: + - llvm-toolset-14.0-clang + - llvm-toolset-14.0-llvm + when: "collection == llvm-toolset-14.0" diff --git a/tests/use-dwarf4-by-default/test.sh b/tests/use-dwarf4-by-default/test.sh new file mode 100755 index 0000000..5da8196 --- /dev/null +++ b/tests/use-dwarf4-by-default/test.sh @@ -0,0 +1,7 @@ +#!/bin/sh -eux + +echo "int main(){ return 0; }" | clang -g -v -x c - 2> build.log +# Make sure that clang is using the expected flag to use DWARF 4 +grep -q "\-dwarf-version=4" build.log +# Inspect the binary to double check expected DWARF version +llvm-dwarfdump a.out | grep -i version | grep 0x0004