Skip to content

Commit 92be0f8

Browse files
committed
CCTools: Add backport for as -> clang exe path setting
This adds a backport of my accepted patch [0] to allow `as` to invoke the correct `clang` executable. [0] tpoechtrager/cctools-port#169
1 parent e8a906c commit 92be0f8

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

bootstrap/CCTools/build_tarballs.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,15 @@ build_tarballs(;
144144
sources = [
145145
GitSource("https://github.com/tpoechtrager/cctools-port",
146146
"2a3e1c2a6ff54a30f898b70cfb9ba1692a55fad7"),
147+
DirectorySource("./patches"; target="patches"),
147148
],
148149
script = raw"""
149150
cd ${WORKSPACE}/srcdir/cctools-port/cctools
151+
152+
for patch in ${WORKSPACE}/srcdir/patches/*.patch; do
153+
atomic_patch -p2 ${patch}
154+
done
155+
150156
install_license ./APPLE_LICENSE
151157
install_license ./COPYING
152158
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/cctools/as/driver.c b/cctools/as/driver.c
2+
index 8b642043..2ff04752 100644
3+
--- a/cctools/as/driver.c
4+
+++ b/cctools/as/driver.c
5+
@@ -307,10 +307,12 @@ char **envp)
6+
as = makestr(prefix, CLANG, NULL);
7+
#endif
8+
/* cctools-port start */
9+
+ char *clang_exe = getenv("CCTOOLS_CLANG_AS_EXECUTABLE");
10+
+ clang_exe = clang_exe ? clang_exe : "clang";
11+
#ifndef __APPLE__
12+
char *target_triple = getenv("CCTOOLS_CLANG_AS_TARGET_TRIPLE");
13+
#endif /* ! __APPLE__ */
14+
- as = find_executable("clang");
15+
+ as = find_executable(clang_exe);
16+
/* cctools-port end */
17+
if(!as || access(as, F_OK) != 0){ /* cctools-port: added !as || */
18+
printf("%s: assembler (%s) not installed\n", progname,

0 commit comments

Comments
 (0)