Skip to content

Commit 8451454

Browse files
committed
Port changes from RHEL 9
This change brings back some patches we had applied in LLVM 18. And since the `bundle_compat_lib` switch in RHEL still builds LLVM 18, I've added them here. This was easily possible due to #323. This effectively allows us to build LLVM 19 in RHEL9 (see also RHEL-57461). I've also added the `--gcc-install-dir` to the config file which is used once clang is installed. This is to tell clang in RHEL which standard library to link against. We decided to no longer patch clang to default to DWARF4. Instead we tune the default by adding `-gdwarf-4` to the config file. RHEL-wise we've bumped the gts version from 13 to 14 (see RHEL-38228).
1 parent f14556f commit 8451454

File tree

3 files changed

+972
-5
lines changed

3 files changed

+972
-5
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From 73d3b4047d757ef35850e2cef38285b96be82f0f Mon Sep 17 00:00:00 2001
2+
From: Nikita Popov <[email protected]>
3+
Date: Tue, 23 May 2023 12:17:29 +0200
4+
Subject: [PATCH] [Driver] Give devtoolset path precedence over InstalledDir
5+
6+
This is a followup to the change from c5fe10f365247c3dd9416b7ec8bad73a60b5946e.
7+
While that commit correctly adds the bindir from devtoolset to the
8+
path, the driver dir / install dir still comes first. This means
9+
we'll still end up picking /usr/bin/ld rather than the one from
10+
devtoolset.
11+
12+
Unfortunately, I don't see any way to test this. In the environment
13+
the tests are run, this would only result in a behavior difference
14+
if there is an ld binary present in the LLVM build directory, which
15+
isn't the case.
16+
17+
Differential Revision: https://reviews.llvm.org/D151203
18+
---
19+
clang/lib/Driver/ToolChains/Linux.cpp | 6 +++---
20+
1 file changed, 3 insertions(+), 3 deletions(-)
21+
22+
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
23+
index 853ff99d9fe5..aecabb46d4b9 100644
24+
--- a/clang/lib/Driver/ToolChains/Linux.cpp
25+
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
26+
@@ -244,9 +244,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
27+
// With devtoolset on RHEL, we want to add a bin directory that is relative
28+
// to the detected gcc install, because if we are using devtoolset gcc then
29+
// we want to use other tools from devtoolset (e.g. ld) instead of the
30+
- // standard system tools.
31+
- PPaths.push_back(Twine(GCCInstallation.getParentLibPath() +
32+
- "/../bin").str());
33+
+ // standard system tools. This should take precedence over InstalledDir.
34+
+ PPaths.insert(PPaths.begin(),
35+
+ Twine(GCCInstallation.getParentLibPath() + "/../bin").str());
36+
37+
if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb)
38+
ExtraOpts.push_back("-X");
39+
--
40+
2.40.1
41+

0 commit comments

Comments
 (0)