Update to 14.0.5

Resolves: rhbz#2061056
Resolves: rhbz#2061055

Update tests from Fedora repo
This commit is contained in:
Timm Bäder 2022-06-20 12:23:53 +02:00
parent c511bbc6cc
commit 94e3ce033b
24 changed files with 224 additions and 69 deletions

4
.gitignore vendored
View File

@ -186,3 +186,7 @@
/clang-tools-extra-14.0.0.src.tar.xz.sig /clang-tools-extra-14.0.0.src.tar.xz.sig
/clang-14.0.0.src.tar.xz.sig /clang-14.0.0.src.tar.xz.sig
/llvm-13.0.1.src.tar.xz /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

View File

@ -1,10 +1,10 @@
%bcond_with compat_build %bcond_with compat_build
%bcond_without bundle_compat_lib %bcond_with bundle_compat_lib
%bcond_without check %bcond_without check
%global maj_ver 14 %global maj_ver 14
%global min_ver 0 %global min_ver 0
%global patch_ver 0 %global patch_ver 5
%global clang_version %{maj_ver}.%{min_ver}.%{patch_ver} %global clang_version %{maj_ver}.%{min_ver}.%{patch_ver}
%if %{with compat_build} %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 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. # This patch can be dropped once gcc-12.0.1-0.5.fc36 is in the repo.
Patch5: 0001-Work-around-gcc-miscompile.patch 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 Patch7: 0010-PATCH-clang-Produce-DWARF4-by-default.patch
Patch8: disable-recommonmark.patch Patch8: disable-recommonmark.patch
@ -644,6 +642,9 @@ false
%endif %endif
%changelog %changelog
* Mon Jun 20 2022 Timm Bäder <tbaeder@redhat.com> - 14.0.5-1
- Update to 14.0.5
* Fri Apr 22 2022 Timm Bäder <tbaeder@redhat.com> - 14.0.0-1 * Fri Apr 22 2022 Timm Bäder <tbaeder@redhat.com> - 14.0.0-1
- 14.0.0 Release - 14.0.0 Release

View File

@ -1,44 +0,0 @@
commit fed96f31bb5b68f77dd617ee8e698dd8171ee71b
Author: Tom Stellard <tstellar@redhat.com>
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<m_Group>, Values<"none,all,non-leaf">,
HelpText<"Select return address signing scope">;
def mbranch_protection_EQ : Joined<["-"], "mbranch-protection=">,
+ Group<m_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:

10
sources
View File

@ -1,6 +1,4 @@
SHA512 (clang-14.0.0.src.tar.xz) = 26e701c0c24eefee1f0c1651cba7d16dca9a463e4d41c8bbc33d7b93a68c3dac0aeef6846d836eddc07afafa8116b81c95737223296f336897f2b75e1b3895f1 SHA512 (clang-14.0.5.src.tar.xz) = e69faea16e06c8eb4c7cf9969573a5af7dfad9c280d1858dc9655007129e83744dbca3bf928a040e9b66fc84738f76eccd8ae5bc61cf11be7e62d79dafabb5a2
SHA512 (clang-tools-extra-14.0.0.src.tar.xz) = fdf06a46a4c3d689076b41fcc0c42eedbe95924b1611a8f8fe693e4ac1013274cdea97482b48659172f133ed51607a9e979d9d717df4082b50b0c176be2515e5 SHA512 (clang-14.0.5.src.tar.xz.sig) = f727ddf5c4995645c6782c396a7e83d62c62c0a16afd9320ab5205ef497886ccb9ab3de24879cdab4e4a4edd4f281b371e26686d0ab721a5edec7781929ce40f
SHA512 (clang-tools-extra-14.0.0.src.tar.xz.sig) = 7a6fe5037d462eab4966946dc6ae4d5c53751da3f3a0ea3396a10add2b0e41d4cd26752c9dc82c6f69cefdcab63818e4e1f87ff601ef8c5bdacb81489a30b787 SHA512 (clang-tools-extra-14.0.5.src.tar.xz) = 9b729f04f769f8209a7bcca909d8a98b76d4789ab32707d5a55f7588a653c3b08a39c2f1bc61325a807315580069aa2dcb5c9fe1e5b1853a58fc548593154490
SHA512 (clang-14.0.0.src.tar.xz.sig) = 579f20b2a7ffee8fa077002272d7029c9f82e9904b52a720c46ac882679b08f6b68f92918593abce916fd4d55aceb1aa4fe26142b7f742e286d0aaa0b2809efd SHA512 (clang-tools-extra-14.0.5.src.tar.xz.sig) = 5146c238eba412afeb6839352f5974247470d92efcb5a30c876c76a112554d029d7d9e9bc3e748fc2e44db15857ddf81f226548372ca7f1f04bf7359b338570a
SHA512 (llvm-13.0.1.src.tar.xz) = 05fbe8708ac3d0dfef3a9135ee88185a95ed492095429a97d33b8aadb0187e59ad42d1a7184f02b5c84fdd31f3d7227c65bd292ed0aa039b29522e59cf90a965
SHA512 (clang-13.0.1.src.tar.xz) = 10abb601ce33ec0ec1e966221d958dd6206cfd5b178f8af0850408ed6adf2a9e193afb87a6449d65bb636e70a4debc3818035ab7bfcddf35a54a603851779d57

View File

@ -11,6 +11,10 @@ adjust:
environment+: environment+:
WITH_SCL: "scl enable llvm-toolset-13.0" WITH_SCL: "scl enable llvm-toolset-13.0"
when: "collection == 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" - because: "libomp not supported in s390x"
when: arch == s390x when: arch == s390x

View File

@ -23,6 +23,10 @@ adjust:
environment+: environment+:
WITH_SCL: "scl enable llvm-toolset-13.0" WITH_SCL: "scl enable llvm-toolset-13.0"
when: "collection == 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. # 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" - because: "On RHEL, CRB must be enabled to provide rarer packages"
@ -31,19 +35,17 @@ adjust:
how: shell how: shell
script: dnf config-manager --set-enabled rhel-CRB script: dnf config-manager --set-enabled rhel-CRB
when: >- when: >-
distro == centos distro == rhel-9
or distro == rhel-9
or distro == rhel-8 or distro == rhel-8
# Unfortunatelly, TMT does not support more declarative approach, we need to run commands on our own. # Unfortunately, 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" - because: "On CentOS, CRB must be enabled to provide rarer packages"
prepare+: prepare+:
- name: Enable EPEL - name: Enable CRB
how: shell how: shell
script: | script: dnf config-manager --set-enabled crb
rpm -q epel-release || yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm when: >-
yum-config-manager --enable epel distro == centos
when: distro == rhel-7
discover: discover:
- name: clang-tests - name: clang-tests

View File

@ -10,3 +10,6 @@ adjust:
- require: - require:
- llvm-toolset-13.0-clang-tools-extra - llvm-toolset-13.0-clang-tools-extra
when: "collection == llvm-toolset-13.0" when: "collection == llvm-toolset-13.0"
- require:
- llvm-toolset-14.0-clang-tools-extra
when: "collection == llvm-toolset-14.0"

View File

@ -2,6 +2,7 @@ summary: fedora-flags
test: "$WITH_SCL ./test.sh" test: "$WITH_SCL ./test.sh"
require: require:
- annobin - annobin
- clang
- redhat-rpm-config - redhat-rpm-config
adjust: adjust:
- because: s390x does not have epel repo which is required to provide rpm macros - because: s390x does not have epel repo which is required to provide rpm macros

View File

@ -28,3 +28,9 @@ adjust:
- llvm-toolset-13.0-libomp - llvm-toolset-13.0-libomp
- llvm-toolset-13.0-libomp-devel - llvm-toolset-13.0-libomp-devel
when: "collection == llvm-toolset-13.0" 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"

View File

@ -13,5 +13,6 @@ test: "$WITH_SCL ./test.sh"
require: require:
- git - git
- clang - clang
- ninja-build
- llvm-test-suite - llvm-test-suite
duration: 1h duration: 1h

30
tests/openmp-rpm/main.fmf Normal file
View File

@ -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"

6
tests/openmp-rpm/runtest.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
set -ex
${BUILDDEP_CMD} -y test.spec
rpmbuild --define '_sourcedir .' --define '_builddir .' -bb test.spec

7
tests/openmp-rpm/test.c Normal file
View File

@ -0,0 +1,7 @@
int main(int argc, char **argv) {
int res = 1;
#pragma omp parallel
#pragma omp single
res = 0;
return res;
}

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -13,3 +13,7 @@ adjust:
- llvm-toolset-13.0-clang - llvm-toolset-13.0-clang
- llvm-toolset-13.0-clang-analyzer - llvm-toolset-13.0-clang-analyzer
when: "collection == llvm-toolset-13.0" when: "collection == llvm-toolset-13.0"
- require+:
- llvm-toolset-14.0-clang
- llvm-toolset-14.0-clang-analyzer
when: "collection == llvm-toolset-14.0"

View File

@ -11,3 +11,6 @@ adjust:
- require+: - require+:
- llvm-toolset-13.0-clang - llvm-toolset-13.0-clang
when: "collection == llvm-toolset-13.0" when: "collection == llvm-toolset-13.0"
- require+:
- llvm-toolset-14.0-clang
when: "collection == llvm-toolset-14.0"

View File

@ -12,3 +12,6 @@ adjust:
- require+: - require+:
- llvm-toolset-13.0-clang - llvm-toolset-13.0-clang
when: "collection == llvm-toolset-13.0" when: "collection == llvm-toolset-13.0"
- require+:
- llvm-toolset-14.0-clang
when: "collection == llvm-toolset-14.0"

View File

@ -13,9 +13,6 @@ adjust:
- compiler-rt - compiler-rt
- lld - lld
when: "collection is not defined" when: "collection is not defined"
- require-:
- lld
when: collection is not defined and arch == s390x
# Requirements for SCL-ized LLVM # Requirements for SCL-ized LLVM
- require+: - require+:
@ -23,9 +20,19 @@ adjust:
- llvm-toolset-13.0-compiler-rt - llvm-toolset-13.0-compiler-rt
- llvm-toolset-13.0-lld - llvm-toolset-13.0-lld
when: "collection == llvm-toolset-13.0" 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-: - require-:
- lld
- llvm-toolset-13.0-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+: - environment+:
CXXLIBS: "libc++" CXXLIBS: "libc++"

View File

@ -80,8 +80,10 @@ for compiler in clang clang++; do
args="$args -pthread" args="$args -pthread"
fi fi
# lld is not supported in s390x # lld is not supported in s390x and ppc64
if [[ "$(uname -m)" = "s390x" && "$linker" = "lld" ]]; then if [[ "$(uname -m)" = "s390x" || "$(uname -m)" = "ppc64" ]] \
&& [[ "$linker" = "lld" ]];
then
continue continue
fi fi

View File

@ -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"

View File

@ -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