## START: Set by rpmautospec ## (rpmautospec version 0.2.5) %define autorelease(e:s:pb:) %{?-p:0.}%{lua: release_number = 136; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist} ## END: Set by rpmautospec %global clang_version 13.0.0 %if 0%{?fedora} == 35 %global clang_version 13.0.0 %endif %if 0%{?fedora} == 36 %global clang_version 14.0.0 %endif Name: clang-rpm-macros Version: 1 Release: %autorelease Summary: RPM macros for building RPMs with clang License: GPLv3 URL: http://fedora.org Source0: verify-clang-cc # cyrus-sasl Source1: cyrus-sasl-run Source2: cyrus-sasl-0001-sample-Fix-build-with-clang-and-older-gcc.patch # libgcrypt Source3: libgcrypt-run Source5: libgcrypt-0001-Fix-build-of-jitterentropy-base.c-with-clang-v2.patch # Generic helper script Source6: remove-gcc-from-makefiles # gdb Source9: gdb-run Source10: gdb-fix-clang-errors.patch # libtasn1 Source14: libtasn1-run Source15: libtasn1-0001-Undefined-behavior-fix.patch # gmp Source16: gmp-run # libcap Source17: libcap-run # libdb Source20: libdb-run # dwz Source21: dwz-run # systemtap Source28: systemtap-run Source30: systemtap-0002-util-Use-abs-instead-of-labs.patch Source31: systemtap-0003-Add-some-override-specifiers-where-missing.patch Source32: systemtap-0004-Add-missing-copy-constructors-to-set1_ref-and-set1_c.patch Source33: systemtap-0005-set2-Return-this-from-assignment-operator.patch Source34: systemtap-0006-Fix-Woverloaded-virtual-warnings-when-building-with-.patch Source35: systemtap-0007-Fix-Wformat-nonliteral-and-Wformat-warnings-with-cla.patch Source36: systemtap-0008-dtrace-Use-o-option-to-specify-output-file-for-CPP.patch Source37: systemtap-0009-misc.patch Source39: export-lto-tools.sh Source40: export-ccc-override-options.sh Source42: gcc Source43: macros.clang-cc-overrides Source44: vulkan-validation-layers-run Source45: vulkan-validation-layers-remove-copy-assignment-operator.patch Source46: python3.10-run # libnetfilter_cthelper Source47: libnetfilter_cthelper-run Source48: libnetfilter_cthelper-0001-Use-__EXPORTED-rather-than-EXPORT_SYMBOL.patch # libnetfilter_cttimeout Source49: libnetfilter_cttimeout-run Source50: libnetfilter_cttimeout-0001-Use-__EXPORTED-rather-than-EXPORT_SYMBOL.patch BuildArch: noarch # For dwarfdump: Requires: libdwarf-tools # For readelf: Requires: binutils # For llvm-readelf Requires: llvm # The dist tag defined in macros.cc-clang-overrides ties this build to a # specific clang version. Requires: clang = %{clang_version} %global rrcdir %{_prefix}/lib/rpm/redhat/ %global clangrcdir %{_prefix}/lib/rpm/clang/ %description %{summary} %prep %build %install %{__mkdir_p} %{buildroot}%{rrcdir} %{__install} -p -m 755 -t %{buildroot}%{rrcdir} %{SOURCE0} %{__install} -p -d %{buildroot}%{clangrcdir} # cyrus-sasl %{__install} -p -m 755 -t %{buildroot}%{clangrcdir}/ %{SOURCE1} %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE2} # libgcrypt %{__install} -p -m 755 -t %{buildroot}%{clangrcdir}/ %{SOURCE3} %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE5} # remove-gcc-from-makefiles %{__install} -p -m 755 -t %{buildroot}%{clangrcdir}/ %{SOURCE6} # unzip ln -s remove-gcc-from-makefiles %{buildroot}%{clangrcdir}/unzip-run # zip ln -s remove-gcc-from-makefiles %{buildroot}%{clangrcdir}/zip-run # gdb %{__install} -p -m 755 -t %{buildroot}%{clangrcdir}/ %{SOURCE9} %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE10} # libtasn1 %{__install} -p -m 755 -t %{buildroot}%{clangrcdir}/ %{SOURCE14} %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE15} # gmp %{__install} -p -m 755 -t %{buildroot}%{clangrcdir}/ %{SOURCE16} # libcap %{__install} -p -m 755 -t %{buildroot}%{clangrcdir}/ %{SOURCE17} # libdb %{__install} -p -m 755 -t %{buildroot}%{clangrcdir}/ %{SOURCE20} # dwz %{__install} -p -m 755 -t %{buildroot}%{clangrcdir}/ %{SOURCE21} # systemtap %{__install} -p -m 755 -t %{buildroot}%{clangrcdir}/ %{SOURCE28} %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE30} %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE31} %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE32} %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE33} %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE34} %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE35} %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE36} %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE37} # Setup fake gcc path %{__install} -p -d %{buildroot}%{_sysconfdir}/profile.d/ %{__install} -p -m 644 -t %{buildroot}%{_sysconfdir}/profile.d/ %{SOURCE39} %{__install} -p -m 644 -t %{buildroot}%{_sysconfdir}/profile.d/ %{SOURCE40} %{__install} -p -d %{buildroot}%{clangrcdir}/bin ln -s ../../../../bin/clang %{buildroot}%{clangrcdir}/bin/cc ln -s ../../../../bin/clang++ %{buildroot}%{clangrcdir}/bin/g++ ln -s ../../../../bin/clang++ %{buildroot}%{clangrcdir}/bin/c++ ln -s ../../../../bin/clang-cpp %{buildroot}%{clangrcdir}/bin/cpp # gcc wrapper script %{__install} -p -m 755 -t %{buildroot}%{clangrcdir}/bin %{SOURCE42} # RPM macros %{__install} -p -d %{buildroot}%{_sysconfdir}/rpm/ %{__install} -p -m 644 -t %{buildroot}%{_sysconfdir}/rpm/ %{SOURCE43} # vulkan-validation-layers %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE45} #python3.10 %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE46} # libnetfilter_cthelper %{__install} -p -m 755 -t %{buildroot}%{clangrcdir}/ %{SOURCE47} %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE48} # libnetfilter_cttimeout %{__install} -p -m 755 -t %{buildroot}%{clangrcdir}/ %{SOURCE49} %{__install} -p -m 644 -t %{buildroot}%{clangrcdir}/ %{SOURCE50} %files %{rrcdir}/verify-clang-cc %{clangrcdir}/ %{_sysconfdir}/profile.d/export-lto-tools.sh %{_sysconfdir}/profile.d/export-ccc-override-options.sh %{_sysconfdir}/rpm/macros.clang-cc-overrides %changelog * Fri Apr 15 2022 Tom Stellard 1-136 - Add gcc symlink for numpy * Tue Apr 12 2022 Tom Stellard 1-135 - Disable LTO for libtool * Tue Apr 12 2022 Tom Stellard 1-134 - Let packages disable set_build_flags * Thu Apr 07 2022 Tom Stellard 1-133 - Backport a clang build fix from libnetfilter_cttimeout upstream * Thu Apr 07 2022 Tom Stellard 1-132 - Backport a clang build fix from libnetfilter_cthelper upstream * Tue Apr 05 2022 Tom Stellard 1-131 - Disable LTO for ipvsadm * Mon Apr 04 2022 Tom Stellard 1-130 - Disable LTO for numpy * Fri Apr 01 2022 Tom Stellard 1-129 - Re-enable debuginfo packages * Mon Mar 28 2022 Tom Stellard 1-128 - Export fake gcc path for scotch * Thu Mar 24 2022 Tom Stellard 1-127 - Bump clang version to 14.0.0 on f36 * Tue Mar 22 2022 Tom Stellard 1-126 - Export fake gcc path for iputils * Tue Mar 22 2022 Tom Stellard 1-125 - Export fake gcc path for flite * Sat Mar 19 2022 Tom Stellard 1-124 - Export fake gcc path for btrfs-progs * Fri Mar 18 2022 Tom Stellard 1-123 - Export fake gcc path for symlinks * Fri Mar 18 2022 Tom Stellard 1-122 - Fix a failing test in python3.10 * Fri Mar 18 2022 Tom Stellard 1-121 - Export fake cc path for subversion * Fri Mar 18 2022 Tom Stellard 1-120 - Export fake cc path for wpa_supplicant * Fri Mar 18 2022 Tom Stellard 1-119 - Export fake cc path for tinycdb * Thu Mar 17 2022 Tom Stellard 1-118 - Export fake gcc path during install phase * Thu Mar 17 2022 Tom Stellard 1-117 - Override build_fflags to ensure only supported flags are used * Wed Mar 16 2022 Tom Stellard 1-116 - Override gcc for R * Tue Mar 15 2022 Tom Stellard 1-115 - Disable debuginfo packages * Mon Mar 14 2022 Tom Stellard 1-114 - Add generation of package notes * Mon Mar 14 2022 Tom Stellard 1-113 - Add support for Fedora 36 * Tue Dec 21 2021 Tom Stellard 1-112 - Symlink gcc to clang for gjs * Sat Dec 18 2021 Tom Stellard 1-111 - Fix missing comments * Sat Dec 18 2021 Tom Stellard 1-110 - Fixes for festival * Sat Dec 11 2021 Tom Stellard 1-109 - Disable LTO for libvisual due to libtool * Sat Dec 11 2021 Tom Stellard 1-108 - Symlink gcc to clang for eth-tools * Sat Dec 11 2021 Tom Stellard 1-107 - Disable LTO for elinks due to missing LDFLAGS * Sat Dec 11 2021 Tom Stellard 1-106 - Remove dyninst patches * Fri Dec 10 2021 Tom Stellard 1-105 - Symlink gcc to clang for edk2 * Fri Dec 10 2021 Tom Stellard 1-104 - Disable LTO for dotconf due to libtool * Fri Dec 10 2021 Tom Stellard 1-103 - Disable LTO for compat-locales-sap due to ignoring LDFLAGS * Thu Dec 09 2021 Tom Stellard 1-102 - Disable LTO for libidn2 due to multiple definition error * Thu Dec 09 2021 Tom Stellard 1-101 - Disable LTO for libdb due to libtool * Thu Dec 09 2021 Tom Stellard 1-100 - Symlink gcc to clang for iptraf-ng * Thu Dec 09 2021 Tom Stellard 1-99 - Fixes for ladspa * Thu Dec 09 2021 Tom Stellard 1-98 - Fixes for libnbd * Thu Dec 09 2021 Tom Stellard 1-97 - Disable LTO for libieee1284 due to libtool * Thu Dec 09 2021 Tom Stellard 1-96 - Disable LTO on fio due to missing LDFLAGS * Thu Dec 09 2021 Tom Stellard 1-95 - Disable LTO for enchant due to libtool * Thu Dec 09 2021 Tom Stellard 1-94 - Disable LTO for plotutils due to libtool * Thu Dec 09 2021 Tom Stellard 1-93 - Disable LTO for libecap due to libtool * Thu Dec 09 2021 Tom Stellard 1-92 - Remove libsndfile patch * Thu Dec 09 2021 Tom Stellard 1-91 - Fixes for polkit * Tue Dec 07 2021 Tom Stellard 1-90 - Disable LTO for sendmail 8.16.1 * Tue Dec 07 2021 Tom Stellard 1-89 - Disable LTO for sssd due to undefined reference errors * Tue Dec 07 2021 Tom Stellard 1-88 - Use thinLTO for webkit2gtk3 to reduce build times * Tue Dec 07 2021 Tom Stellard 1-87 - Override qmake_qt5 macro to specify CC, CXX, and LINK * Mon Dec 06 2021 Tom Stellard 1-86 - Disable LTO for libdaemon * Mon Dec 06 2021 Tom Stellard 1-85 - Don't symlink gcc to clang by default * Mon Dec 06 2021 Timm Bäder 1-84 - add CCC_OVERRIDE_OPTIONS to make invocations * Sat Dec 04 2021 Tom Stellard 1-83 - Disable LTO for mod_auth_mellon * Sat Dec 04 2021 Tom Stellard 1-82 - Fix bug in verify-clang-cc * Fri Dec 03 2021 Tom Stellard 1-81 - Disable lto for flite-1.3 * Thu Dec 02 2021 Tom Stellard 1-80 - Call %%set_build_flags at the begining of %build and %check stages * Thu Dec 02 2021 Tom Stellard 1-79 - Disable lto for trace-cmd * Tue Nov 30 2021 Tom Stellard 1-78 - Disable lto for eth-tools * Tue Nov 30 2021 Tom Stellard 1-77 - Disable LTO for tinycdb due to old libtool * Fri Nov 19 2021 Timm Bäder 1-76 - Disable LTO for binutils * Fri Nov 19 2021 Timm Bäder 1-75 - Update gdb patch * Thu Nov 11 2021 Tom Stellard 1-74 - Disable LTO for sqlite due to old libtool * Thu Nov 11 2021 Tom Stellard 1-73 - Disable LTO for sblim-sfcCommon due to old libtool * Thu Nov 11 2021 Tom Stellard 1-72 - Disable LTO for sblim-cmpi-devel due to old libtool * Thu Nov 11 2021 Tom Stellard 1-71 - Fix typo in macros.clang-cc-overrides * Thu Nov 11 2021 Tom Stellard 1-70 - Disable LTO for sblim-indication_helper due to old libtool * Thu Nov 11 2021 Tom Stellard 1-69 - Disable lto for xdp-tools * Thu Nov 11 2021 Tom Stellard 1-68 - Disable LTO for libasyncns * Sat Nov 06 2021 Tom Stellard 1-67 - Disable lto for anthy due to old libtool script * Sat Nov 06 2021 Tom Stellard 1-66 - Disable lto for a52dec due to old libtool script * Sat Nov 06 2021 Tom Stellard 1-65 - Disable lto for SDL2_image due to old libtool script * Fri Nov 05 2021 Tom Stellard 1-64 - Specify default binutils to use * Fri Nov 05 2021 Tom Stellard 1-63 - Disable lto for the NetworkManager package * Thu Nov 04 2021 Tom Stellard 1-62 - Disable lto for the Judy package * Thu Oct 07 2021 Tom Stellard 1-61 - Bump required clang version to 13.0.0 * Tue Oct 05 2021 Timm Bäder 1-60 - Remove tpm2-pkcs11 patch * Tue Oct 05 2021 Timm Bäder 1-59 - spec: Use %autorelease and %autochangelog macros * Thu Sep 16 2021 Timm Bäder 1-58 - Update dyninst version in patches * Thu Sep 16 2021 Timm Bäder 1-57 - Add vulkan-validation-layers patch * Thu Sep 02 2021 Tom Stellard 1-56 - Fix file type check in verify-clang-cc * Tue Aug 24 2021 Tom Stellard 1-55 - Add macros file for buildroot overrides * Wed May 26 2021 Timm Bäder 1-54 - Fix tpm2-pkcs11-run * Wed May 26 2021 Tom Stellard 1-53 - Forward --version option on to the real gcc * Tue May 25 2021 Timm Bäder 1-52 - Remove obsolete tpm2-pkcs11 patches * Wed May 19 2021 Timm Bäder 1-51 - Remove obsolete systemtap patch * Wed May 19 2021 Timm Bäder 1-50 - Add thermald exception to gcc script * Wed May 19 2021 Timm Bäder 1-49 - verify-clang-cc: Expand QEMU special case detection * Sat May 08 2021 Timm Bäder 1-48 - Remove obsolete dyninst patch * Sat May 08 2021 Tom Stellard 1-47 - Fix typos in systemtap workarounds * Tue May 04 2021 Timm Bäder 1-46 - Add RPM package exceptions to gcc script * Tue Apr 27 2021 Timm Bäder 1-45 - Add another systemtap patch * Thu Apr 22 2021 Timm Bäder 1-44 - verify: Add qemu special case * Fri Apr 16 2021 Tom Stellard 1-43 - Remove kernel workaround * Fri Apr 16 2021 Timm Bäder 1-42 - Remove unnecessary gdb patches * Fri Apr 09 2021 Tom Stellard 1-41 - Fix bug in gcc wrapper * Fri Apr 09 2021 Tom Stellard 1-40 - Add libtool workaround * Fri Apr 02 2021 Tom Stellard 1-39 - Add cc and c++ symlinks to clang and clang++ * Fri Apr 02 2021 Tom Stellard 1-38 - veryify-clang-cc: Detect and ignore objects built with bpf * Thu Apr 01 2021 Tom Stellard 1-37 - Add tpm2-pkcs11 workarounds * Fri Feb 26 2021 Tom Stellard 1-36 - Remove compiler-rt workaround * Tue Jan 12 2021 Tom Stellard 1-35 - Remove systemd workaround * Fri Jan 08 2021 Tom Stellard 1-34 - Add workaround for kernel * Mon Dec 21 2020 Tom Stellard 1-33 - Update verify-clang-cc * Mon Dec 21 2020 Timm Bäder 1-32 - verify-clang-cc: Change logic for ignoring files * Mon Dec 21 2020 Timm Bäder 1-31 - verify-clang-cc: Call llvm-dwarfdump only once per file * Mon Dec 21 2020 Timm Bäder 1-30 - verify-clang-cc: Fix a typo * Mon Dec 21 2020 Tom Stellard 1-29 - Add gcc symlink to clang * Thu Nov 26 2020 Tom Stellard 1-28 - Add systemtap workarounds * Wed Nov 25 2020 Tom Stellard 1-27 - Add dyninst workaround * Sat Nov 21 2020 Tom Stellard 1-26 - Add libsndfile workaround * Wed Nov 11 2020 Tom Stellard 1-25 - Make verify-cc-clang script more generic * Wed Nov 11 2020 Tom Stellard 1-24 - dwz * Wed Nov 11 2020 Tom Stellard 1-23 - Add dwz workaround * Wed Nov 11 2020 Tom Stellard 1-22 - Add workaround for libdb-run * Tue Nov 10 2020 Tom Stellard 1-21 - Remove one of the libgcrypt workarounds * Mon Nov 09 2020 Tom Stellard 1-20 - Add missing compiler-rt files * Mon Nov 09 2020 Tom Stellard 1-19 - Update libcap-run for 2.44 * Fri Nov 06 2020 Tom Stellard 1-18 - Use --rescurse-depth=0 to speed up llvm-dwarfdump calls * Wed Oct 28 2020 Tom Stellard 1-17 - verify-clang-cc: Add special case for libpython3.so * Mon Oct 26 2020 Tom Stellard 1-16 - Add compiler-rt workaround * Fri Jul 31 2020 Tom Stellard 1-15 - Add libcap workaround * Fri Jul 31 2020 Tom Stellard 1-14 - Add workaround for gmp * Thu Jul 30 2020 Tom Stellard 1-13 - Add libtasn1 workarounds * Thu Jul 30 2020 Tom Stellard 1-12 - Add gdb workarounds * Thu Jul 30 2020 Tom Stellard 1-11 - Add systemd workaround * Tue Jul 28 2020 Tom Stellard 1-10 - Replace CC=gcc with CC=clang * Mon Jul 27 2020 Tom Stellard 1-9 - Add libgcrypt workaround * Mon Jul 27 2020 Tom Stellard 1-8 - Add Requires for tools used by verify-clang-cc * Fri Jul 24 2020 Tom Stellard 1-7 - Add work-around for cyrus-sasl * Fri Jul 10 2020 Tom Stellard 1-6 - Fix copy and paste error * Fri Jul 10 2020 Tom Stellard 1-5 - Improvements for verfy-clang-cc script * Tue Jun 16 2020 Tom Stellard 1-4 - Ignore .dwz directory in verify-clang-cc * Tue Jun 16 2020 Tom Stellard 1-3 - Update verify-clang-cc * Mon Jun 15 2020 Tom Stellard 1-2 - Remove redhat-hardened-clang.cfg * Mon Jun 15 2020 Tom Stellard 1-1 - Initial commit