projects/guix·blob python-team · refs

61 lines · 1.9 KiB

1Make name of QBE binary configurable via macro as well
2
3Eases patching the code to refer to QBE by full path on Guix.
4
5diff --git a/README b/README
6index 67840799..1475edd7 100644
7--- a/README
8+++ b/README
9@@ -208,6 +208,8 @@ file `include/bits/scc/sys.h` and it included basically 5 elements:
10
11 - ASBIN: macro with the name of the assembler binary.
12
13+ - QBEBIN: macro with the name of the qbe binary.
14+
15 - sysincludes: It is a list of diretories used to locate
16 the system headers
17
18diff --git a/include/scc/bits/scc/sys-musl.h b/include/scc/bits/scc/sys-musl.h
19index 1cb1a12d..31267125 100644
20--- a/include/scc/bits/scc/sys-musl.h
21+++ b/include/scc/bits/scc/sys-musl.h
22@@ -1,5 +1,6 @@
23 #define LDBIN "ld"
24 #define ASBIN "as"
25+#define QBEBIN "qbe"
26
27 /* configure below your system linker command line */
28 #define GCCLIBPATH "/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2/"
29diff --git a/include/scc/bits/scc/sys-scc.h b/include/scc/bits/scc/sys-scc.h
30index 9d6ae86b..2948c5b2 100644
31--- a/include/scc/bits/scc/sys-scc.h
32+++ b/include/scc/bits/scc/sys-scc.h
33@@ -1,5 +1,6 @@
34 #define LDBIN "ld"
35 #define ASBIN "as"
36+#define QBEBIN "qbe"
37
38 /* configure below your standard sys include paths */
39 char *sysincludes[] = {
40diff --git a/src/cmd/scc-cc/posix/cc.c b/src/cmd/scc-cc/posix/cc.c
41index 40a3c109..49372777 100644
42--- a/src/cmd/scc-cc/posix/cc.c
43+++ b/src/cmd/scc-cc/posix/cc.c
44@@ -53,7 +53,7 @@ static struct tool {
45 [TEEIR] = {.bin = "tee"},
46 [CC2] = {.bin = "cc2"},
47 [TEEQBE] = {.bin = "tee"},
48- [QBE] = {.bin = "qbe"},
49+ [QBE] = {.bin = QBEBIN},
50 [TEEAS] = {.bin = "tee"},
51 [AS] = {.bin = ASBIN},
52 [LD] = {.bin = LDBIN},
53@@ -239,7 +239,7 @@ settool(int tool, char *infile, int nexttool)
54 die("scc-cc: target tool path is too long");
55 break;
56 case QBE:
57- strcpy(t->cmd, "qbe");
58+ strcpy(t->cmd, QBEBIN);
59
60 if (!strcmp(arch, "amd64") && !strcmp(abi, "sysv"))
61 fmt = "amd64_sysv";