evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / cc / cctools / 0004-Use-nixpkgs-clang-with-the-assembler-driver.patch
blob058cfcdf0c490b1ef9e423d3152882f4a693a0de
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
6 ---
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
12 --- a/as/driver.c
13 +++ b/as/driver.c
14 @@ -36,7 +36,7 @@ char **envp)
15 char *p, c, *arch_name, *as, *as_local;
16 char **new_argv;
17 const char *CLANG = "clang";
18 - char *prefix, buf[MAXPATHLEN], resolved_name[PATH_MAX];
19 + char *prefix = "@clang-unwrapped@/bin/";
20 uint32_t bufsize;
21 struct arch_flag arch_flag;
22 const struct arch_flag *arch_flags, *family_arch_flag;
23 @@ -50,22 +50,6 @@ char **envp)
24 qflag = FALSE;
25 Qflag = FALSE;
26 some_input_files = FALSE;
27 - /*
28 - * Construct the prefix to the assembler driver.
29 - */
30 - bufsize = MAXPATHLEN;
31 - p = buf;
32 - i = _NSGetExecutablePath(p, &bufsize);
33 - if(i == -1){
34 - p = allocate(bufsize);
35 - _NSGetExecutablePath(p, &bufsize);
36 - }
37 - prefix = realpath(p, resolved_name);
38 - if(prefix == NULL)
39 - system_fatal("realpath(3) for %s failed", p);
40 - p = rindex(prefix, '/');
41 - if(p != NULL)
42 - p[1] = '\0';
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)
47 exit(1);
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.
55 --
56 2.45.2