diff --git a/0001-Restore-fopenmp-implicit-rpath-disabled-by-default.patch b/0001-Restore-fopenmp-implicit-rpath-disabled-by-default.patch deleted file mode 100644 index 2831c90..0000000 --- a/0001-Restore-fopenmp-implicit-rpath-disabled-by-default.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 5c209e4632cb6acdda3be01ae7d83c31ba956979 Mon Sep 17 00:00:00 2001 -From: Tom Stellard -Date: Thu, 9 Mar 2023 21:52:41 -0800 -Subject: [PATCH] Restore -fopenmp-implicit-rpath, disabled by default - -Used by redhat-rpm-config on older Fedora versions. ---- - clang/include/clang/Driver/Options.td | 6 ++++++ - clang/lib/Driver/ToolChains/CommonArgs.cpp | 19 +++++++++++++++++++ - clang/lib/Driver/ToolChains/CommonArgs.h | 3 +++ - clang/test/OpenMP/Inputs/libomp.a | 1 + - 4 files changed, 29 insertions(+) - create mode 100644 clang/test/OpenMP/Inputs/libomp.a - -diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td -index f745e573eb26..6289c1af9ada 100644 ---- a/clang/include/clang/Driver/Options.td -+++ b/clang/include/clang/Driver/Options.td -@@ -5484,6 +5484,12 @@ def offload_add_rpath: Flag<["--"], "offload-add-rpath">, - def no_offload_add_rpath: Flag<["--"], "no-offload-add-rpath">, - Flags<[NoArgumentUnused]>, - Alias; -+defm openmp_implicit_rpath: BoolFOption<"openmp-implicit-rpath", -+ LangOpts<"OpenMP">, -+ DefaultFalse, -+ PosFlag, -+ NegFlag, -+ BothFlags<[NoArgumentUnused]>>; - def r : Flag<["-"], "r">, Flags<[LinkerInput, NoArgumentUnused]>, - Group; - def regcall4 : Flag<["-"], "regcall4">, Group, -diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp -index 62a53b85ce09..c51766250983 100644 ---- a/clang/lib/Driver/ToolChains/CommonArgs.cpp -+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp -@@ -1109,6 +1109,23 @@ static void addOpenMPDeviceLibC(const Compilation &C, const ArgList &Args, - } - } - -+ -+void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC, -+ const ArgList &Args, -+ ArgStringList &CmdArgs) { -+ -+ if (Args.hasFlag(options::OPT_fopenmp_implicit_rpath, -+ options::OPT_fno_openmp_implicit_rpath, false)) { -+ // Default to clang lib / lib64 folder, i.e. the same location as device -+ // runtime -+ SmallString<256> DefaultLibPath = -+ llvm::sys::path::parent_path(TC.getDriver().Dir); -+ llvm::sys::path::append(DefaultLibPath, CLANG_INSTALL_LIBDIR_BASENAME); -+ CmdArgs.push_back("-rpath"); -+ CmdArgs.push_back(Args.MakeArgString(DefaultLibPath)); -+ } -+} -+ - void tools::addOpenMPRuntimeLibraryPath(const ToolChain &TC, - const ArgList &Args, - ArgStringList &CmdArgs) { -@@ -1185,6 +1202,8 @@ bool tools::addOpenMPRuntime(const Compilation &C, ArgStringList &CmdArgs, - addOpenMPDeviceLibC(C, Args, CmdArgs); - - addArchSpecificRPath(TC, Args, CmdArgs); -+ if (RTKind == Driver::OMPRT_OMP) -+ addOpenMPRuntimeSpecificRPath(TC, Args, CmdArgs); - addOpenMPRuntimeLibraryPath(TC, Args, CmdArgs); - - return true; -diff --git a/clang/lib/Driver/ToolChains/CommonArgs.h b/clang/lib/Driver/ToolChains/CommonArgs.h -index 5581905db311..3360eb0c6a37 100644 ---- a/clang/lib/Driver/ToolChains/CommonArgs.h -+++ b/clang/lib/Driver/ToolChains/CommonArgs.h -@@ -105,6 +105,9 @@ void AddAssemblerKPIC(const ToolChain &ToolChain, - const llvm::opt::ArgList &Args, - llvm::opt::ArgStringList &CmdArgs); - -+void addOpenMPRuntimeSpecificRPath(const ToolChain &TC, -+ const llvm::opt::ArgList &Args, -+ llvm::opt::ArgStringList &CmdArgs); - void addArchSpecificRPath(const ToolChain &TC, const llvm::opt::ArgList &Args, - llvm::opt::ArgStringList &CmdArgs); - void addOpenMPRuntimeLibraryPath(const ToolChain &TC, -diff --git a/clang/test/OpenMP/Inputs/libomp.a b/clang/test/OpenMP/Inputs/libomp.a -new file mode 100644 -index 000000000000..8b277f0dd5dc ---- /dev/null -+++ b/clang/test/OpenMP/Inputs/libomp.a -@@ -0,0 +1 @@ -+! --- -2.42.0 - diff --git a/clang.cfg b/clang.cfg deleted file mode 100644 index 08bf8e0..0000000 --- a/clang.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Drop the following option after debugedit adds support to DWARF-5: -# https://sourceware.org/bugzilla/show_bug.cgi?id=28728 --gdwarf-4 -g0 diff --git a/files.spec.inc b/files.spec.inc index eb23e29..59dee2a 100644 --- a/files.spec.inc +++ b/files.spec.inc @@ -337,9 +337,6 @@ %license clang/LICENSE.TXT %{install_prefix}/lib/clang/%{maj_ver}/include/* %{install_libdir}/*.so.* -%if 0%{?fedora} == 38 -%{_sysconfdir}/%{name}/%{_target_platform}.cfg -%endif %files -n %{pkg_name_clang}-devel %license clang/LICENSE.TXT diff --git a/install.spec.inc b/install.spec.inc index 0f11287..8c05418 100644 --- a/install.spec.inc +++ b/install.spec.inc @@ -184,12 +184,6 @@ chmod u-x %{buildroot}%{_mandir}/man1/scan-build.1* # populated by other packages mkdir -p %{buildroot}%{install_libdir}/clang/%{maj_ver}/{bin,include,lib,share}/ -%if 0%{?fedora} == 38 -# Install config file -mkdir -p %{buildroot}%{_sysconfdir}/%{name}/ -mv %{SOURCE2006} %{buildroot}%{_sysconfdir}/%{name}/%{_target_platform}.cfg -%endif - %if %{without compat_build} # Add a symlink in /usr/bin to clang-format-diff ln -s %{_datadir}/clang/clang-format-diff.py %{buildroot}%{_bindir}/clang-format-diff diff --git a/patches.spec.inc b/patches.spec.inc index 4579665..a6bbc88 100644 --- a/patches.spec.inc +++ b/patches.spec.inc @@ -16,13 +16,6 @@ Patch3002: 0001-Always-build-shared-libs-for-LLD.patch # # https://sourceware.org/bugzilla/show_bug.cgi?id=28728 # Source2006: 0001-Produce-DWARF4-by-default.patch -%if %{with snapshot_build} -# Temporary patch to add back -fno-openmp-implicit-rpath until we no longer -# support Fedora 38 or older, which pass -fno-openmp-implicit-rpath in -# redhat-rpm-config. -Patch9001: 0001-Restore-fopenmp-implicit-rpath-disabled-by-default.patch -%endif - #region RHEL patches Patch9002: 0001-Remove-myst_parser-dependency-for-RHEL.patch -#endregion \ No newline at end of file +#endregion diff --git a/prep.spec.inc b/prep.spec.inc index bacf5c5..c023cc9 100644 --- a/prep.spec.inc +++ b/prep.spec.inc @@ -14,10 +14,6 @@ # See https://rpm-software-management.github.io/rpm/manual/autosetup.html %autopatch -M9000 -p1 -%if 0%{?fedora} == 38 -%patch -p1 -P9001 -%endif - %if %{defined rhel} %patch -p1 -P9002 %endif diff --git a/sources.spec.inc b/sources.spec.inc index 5b1e64c..df2ec47 100644 --- a/sources.spec.inc +++ b/sources.spec.inc @@ -9,7 +9,6 @@ Source1006: release-keys.asc %if %{without compat_build} Source2005: macros.%{pkg_name_clang} %endif -Source2006: clang.cfg # Sources we use to split up the main spec file in sections so that we can more # easily see what specfile sections are touched by a patch.