Merge remote-tracking branch 'up/f37' into f37-riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
commit
5807e8c9c8
|
@ -223,3 +223,7 @@
|
||||||
/clang-tools-extra-15.0.0.src.tar.xz.sig
|
/clang-tools-extra-15.0.0.src.tar.xz.sig
|
||||||
/clang-15.0.0.src.tar.xz
|
/clang-15.0.0.src.tar.xz
|
||||||
/clang-15.0.0.src.tar.xz.sig
|
/clang-15.0.0.src.tar.xz.sig
|
||||||
|
/clang-tools-extra-15.0.4.src.tar.xz
|
||||||
|
/clang-tools-extra-15.0.4.src.tar.xz.sig
|
||||||
|
/clang-15.0.4.src.tar.xz
|
||||||
|
/clang-15.0.4.src.tar.xz.sig
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
24
clang.spec
24
clang.spec
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
%global maj_ver 15
|
%global maj_ver 15
|
||||||
%global min_ver 0
|
%global min_ver 0
|
||||||
%global patch_ver 0
|
%global patch_ver 4
|
||||||
#global rc_ver 3
|
#global rc_ver 3
|
||||||
%global clang_version %{maj_ver}.%{min_ver}.%{patch_ver}
|
%global clang_version %{maj_ver}.%{min_ver}.%{patch_ver}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
Name: %pkg_name
|
Name: %pkg_name
|
||||||
Version: %{clang_version}%{?rc_ver:~rc%{rc_ver}}
|
Version: %{clang_version}%{?rc_ver:~rc%{rc_ver}}
|
||||||
Release: 2.0.riscv64%{?dist}
|
Release: 1.0.riscv64%{?dist}
|
||||||
Summary: A C language family front-end for LLVM
|
Summary: A C language family front-end for LLVM
|
||||||
|
|
||||||
License: NCSA
|
License: NCSA
|
||||||
|
@ -70,10 +70,6 @@ Patch5: 0010-PATCH-clang-Produce-DWARF4-by-default.patch
|
||||||
# TODO: Can be dropped in LLVM 16: https://reviews.llvm.org/D133316
|
# TODO: Can be dropped in LLVM 16: https://reviews.llvm.org/D133316
|
||||||
Patch6: 0001-Mark-fopenmp-implicit-rpath-as-NoArgumentUnused.patch
|
Patch6: 0001-Mark-fopenmp-implicit-rpath-as-NoArgumentUnused.patch
|
||||||
|
|
||||||
# Backport of https://reviews.llvm.org/D133800 to the 15.0.0 release.
|
|
||||||
# TODO: Drop once updating to 15.0.1 or newer.
|
|
||||||
Patch7: 0001-Clang-15.0.1-Downgrade-implicit-int-and-implicit-fun.patch
|
|
||||||
|
|
||||||
%if %{without compat_build}
|
%if %{without compat_build}
|
||||||
# Patches for clang-tools-extra
|
# Patches for clang-tools-extra
|
||||||
# See https://reviews.llvm.org/D120301
|
# See https://reviews.llvm.org/D120301
|
||||||
|
@ -309,12 +305,9 @@ sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@//g' test/lit.cfg.py
|
||||||
%define _find_debuginfo_dwz_opts %{nil}
|
%define _find_debuginfo_dwz_opts %{nil}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# TODO: Drop the HAVE_CXX_ATOMICS64_WITHOUT_LIB once clang15 is in the buildroot. It looks like
|
# We set CLANG_DEFAULT_PIE_ON_LINUX=OFF to match the default used by Fedora's GCC.
|
||||||
# previously clang emitted __atomic_load for std::atomic<double>, which is not detected by cmake.
|
|
||||||
%cmake -G Ninja \
|
%cmake -G Ninja \
|
||||||
%ifarch %ix86
|
-DCLANG_DEFAULT_PIE_ON_LINUX=OFF \
|
||||||
-DHAVE_CXX_ATOMICS64_WITHOUT_LIB=OFF \
|
|
||||||
%endif
|
|
||||||
-DLLVM_PARALLEL_LINK_JOBS=1 \
|
-DLLVM_PARALLEL_LINK_JOBS=1 \
|
||||||
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
|
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
|
||||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||||
|
@ -466,6 +459,10 @@ ln -s %{_datadir}/clang/clang-format-diff.py %{buildroot}%{_bindir}/clang-format
|
||||||
%check
|
%check
|
||||||
%if %{without compat_build}
|
%if %{without compat_build}
|
||||||
%if %{with check}
|
%if %{with check}
|
||||||
|
# Build test dependencies separately, to prevent invocations of host clang from being affected
|
||||||
|
# by LD_LIBRARY_PATH below.
|
||||||
|
%cmake_build --target clang-test-depends \
|
||||||
|
ExtraToolsUnitTests ClangdUnitTests ClangIncludeCleanerUnitTests ClangPseudoUnitTests
|
||||||
# requires lit.py from LLVM utilities
|
# requires lit.py from LLVM utilities
|
||||||
# FIXME: Fix failing ARM & RISCV64 tests
|
# FIXME: Fix failing ARM & RISCV64 tests
|
||||||
LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{__ninja} check-all -C %{__cmake_builddir} || \
|
LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{__ninja} check-all -C %{__cmake_builddir} || \
|
||||||
|
@ -598,10 +595,13 @@ false
|
||||||
|
|
||||||
%endif
|
%endif
|
||||||
%changelog
|
%changelog
|
||||||
* Wed Oct 05 2022 David Abdurachmanov <davidlt@rivosinc.com> - 15.0.0-2.0.riscv64
|
* Thu Nov 24 2022 David Abdurachmanov <davidlt@rivosinc.com> - 15.0.4-1.0.riscv64
|
||||||
- Ignore test suite failures on riscv64 for now
|
- Ignore test suite failures on riscv64 for now
|
||||||
- Prepare for riscv64
|
- Prepare for riscv64
|
||||||
|
|
||||||
|
* Tue Nov 08 2022 Nikita Popov <npopov@redhat.com> - 15.0.4-1
|
||||||
|
- Update to LLVM 15.0.4
|
||||||
|
|
||||||
* Wed Sep 14 2022 Nikita Popov <npopov@redhat.com> - 15.0.0-2
|
* Wed Sep 14 2022 Nikita Popov <npopov@redhat.com> - 15.0.0-2
|
||||||
- Downgrade implicit int and implicit function declaration to warning only
|
- Downgrade implicit int and implicit function declaration to warning only
|
||||||
|
|
||||||
|
|
8
sources
8
sources
|
@ -1,4 +1,4 @@
|
||||||
SHA512 (clang-tools-extra-15.0.0.src.tar.xz) = 74e42df5a5496eacb69f172ac77a33fdf19be63cdab22c6bf5f7a9acdf9742bd48f8ee791cdf8bb14c17df9ba1e3b07c6e95ac68c62e4180acbd510fa971da49
|
SHA512 (clang-tools-extra-15.0.4.src.tar.xz) = a9969a55449a6d6eecab5bda071304c0cb804674795b643a53ad113b96bf5382678270bde47f1cd061b88156e3477ab2932f1c8e8926b7eb84dc7683341ce6e9
|
||||||
SHA512 (clang-tools-extra-15.0.0.src.tar.xz.sig) = b6adbffa21483f125fbe2712d7d20df9be2d05ea354f170b5d08f80499fdcf2eb37a4f2e5781dfdce124687fb94935f535aea37ff2d5ab6d81ffe88324a9272f
|
SHA512 (clang-tools-extra-15.0.4.src.tar.xz.sig) = 561bd572e8ce702e558bda37bd9739ceabc61865c65419ab8f575e45f75f4c244eb9617a1595b2379625c2a5649a3dd52aa66662505b294731f02663e303a7dd
|
||||||
SHA512 (clang-15.0.0.src.tar.xz) = cf6eab1bd4623e0bcf844839f5008ec49f83c9b4eb145de21798125a2c8798909007ed7c74a2ade1eed4b210a62750411b8dcad37263148a5ffca81988cf7dc4
|
SHA512 (clang-15.0.4.src.tar.xz) = 408061a0331799e8d6313dea75ba8f811daea43277b3d3f078daa694bc7e9eb9dbe9060824f6281417ca6804498359c5a8195f5a6c1949eaa3a9bab0e8c11649
|
||||||
SHA512 (clang-15.0.0.src.tar.xz.sig) = 6c15f4783512c402079af42f1ae55a9d3e03f622bbda5bd789e8902ef03a365d75d3765d4bf50975a75f116e72e780a5226ab2ad3e145c83a1cbf65fdee8d271
|
SHA512 (clang-15.0.4.src.tar.xz.sig) = 7c41fcf79218e30b6f37114bcb0b778c62de8e4fefe9889143de9a689d422b4ee50de49b7a50109cd21daea056e4eefb6f6de121889dfe40f4ef9a593758dde3
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
# Gating testplans for Clang
|
||||||
|
|
||||||
|
The tests for clang are in a separate repo: https://src.fedoraproject.org/tests/clang
|
||||||
|
This directory should contain only fmf plans (such as build-gating.fmf) which import
|
||||||
|
the tests from the tests repo. This can be done using the "url" parameter of the
|
||||||
|
plan's "discover" step. Reference: https://tmt.readthedocs.io/en/stable/spec/plans.html#fmf
|
|
@ -1,37 +0,0 @@
|
||||||
summary: libomp clang tests for build/PR gating
|
|
||||||
adjust:
|
|
||||||
- because: "Plan to be ran when either executed locally, or executed by CI system to gate a build or PR."
|
|
||||||
when: >-
|
|
||||||
trigger is defined
|
|
||||||
and trigger != commit
|
|
||||||
and trigger != build
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
- because: "When testing SCL-ized LLVM, the collection must be enabled first"
|
|
||||||
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
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
discover:
|
|
||||||
how: fmf
|
|
||||||
test: libomp
|
|
||||||
execute:
|
|
||||||
how: tmt
|
|
||||||
prepare:
|
|
||||||
# We want to make sure libomp is not already present on the system to ensure
|
|
||||||
# that clang pulls in the correct libomp dependencies when it is installed.
|
|
||||||
- name: Drop libomp
|
|
||||||
how: shell
|
|
||||||
script: |
|
|
||||||
yum erase -y libomp libomp-devel clang clang-libs
|
|
||||||
provision:
|
|
||||||
hardware:
|
|
||||||
memory: ">= 4 GiB"
|
|
|
@ -16,6 +16,8 @@ adjust:
|
||||||
discover:
|
discover:
|
||||||
how: fmf
|
how: fmf
|
||||||
test: pocl
|
test: pocl
|
||||||
|
url: https://src.fedoraproject.org/tests/clang.git
|
||||||
|
ref: main
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
prepare:
|
prepare:
|
||||||
|
|
|
@ -50,11 +50,13 @@ adjust:
|
||||||
discover:
|
discover:
|
||||||
- name: clang-tests
|
- name: clang-tests
|
||||||
how: fmf
|
how: fmf
|
||||||
|
url: https://src.fedoraproject.org/tests/clang.git
|
||||||
|
ref: main
|
||||||
filter: "tag:-not-in-default"
|
filter: "tag:-not-in-default"
|
||||||
- name: upstream-llvm-integration-testsuite
|
- name: upstream-llvm-integration-testsuite
|
||||||
how: fmf
|
how: fmf
|
||||||
url: https://src.fedoraproject.org/rpms/llvm.git
|
url: https://src.fedoraproject.org/tests/llvm.git
|
||||||
ref: rawhide
|
ref: main
|
||||||
test: integration-test-suite
|
test: integration-test-suite
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
summary: clang-format-diff
|
|
||||||
test: "$WITH_SCL ./test.sh"
|
|
||||||
adjust:
|
|
||||||
# Common requirements when LLVM is not SCL-ized
|
|
||||||
- require:
|
|
||||||
- clang-tools-extra
|
|
||||||
when: "collection is not defined"
|
|
||||||
|
|
||||||
# Requirements for SCL-ized LLVM
|
|
||||||
- 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"
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/bin/sh -eux
|
|
||||||
|
|
||||||
# Check that clang-format-diff is in PATH.
|
|
||||||
# rhbz#1939018
|
|
||||||
clang-format-diff -h
|
|
|
@ -1,5 +0,0 @@
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
void hello() {
|
|
||||||
printf("Hello World\n");
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
void hello() {
|
|
||||||
std::cout << "Hello World\n";
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
void hello();
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
|
||||||
hello();
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
void hello();
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
|
||||||
hello();
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
summary: fedora-flags
|
|
||||||
test: "$WITH_SCL ./test.sh"
|
|
||||||
require:
|
|
||||||
- redhat-rpm-config
|
|
||||||
adjust:
|
|
||||||
|
|
||||||
# Common requirements when LLVM is not SCL-ized
|
|
||||||
- require+:
|
|
||||||
- clang
|
|
||||||
when: "collection is not defined"
|
|
||||||
|
|
||||||
# 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"
|
|
||||||
|
|
||||||
- because: s390x does not have epel repo which is required to provide rpm macros
|
|
||||||
enabled: false
|
|
||||||
when: >-
|
|
||||||
distro == rhel-7
|
|
||||||
and arch == s390x
|
|
||||||
|
|
||||||
# Note: this needs epel-release repo to be available
|
|
||||||
- because: "To enable rpm macros not available by default (e.g. build_cflags), epel-rpm-macros is needed"
|
|
||||||
require+:
|
|
||||||
- epel-rpm-macros
|
|
||||||
when: distro == rhel-7
|
|
|
@ -1,20 +0,0 @@
|
||||||
#!/bin/sh -eux
|
|
||||||
|
|
||||||
set pipefail
|
|
||||||
|
|
||||||
cflags=`rpm -D '%toolchain clang' -E %{build_cflags}`
|
|
||||||
cxxflags=`rpm -D '%toolchain clang' -E %{build_cxxflags}`
|
|
||||||
ldflags=`rpm -D '%toolchain clang' -E %{build_ldflags}`
|
|
||||||
|
|
||||||
|
|
||||||
# Test a c program
|
|
||||||
clang $cflags -c hello.c -o hello.o
|
|
||||||
clang $cflags -c main.c -o main.o
|
|
||||||
clang $ldflags -o hello main.o hello.o
|
|
||||||
./hello | grep "Hello World"
|
|
||||||
|
|
||||||
# Test a cxx program
|
|
||||||
clang++ $cxxflags -c hello.cpp -o hello-cpp.o
|
|
||||||
clang++ $cxxflags -c main.cpp -o main-cpp.o
|
|
||||||
clang++ $ldflags -o hello-cpp main-cpp.o hello-cpp.o
|
|
||||||
./hello-cpp | grep "Hello World"
|
|
|
@ -1,36 +0,0 @@
|
||||||
# TODO: get fitting summary - what's the purpose of this test? Comment from the STI version says:
|
|
||||||
#
|
|
||||||
# We want to make sure libomp is not already present on the system to ensure
|
|
||||||
# that clang pulls in the correct libomp dependencies when it is installed.
|
|
||||||
summary: libomp tests
|
|
||||||
# This test requires a special preparation, see `/tests/tests-libomp` plan. As such,
|
|
||||||
# it shouldn't be part of the `/tests/default` plan.
|
|
||||||
tag:
|
|
||||||
- not-in-default
|
|
||||||
test: "$WITH_SCL ./test.sh"
|
|
||||||
adjust:
|
|
||||||
- because: "libomp is not supported in s390x"
|
|
||||||
when: arch == s390x
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
# Common requirements when LLVM is not SCL-ized
|
|
||||||
- require:
|
|
||||||
- clang
|
|
||||||
- clang-libs
|
|
||||||
- libomp
|
|
||||||
- libomp-devel
|
|
||||||
when: "collection is not defined"
|
|
||||||
|
|
||||||
# Requirements for SCL-ized LLVM
|
|
||||||
- require:
|
|
||||||
- llvm-toolset-13.0-clang
|
|
||||||
- llvm-toolset-13.0-clang-libs
|
|
||||||
- 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"
|
|
|
@ -1,8 +0,0 @@
|
||||||
#include <omp.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
|
||||||
int nthreads = omp_get_num_threads();
|
|
||||||
printf("Num Threads: %d\n", nthreads);
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -exo pipefail
|
|
||||||
|
|
||||||
clang -fopenmp openmp-compile-link-test.c
|
|
||||||
|
|
||||||
./a.out | grep "Num Threads: 1"
|
|
|
@ -1,18 +0,0 @@
|
||||||
# TODO: once llvm-test-suite is converted to TMT, we can just link the test from plan.
|
|
||||||
summary: Run tests from llvm-test-suite package
|
|
||||||
|
|
||||||
adjust:
|
|
||||||
- because: "llvm-test-suite is available for Fedora, not RHEL/CentOS"
|
|
||||||
when: >-
|
|
||||||
distro == rhel
|
|
||||||
or distro == centos
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
test: "$WITH_SCL ./test.sh"
|
|
||||||
|
|
||||||
require:
|
|
||||||
- git
|
|
||||||
- clang
|
|
||||||
- ninja-build
|
|
||||||
- llvm-test-suite
|
|
||||||
duration: 1h
|
|
|
@ -1,7 +0,0 @@
|
||||||
#!/bin/sh -eux
|
|
||||||
|
|
||||||
# TODO: tmt does not support a remote git repo as a requirement, one has to clone it "manually".
|
|
||||||
|
|
||||||
git clone --depth 1 https://src.fedoraproject.org/rpms/llvm-test-suite.git llvm-test-suite
|
|
||||||
cd llvm-test-suite/tests/test-suite
|
|
||||||
./runtest.sh
|
|
|
@ -1,30 +0,0 @@
|
||||||
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"
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
${BUILDDEP_CMD} -y test.spec
|
|
||||||
rpmbuild --define '_sourcedir .' --define '_builddir .' -bb test.spec
|
|
|
@ -1,7 +0,0 @@
|
||||||
int main(int argc, char **argv) {
|
|
||||||
int res = 1;
|
|
||||||
#pragma omp parallel
|
|
||||||
#pragma omp single
|
|
||||||
res = 0;
|
|
||||||
return res;
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
%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
|
|
|
@ -1,24 +0,0 @@
|
||||||
# TODO REVIEW: get fitting summary - what's the purpose of this test? Comment from the STI version says:
|
|
||||||
#
|
|
||||||
# This is separate from tests.yml because we want to run the tests without
|
|
||||||
# clang installed.
|
|
||||||
summary: pocl
|
|
||||||
|
|
||||||
adjust:
|
|
||||||
- because: "PoCL is shipped with Fedora, not RHEL/CentOS"
|
|
||||||
when: >-
|
|
||||||
distro == rhel
|
|
||||||
or distro == centos
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
# This test requires a special preparation, see `/tests/tests-pocl` plan. As such,
|
|
||||||
# it shouldn't be part of the `/tests/default` plan.
|
|
||||||
tag:
|
|
||||||
- not-in-default
|
|
||||||
# rhbz#1582884
|
|
||||||
test: "$WITH_SCL ./test.sh"
|
|
||||||
require:
|
|
||||||
- git
|
|
||||||
- ocl-icd-devel
|
|
||||||
- pocl
|
|
||||||
- gcc
|
|
|
@ -1,7 +0,0 @@
|
||||||
#!/bin/sh -eux
|
|
||||||
|
|
||||||
# TODO: tmt does not support a remote git repo as a requirement, one has to clone it "manually".
|
|
||||||
|
|
||||||
git clone --depth 1 https://src.fedoraproject.org/rpms/pocl.git pocl
|
|
||||||
cd pocl/tests/simple-opencl-no-clang
|
|
||||||
./runtest.sh
|
|
|
@ -1,33 +0,0 @@
|
||||||
summary: Test that gcc and clang use the same long double format on ppc64le
|
|
||||||
test: $WITH_SCL ./runtest.sh
|
|
||||||
duration: 1h
|
|
||||||
# see https://bugzilla.redhat.com/show_bug.cgi?id=2115752
|
|
||||||
enabled: false
|
|
||||||
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"
|
|
|
@ -1,14 +0,0 @@
|
||||||
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"
|
|
|
@ -1,9 +0,0 @@
|
||||||
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"
|
|
|
@ -1,19 +0,0 @@
|
||||||
summary: RHBZ1647130
|
|
||||||
test: "$WITH_SCL ./test.sh"
|
|
||||||
require: []
|
|
||||||
adjust:
|
|
||||||
# Common requirements when LLVM is not SCL-ized
|
|
||||||
- require+:
|
|
||||||
- clang
|
|
||||||
- clang-analyzer
|
|
||||||
when: "collection is not defined"
|
|
||||||
|
|
||||||
# Requirements for SCL-ized LLVM
|
|
||||||
- require+:
|
|
||||||
- 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"
|
|
|
@ -1,8 +0,0 @@
|
||||||
#!/bin/sh -eux
|
|
||||||
|
|
||||||
tmp_cpp=`mktemp -t XXXXX.cpp`
|
|
||||||
tmp_dir=`mktemp -d`
|
|
||||||
echo 'int main(int argc, char*argv[]) { while(argc--) new int(); return 0; }' > $tmp_cpp
|
|
||||||
scan-build -o $tmp_dir clang++ -c $tmp_cpp -o /dev/null
|
|
||||||
(scan-view --no-browser $tmp_dir/* & WPID=$! && sleep 10s && kill $WPID)
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
#include <charconv>
|
|
||||||
#include <iostream>
|
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
|
||||||
{
|
|
||||||
size_t r=0;
|
|
||||||
const char *begin = argv[1];
|
|
||||||
const char *end = begin + strlen(begin);
|
|
||||||
from_chars(begin, end, r);
|
|
||||||
cout << r << '\n';
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
summary: RHBZ1657544
|
|
||||||
test: "$WITH_SCL ./test.sh"
|
|
||||||
require: []
|
|
||||||
adjust:
|
|
||||||
# Common requirements when LLVM is not SCL-ized
|
|
||||||
- require+:
|
|
||||||
- clang
|
|
||||||
when: "collection is not defined"
|
|
||||||
|
|
||||||
# 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"
|
|
|
@ -1,4 +0,0 @@
|
||||||
#!/bin/sh -eux
|
|
||||||
|
|
||||||
clang++ from_chars.cpp
|
|
||||||
./a.out 100 | grep 100
|
|
|
@ -1,17 +0,0 @@
|
||||||
summary: rhbz-482491
|
|
||||||
test: "$WITH_SCL ./test.sh"
|
|
||||||
require:
|
|
||||||
- libgcc
|
|
||||||
adjust:
|
|
||||||
# Common requirements when LLVM is not SCL-ized
|
|
||||||
- require+:
|
|
||||||
- clang
|
|
||||||
when: "collection is not defined"
|
|
||||||
|
|
||||||
# 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"
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh -eux
|
|
||||||
|
|
||||||
find /usr -name 'libgcc_s.so*' && echo "int main(){}" | clang -v -x c -
|
|
|
@ -1,5 +0,0 @@
|
||||||
#include<stdio.h>
|
|
||||||
int main(int argc, char **argv) {
|
|
||||||
printf("Hello World\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
#include <iostream>
|
|
||||||
int main(int argc, char **argv) {
|
|
||||||
std::cout << "Hello World\n";
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
# TODO REVIEW: better summary
|
|
||||||
summary: ""
|
|
||||||
test: "$WITH_SCL ./test.sh"
|
|
||||||
require:
|
|
||||||
- glibc-static
|
|
||||||
- yum-utils
|
|
||||||
# This require EPEL/CRB to be enabled on RHEL
|
|
||||||
- libstdc++-static
|
|
||||||
adjust:
|
|
||||||
# Common requirements when LLVM is not SCL-ized
|
|
||||||
- require+:
|
|
||||||
- clang
|
|
||||||
- compiler-rt
|
|
||||||
- lld
|
|
||||||
when: "collection is not defined"
|
|
||||||
|
|
||||||
# Requirements for SCL-ized LLVM
|
|
||||||
- require+:
|
|
||||||
- llvm-toolset-13.0-clang
|
|
||||||
- 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
|
|
||||||
- llvm-toolset-14.0-lld
|
|
||||||
when: arch == s390x or arch == ppc64
|
|
||||||
|
|
||||||
- environment+:
|
|
||||||
CXXLIBS: "libc++"
|
|
||||||
require+:
|
|
||||||
- libcxx-devel
|
|
||||||
- libcxx-static
|
|
||||||
when: "distro == fedora"
|
|
||||||
because: testing against libcxx package in Fedora
|
|
||||||
|
|
||||||
- environment+:
|
|
||||||
CXXLIBS: "libstdc++"
|
|
||||||
require+:
|
|
||||||
- libstdc++
|
|
||||||
when: >-
|
|
||||||
distro == rhel
|
|
||||||
or distro == centos
|
|
||||||
because: testing against libstdc++ package in RHEL as libcxx is not shipped with RHEL
|
|
||||||
|
|
||||||
# TODO REVIEW: are these all requirements? test.sh seems to run quite a lot of stuff, looks like we
|
|
||||||
# need more packages from LLVM family.
|
|
|
@ -1,102 +0,0 @@
|
||||||
#!/bin/sh -eux
|
|
||||||
|
|
||||||
set pipefail
|
|
||||||
|
|
||||||
if [ -z "${CXXLIBS:-}" ]; then
|
|
||||||
echo "CXXLIBS variable is a required input but it's not specified!"
|
|
||||||
echo "Test metadata should have picked a proper value, depending on distro."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
status=0
|
|
||||||
|
|
||||||
test_toolchain() {
|
|
||||||
|
|
||||||
toolchain=$@
|
|
||||||
args=""
|
|
||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
|
||||||
case $1 in
|
|
||||||
clang)
|
|
||||||
compiler=$1
|
|
||||||
src=hello.c
|
|
||||||
;;
|
|
||||||
clang++)
|
|
||||||
compiler=$1
|
|
||||||
src=hello.cpp
|
|
||||||
;;
|
|
||||||
compiler-rt)
|
|
||||||
args="$args -rtlib=$1"
|
|
||||||
;;
|
|
||||||
libc++)
|
|
||||||
args="$args -stdlib=$1"
|
|
||||||
;;
|
|
||||||
libstdc++)
|
|
||||||
args="$args -stdlib=$1"
|
|
||||||
;;
|
|
||||||
lld)
|
|
||||||
args="$args -fuse-ld=$1"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
args="$args $1"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
cmd="$compiler $args $src"
|
|
||||||
rm -f a.out
|
|
||||||
echo "* $toolchain"
|
|
||||||
echo " command: $cmd"
|
|
||||||
if $cmd && ./a.out | grep -q 'Hello World'; then
|
|
||||||
echo " PASS"
|
|
||||||
else
|
|
||||||
echo " FAIL"
|
|
||||||
status=1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
clang --version
|
|
||||||
# Repoquery is needed instead yum info for compatibility with RHEL-7
|
|
||||||
repoquery -i --installed $(rpm -qf $(which clang)) | grep ^Source
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
for compiler in clang clang++; do
|
|
||||||
for rtlib in "" compiler-rt; do
|
|
||||||
for linker in "" lld; do
|
|
||||||
for cxxlib in "" $CXXLIBS; do
|
|
||||||
if [ "$compiler" = "clang" -a -n "$cxxlib" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
for args in "" -static; do
|
|
||||||
# Skip known failures
|
|
||||||
# TODO: Fix these
|
|
||||||
if [[ "$args" = "-static" && "$rtlib" = "compiler-rt" ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Static libc++ needs -pthread
|
|
||||||
if [[ "$args" = "-static" && "$cxxlib" = "libc++" ]]; then
|
|
||||||
args="$args -pthread"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# lld is not supported in s390x and ppc64
|
|
||||||
if [[ "$(uname -m)" = "s390x" || "$(uname -m)" = "ppc64" ]] \
|
|
||||||
&& [[ "$linker" = "lld" ]];
|
|
||||||
then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# compiler-rt does not provide builtins for s390x
|
|
||||||
if [[ "$(uname -m)" = "s390x" && "$rtlib" = "compiler-rt" ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
test_toolchain $compiler $rtlib $linker $cxxlib $args
|
|
||||||
done
|
|
||||||
done
|
|
||||||
done
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
exit $status
|
|
|
@ -1,20 +0,0 @@
|
||||||
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"
|
|
|
@ -1,7 +0,0 @@
|
||||||
#!/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
|
|
Loading…
Reference in New Issue