diff --git a/.gitignore b/.gitignore index 430aedb..4096cdd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,7 @@ SOURCES/compiler-rt-15.0.7.src.tar.xz SOURCES/release-keys.asc /compiler-rt-15.0.7.src.tar.xz /release-keys.asc +/compiler-rt-16.0.0.src.tar.xz +/compiler-rt-16.0.0.src.tar.xz.sig +/cmake-16.0.0.src.tar.xz +/cmake-16.0.0.src.tar.xz.sig diff --git a/compiler-rt.spec b/compiler-rt.spec index b418442..7df6b0a 100644 --- a/compiler-rt.spec +++ b/compiler-rt.spec @@ -1,6 +1,10 @@ -%global compiler_rt_version 15.0.7 -#global rc_ver 2 +%global maj_ver 16 +%global min_ver 0 +%global patch_ver 0 +#global rc_ver 4 +%global compiler_rt_version %{maj_ver}.%{min_ver}.%{patch_ver} %global crt_srcdir compiler-rt-%{compiler_rt_version}%{?rc_ver:rc%{rc_ver}}.src +%global cmake_srcdir cmake-%{compiler_rt_version}%{?rc_ver:rc%{rc_ver}}.src # see https://sourceware.org/bugzilla/show_bug.cgi?id=25271 %global optflags %(echo %{optflags} -D_DEFAULT_SOURCE) @@ -18,8 +22,8 @@ URL: http://llvm.org Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compiler_rt_version}%{?rc_ver:-rc%{rc_ver}}/%{crt_srcdir}.tar.xz Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compiler_rt_version}%{?rc_ver:-rc%{rc_ver}}/%{crt_srcdir}.tar.xz.sig Source2: release-keys.asc - -Patch0: add-llvm-cmake-package.patch +Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compiler_rt_version}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz +Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compiler_rt_version}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz.sig # RHEL-specific patches Patch100: 0001-Drop-fno-stack-protector-from-the-compiler-flags.patch @@ -47,17 +51,27 @@ instrumentation, and Blocks C language extension. %prep %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' +%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE4}' --data='%{SOURCE3}' +%setup -T -q -b 3 -n %{cmake_srcdir} +# TODO: It would be more elegant to set -DLLVM_COMMON_CMAKE_UTILS=%{_builddir}/%{cmake_srcdir}, +# but this is not a CACHED variable, so we can't actually set it externally :( +cd .. +mv %{cmake_srcdir} cmake + %autosetup -n %{crt_srcdir} -p2 %py3_shebang_fix lib/hwasan/scripts/hwasan_symbolize %build +# Copy CFLAGS into ASMFLAGS, so -fcf-protection is used when compiling assembly files. +export ASMFLAGS=$CFLAGS mkdir -p %{_vpath_builddir} cd %{_vpath_builddir} %cmake .. -GNinja \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DLLVM_CONFIG_PATH:FILEPATH=%{_bindir}/llvm-config-%{__isa_bits} \ + -DCMAKE_MODULE_PATH=%{_libdir}/cmake/llvm \ + -DCMAKE_SKIP_RPATH:BOOL=ON \ \ %if 0%{?__isa_bits} == 64 -DLLVM_LIBDIR_SUFFIX=64 \ @@ -74,15 +88,15 @@ cd %{_vpath_builddir} %cmake_install # move blacklist/abilist files to where clang expect them -mkdir -p %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/share -mv -v %{buildroot}%{_datadir}/*list.txt %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/share/ +mkdir -p %{buildroot}%{_libdir}/clang/%{maj_ver}/share +mv -v %{buildroot}%{_datadir}/*list.txt %{buildroot}%{_libdir}/clang/%{maj_ver}/share/ # move sanitizer libs to better place %global libclang_rt_installdir lib/linux -mkdir -p %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/lib -mv -v %{buildroot}%{_prefix}/%{libclang_rt_installdir}/*clang_rt* %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/lib -mkdir -p %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/lib/linux/ -pushd %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/lib +mkdir -p %{buildroot}%{_libdir}/clang/%{maj_ver}/lib +mv -v %{buildroot}%{_prefix}/%{libclang_rt_installdir}/*_rt* %{buildroot}%{_libdir}/clang/%{maj_ver}/lib +mkdir -p %{buildroot}%{_libdir}/clang/%{maj_ver}/lib/linux/ +pushd %{buildroot}%{_libdir}/clang/%{maj_ver}/lib for i in *.a *.so do ln -s ../$i linux/$i @@ -92,11 +106,11 @@ done # the symlinks will be dangling if the 32 bits version is not installed, but that should be fine %ifarch x86_64 -mkdir -p %{buildroot}/%{_exec_prefix}/lib/clang/%{compiler_rt_version}/lib/linux +mkdir -p %{buildroot}/%{_exec_prefix}/lib/clang/%{maj_ver}/lib/linux for i in *.a *.so do target=`echo "$i" | sed -e 's/x86_64/i386/'` - ln -s ../../../../../lib/clang/%{compiler_rt_version}/lib/$target ../../../../%{_lib}/clang/%{compiler_rt_version}/lib/linux/ + ln -s ../../../../../lib/clang/%{maj_ver}/lib/$target ../../../../%{_lib}/clang/%{maj_ver}/lib/linux/ done %endif @@ -110,13 +124,16 @@ popd %files %license LICENSE.TXT %{_includedir}/* -%{_libdir}/clang/%{compiler_rt_version}/lib/* -%{_libdir}/clang/%{compiler_rt_version}/share/* +%{_libdir}/clang/%{maj_ver}/lib/* +%{_libdir}/clang/%{maj_ver}/share/* %ifarch x86_64 aarch64 %{_bindir}/hwasan_symbolize %endif %changelog +* Thu Apr 13 2023 Tom Stellard - 16.0.0-1 +- Update to LLVM 16.0.0 + * Thu Jan 19 2023 Tom Stellard - 15.0.7-1 - Update to LLVM 15.0.7 diff --git a/sources b/sources index 70e8acb..95f1ade 100644 --- a/sources +++ b/sources @@ -1,2 +1,4 @@ -SHA512 (compiler-rt-15.0.7.src.tar.xz) = 893aff1a7a3d382449b69ddfda10fbf0311f146266749e99683c3907fb5b9b34b63454625b066d4881a1d06b520bb066ea33f9be1ca6407d31044ef8e26e70f0 -SHA512 (release-keys.asc) = 08eab15cd40116bb1eea5ddcdd2822d248d6d7f5dce37868aa7152377aa0062567fe571909a1c9d3c3f8978ebcf5e0f6b0ab8fff13e3578c0548e21be3026462 +SHA512 (compiler-rt-16.0.0.src.tar.xz) = 6906964f0aa12bb18b137bee68a562412abf6d0200f8cfece83dc860ad06de41de847d04809fba08d9e2bb61f27e036eadb51fce153e05181f0bd4fecf29727d +SHA512 (compiler-rt-16.0.0.src.tar.xz.sig) = 8c6de41ed7bed40930fa60f2549ba1267d0b6ef6ed05f3febd879066b9bf8a812a7faccbd3bb791c5780a91f13decc3be0cb5e4cbe7d6281e5e96a4e21593119 +SHA512 (cmake-16.0.0.src.tar.xz) = 4f21461aa8165061dbea47dcda4f098957e16bd307484bcb66884cf5a0776197f69a74002d5601229c4630db53ac44049f3f2ce1e96a6bb16ba3df828d387932 +SHA512 (cmake-16.0.0.src.tar.xz.sig) = c8e22d62b73ed56e66af6e7ce7a8f41de7cc16cd1243ebb602a3e5077141c03d64ca75295ca08b0051c887f59c7a53b871f7a45ead3275e11310f574a50856aa