1 From 86b5ad551ef0ffc7ca4da24b7619937bec738522 Mon Sep 17 00:00:00 2001
2 From: Randy Eckenrode <randy@largeandhighquality.com>
3 Date: Mon, 15 Apr 2024 20:47:59 -0400
4 Subject: [PATCH 4/6] Use nixpkgs clang with the assembler driver
7 as/driver.c | 20 +++-----------------
8 1 file changed, 3 insertions(+), 17 deletions(-)
10 diff --git a/as/driver.c b/as/driver.c
11 index a0d49ad..c15dcbf 100644
14 @@ -36,7 +36,7 @@ char **envp)
15 char *p, c, *arch_name, *as, *as_local;
17 const char *CLANG = "clang";
18 - char *prefix, buf[MAXPATHLEN], resolved_name[PATH_MAX];
19 + char *prefix = "@clang-unwrapped@/bin/";
21 struct arch_flag arch_flag;
22 const struct arch_flag *arch_flags, *family_arch_flag;
23 @@ -50,22 +50,6 @@ char **envp)
26 some_input_files = FALSE;
28 - * Construct the prefix to the assembler driver.
30 - bufsize = MAXPATHLEN;
32 - i = _NSGetExecutablePath(p, &bufsize);
34 - p = allocate(bufsize);
35 - _NSGetExecutablePath(p, &bufsize);
37 - prefix = realpath(p, resolved_name);
39 - system_fatal("realpath(3) for %s failed", p);
40 - p = rindex(prefix, '/');
44 * Process the assembler flags exactly like the assembler would (except
45 * let the assembler complain about multiple flags, bad combinations of
46 @@ -362,6 +346,8 @@ char **envp)
50 + prefix = "@gas@/bin/"; /* `libexec` is found relative to the assembler driver’s path. */
53 * If this assembler exist try to run it else print an error message.