Skip to content

Commit ee8c8f9

Browse files
authored
Merge pull request #235 from h-vetinari/patchwork
rebase & renormalize patches
2 parents 60e0ed0 + 3c0b7a9 commit ee8c8f9

9 files changed

+79
-118
lines changed

recipe/meta.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ source:
1919
- url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/llvm-project-{{ version.replace(".rc", "rc") }}.src.tar.xz
2020
sha256: ce5e71081d17ce9e86d7cbcfa28c4b04b9300f8fb7e78422b1feb6bc52c3028e
2121
patches:
22-
- patches/0002-Fix-sysroot-detection-for-linux.patch
23-
- patches/0003-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch
24-
- patches/0004-Fix-normalizeProgramName-s-handling-of-dots-outside-.patch
25-
- patches/0005-Set-VERSION-in-osx-as-well.patch
26-
- patches/0006-Fix-crosscompiling-LLVM-tools.patch
22+
- patches/0001-Fix-sysroot-detection-for-linux.patch
23+
- patches/0002-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch
24+
- patches/0003-Fix-normalizeProgramName-s-handling-of-dots-outside-.patch
25+
- patches/0004-Set-VERSION-in-osx-as-well.patch
26+
- patches/0005-Fix-crosscompiling-LLVM-tools.patch
2727
# Disable -Werror,-Wundef-prefix=TARGET_OS as they are not yet defined in the 10.9 SDK used for osx-64
2828
# Only enable it for TARGET_OS_OSX.
29-
- patches/0007-Only-error-on-undefined-TARGET_OS_OSX.patch # [osx and x86_64]
30-
- patches/0008-set-libclang-SOVERSION-unconditionally.patch
29+
- patches/0006-Only-error-on-undefined-TARGET_OS_OSX.patch # [osx and x86_64]
30+
- patches/0007-set-libclang-SOVERSION-unconditionally.patch
3131
# check out git history before LLVM 16 for these patches
3232
# - patches/amd-roc-2.7.0.diff # [variant != "hcc"]
3333
# - patches/amd-roc-hcc-2.7.0.diff # [variant == "hcc"]
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
From e46d9dd8f6701270b5243348ffb4b8c3430c4229 Mon Sep 17 00:00:00 2001
2+
From: Isuru Fernando <[email protected]>
3+
Date: Mon, 8 Apr 2019 16:32:17 -0500
4+
Subject: [PATCH 1/7] Fix sysroot detection for linux
5+
6+
---
7+
clang/lib/Driver/ToolChains/Linux.cpp | 20 ++++++++++++++++----
8+
1 file changed, 16 insertions(+), 4 deletions(-)
9+
10+
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
11+
index c6fb290ffdb..b817620a8bb 100644
12+
--- a/clang/lib/Driver/ToolChains/Linux.cpp
13+
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
14+
@@ -370,18 +370,30 @@ std::string Linux::computeSysRoot() const {
15+
return std::string();
16+
}
17+
18+
- if (!GCCInstallation.isValid() || !getTriple().isMIPS())
19+
+ if (!GCCInstallation.isValid())
20+
+ return std::string();
21+
+
22+
+ // Check for conda layout
23+
+ const StringRef InstallDir = GCCInstallation.getInstallPath();
24+
+ const StringRef TripleStr = GCCInstallation.getTriple().str();
25+
+
26+
+ std::string Path =
27+
+ (InstallDir + "/../../../../" + TripleStr + "/sysroot")
28+
+ .str();
29+
+
30+
+ if (getVFS().exists(Path))
31+
+ return Path;
32+
+
33+
+ if (!getTriple().isMIPS())
34+
return std::string();
35+
36+
// Standalone MIPS toolchains use different names for sysroot folder
37+
// and put it into different places. Here we try to check some known
38+
// variants.
39+
40+
- const StringRef InstallDir = GCCInstallation.getInstallPath();
41+
- const StringRef TripleStr = GCCInstallation.getTriple().str();
42+
const Multilib &Multilib = GCCInstallation.getMultilib();
43+
44+
- std::string Path =
45+
+ Path =
46+
(InstallDir + "/../../../../" + TripleStr + "/libc" + Multilib.osSuffix())
47+
.str();
48+

recipe/patches/0002-Fix-sysroot-detection-for-linux.patch

Lines changed: 0 additions & 65 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,31 @@
1-
From c2c32b2cd1c88f88d150ff502d5f1e0fd4d99512 Mon Sep 17 00:00:00 2001
1+
From c17bbdb9087baecccf7e06e55ac380ae71ee280c Mon Sep 17 00:00:00 2001
22
From: Nehal J Wani <[email protected]>
33
Date: Sat, 25 Aug 2018 09:20:04 -0500
4-
Subject: [PATCH 3/8] clang: add conda specific env var CONDA_BUILD_SYSROOT
4+
Subject: [PATCH 2/7] clang: add conda specific env var CONDA_BUILD_SYSROOT
55

66
---
7-
clang/lib/Driver/Driver.cpp | 9 +++++++--
7+
clang/lib/Driver/Driver.cpp | 5 +++++
88
clang/lib/Lex/InitHeaderSearch.cpp | 6 +++++-
9-
2 files changed, 12 insertions(+), 3 deletions(-)
9+
2 files changed, 10 insertions(+), 1 deletion(-)
1010

1111
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
12-
index 661d9977fb..f5a75515ed 100644
12+
index a268f2fa8fc..baf84d4d1ad 100644
1313
--- a/clang/lib/Driver/Driver.cpp
1414
+++ b/clang/lib/Driver/Driver.cpp
15-
@@ -1327,8 +1327,13 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
15+
@@ -1327,6 +1327,11 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
1616
CompilerPath = Split.second;
1717
}
1818
}
19-
- if (const Arg *A = Args.getLastArg(options::OPT__sysroot_EQ))
20-
- SysRoot = A->getValue();
2119
+ if (Optional<std::string> CondaBuildSysrootValue =
2220
+ llvm::sys::Process::GetEnv("CONDA_BUILD_SYSROOT")) {
2321
+ SysRoot = *CondaBuildSysrootValue;
2422
+ }
2523
+ // Override CONDA_BUILD_SYSROOT and consume sysroot option
26-
+ if (const Arg *A = Args.getLastArg(options::OPT__sysroot_EQ))
27-
+ SysRoot = A->getValue();
24+
if (const Arg *A = Args.getLastArg(options::OPT__sysroot_EQ))
25+
SysRoot = A->getValue();
2826
if (const Arg *A = Args.getLastArg(options::OPT__dyld_prefix_EQ))
29-
DyldPrefix = A->getValue();
30-
3127
diff --git a/clang/lib/Lex/InitHeaderSearch.cpp b/clang/lib/Lex/InitHeaderSearch.cpp
32-
index d446556571..8354362d1f 100644
28+
index d4465565718..8354362d1ff 100644
3329
--- a/clang/lib/Lex/InitHeaderSearch.cpp
3430
+++ b/clang/lib/Lex/InitHeaderSearch.cpp
3531
@@ -25,6 +25,7 @@
@@ -52,6 +48,3 @@ index d446556571..8354362d1f 100644
5248
break;
5349
}
5450
}
55-
--
56-
2.38.1.windows.1
57-

recipe/patches/0004-Fix-normalizeProgramName-s-handling-of-dots-outside-.patch renamed to recipe/patches/0003-Fix-normalizeProgramName-s-handling-of-dots-outside-.patch

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From d4dffafebae289d10cffcdd8cb41956d53e2fadc Mon Sep 17 00:00:00 2001
1+
From 3e7e229e2da4008946ba9b5cf15f3a9606a835ee Mon Sep 17 00:00:00 2001
22
From: Ray Donnelly <[email protected]>
33
Date: Wed, 30 Aug 2017 20:01:49 +0100
4-
Subject: [PATCH 4/8] Fix normalizeProgramName()'s handling of dots outside of
4+
Subject: [PATCH 3/7] Fix normalizeProgramName()'s handling of dots outside of
55
.exe
66

77
It used to strip everything after the last dot, turning:
@@ -18,7 +18,7 @@ x86_64-apple-darwin13.4
1818
1 file changed, 22 insertions(+), 1 deletion(-)
1919

2020
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
21-
index bc70205a6c..3a7948509a 100644
21+
index bc70205a6c0..3a7948509a6 100644
2222
--- a/clang/lib/Driver/ToolChain.cpp
2323
+++ b/clang/lib/Driver/ToolChain.cpp
2424
@@ -51,6 +51,7 @@ using namespace driver;
@@ -61,6 +61,3 @@ index bc70205a6c..3a7948509a 100644
6161
if (is_style_windows(llvm::sys::path::Style::native)) {
6262
// Transform to lowercase for case insensitive file systems.
6363
std::transform(ProgName.begin(), ProgName.end(), ProgName.begin(),
64-
--
65-
2.38.1.windows.1
66-

recipe/patches/0005-Set-VERSION-in-osx-as-well.patch renamed to recipe/patches/0004-Set-VERSION-in-osx-as-well.patch

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
From 736992bda48c9a10db659b402991590af76e8922 Mon Sep 17 00:00:00 2001
1+
From 53451239fa132559547b7dd8022d74526fba102a Mon Sep 17 00:00:00 2001
22
From: Isuru Fernando <[email protected]>
33
Date: Sat, 27 Jul 2019 11:55:23 -0500
4-
Subject: [PATCH 5/8] Set VERSION in osx as well
4+
Subject: [PATCH 4/7] Set VERSION in osx as well
55

66
---
77
clang/tools/libclang/CMakeLists.txt | 5 +++++
88
1 file changed, 5 insertions(+)
99

1010
diff --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt
11-
index 4f23065a24..da8a9740fa 100644
11+
index 4f23065a247..da8a9740fab 100644
1212
--- a/clang/tools/libclang/CMakeLists.txt
1313
+++ b/clang/tools/libclang/CMakeLists.txt
1414
@@ -172,6 +172,11 @@ if(ENABLE_SHARED)
@@ -23,6 +23,3 @@ index 4f23065a24..da8a9740fa 100644
2323
else()
2424
set_target_properties(libclang
2525
PROPERTIES
26-
--
27-
2.38.1.windows.1
28-

recipe/patches/0006-Fix-crosscompiling-LLVM-tools.patch renamed to recipe/patches/0005-Fix-crosscompiling-LLVM-tools.patch

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
From d3f9de592fb29a1e7f6870e3738778cec01a61e7 Mon Sep 17 00:00:00 2001
1+
From bcde5c3f996bf4f2e4abe17a697ee8fc675dbcee Mon Sep 17 00:00:00 2001
22
From: Isuru Fernando <[email protected]>
33
Date: Tue, 11 May 2021 15:08:13 +0200
4-
Subject: [PATCH 6/8] Fix crosscompiling LLVM tools
4+
Subject: [PATCH 5/7] Fix crosscompiling LLVM tools
55

66
---
77
clang/CMakeLists.txt | 10 ++++++++++
88
1 file changed, 10 insertions(+)
99

1010
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
11-
index 090cfa3520..3f617c6024 100644
11+
index 090cfa35207..3f617c60244 100644
1212
--- a/clang/CMakeLists.txt
1313
+++ b/clang/CMakeLists.txt
1414
@@ -67,6 +67,16 @@ if(CLANG_BUILT_STANDALONE)
@@ -28,6 +28,3 @@ index 090cfa3520..3f617c6024 100644
2828
include(TableGen)
2929
include(HandleLLVMOptions)
3030
include(VersionFromVCS)
31-
--
32-
2.38.1.windows.1
33-
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
From b11a745c54966f9f48cff368a2d46cb0e265597d Mon Sep 17 00:00:00 2001
1+
From ced5907cd03b4c84c0cb0d9d8a9bd07324852b2d Mon Sep 17 00:00:00 2001
22
From: "Uwe L. Korn" <[email protected]>
33
Date: Tue, 11 May 2021 15:09:51 +0200
4-
Subject: [PATCH 7/8] Only error on undefined TARGET_OS_OSX
4+
Subject: [PATCH 6/7] Only error on undefined TARGET_OS_OSX
55

66
---
77
clang/lib/Driver/ToolChains/Darwin.cpp | 2 +-
88
1 file changed, 1 insertion(+), 1 deletion(-)
99

1010
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
11-
index 9f95c962ee..fb3f8f16d0 100644
11+
index 9f95c962ee9..fb3f8f16d04 100644
1212
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
1313
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
1414
@@ -1099,7 +1099,7 @@ DarwinClang::DarwinClang(const Driver &D, const llvm::Triple &Triple,
@@ -20,6 +20,3 @@ index 9f95c962ee..fb3f8f16d0 100644
2020
CC1Args.push_back("-Werror=undef-prefix");
2121

2222
// For modern targets, promote certain warnings to errors.
23-
--
24-
2.38.1.windows.1
25-

recipe/patches/0008-set-libclang-SOVERSION-unconditionally.patch renamed to recipe/patches/0007-set-libclang-SOVERSION-unconditionally.patch

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
From 3be041186eb565edd232229bfb2a4b6201c5b636 Mon Sep 17 00:00:00 2001
1+
From ad4c79a522f9888398020dbf1df75f4c2f9f4ca6 Mon Sep 17 00:00:00 2001
22
From: "H. Vetinari" <[email protected]>
33
Date: Thu, 14 Apr 2022 11:57:00 +1100
4-
Subject: [PATCH 8/8] set libclang SOVERSION unconditionally
4+
Subject: [PATCH 7/7] set libclang SOVERSION unconditionally
55

66
and avoid creating libclang with full version suffix
77
---
88
clang/tools/libclang/CMakeLists.txt | 16 ++++++++++------
99
1 file changed, 10 insertions(+), 6 deletions(-)
1010

1111
diff --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt
12-
index da8a9740fa..dd4d43c56b 100644
12+
index da8a9740fab..dd4d43c56b4 100644
1313
--- a/clang/tools/libclang/CMakeLists.txt
1414
+++ b/clang/tools/libclang/CMakeLists.txt
1515
@@ -9,10 +9,7 @@
@@ -44,6 +44,3 @@ index da8a9740fa..dd4d43c56b 100644
4444
endif()
4545
endif()
4646

47-
--
48-
2.38.1.windows.1
49-

0 commit comments

Comments
 (0)