shithub: scc

Download patch

ref: 606b97ad13fb4cd06ed620a08d9fcd362e16c882
parent: 1dd9f7aa2c5cbd709907e764f643e8a561d11433
parent: d8b9359b95009ff1b7396a55512e5cdca5c9969b
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Jun 2 09:23:34 EDT 2016

Merge remote-tracking branch 'origin/master'

--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,7 @@
 	cp -f bin/cc1 $(PREFIX)/bin/cpp
 	cp -f bin/scc $(PREFIX)/bin/
 	cd $(PREFIX)/libexec/scc/ && chmod 755 cc* && strip cc*
-	cd $(PREFIX)/bin && chmod 755 cpp scc && strip cpp
+	cd $(PREFIX)/bin && chmod 755 cpp scc && strip cpp scc
 
 uninstall:
 	rm -rf $(PREFIX)/libexec/scc/
--- a/driver/posix/scc.c
+++ b/driver/posix/scc.c
@@ -35,9 +35,9 @@
 } tools[NR_TOOLS] = {
 	[CC1] = { .bin = "cc1", .cmd = PREFIX "/libexec/scc/", },
 	[CC2] = { .bin = "cc2", .cmd = PREFIX "/libexec/scc/", },
-	[QBE] = { .bin = "qbe", .bin = "qbe", .cmd = "qbe", },
-	[AS]  = { .bin = "cat", .bin = "cat", .cmd = "cat", },
-	[TEE] = { .bin = "tee", .bin = "tee", .cmd = "tee", },
+	[QBE] = { .bin = "qbe", .cmd = "qbe", },
+	[AS]  = { .bin = "as",  .cmd = "as", },
+	[TEE] = { .bin = "tee", .cmd = "tee", },
 };
 
 char *argv0;
@@ -144,8 +144,9 @@
 void
 build(char *file)
 {
-	int tool, out, keepfile;
-	static int in = NR_TOOLS, preout;
+	pid_t pid;
+	int i, st, tool, out, keepfile;
+	static int preout;
 
 	for (tool = CC1; tool < NR_TOOLS; tool = out) {
 		keepfile = 0;
@@ -152,7 +153,6 @@
 
 		switch (tool) {
 		case CC1:
-			in = NR_TOOLS;
 			out = Eflag ? NR_TOOLS : CC2;
 			if (!Eflag)
 				keepfile = kflag;
@@ -187,7 +187,6 @@
 		}
 
 		spawn(settool(inittool(tool), out));
-		in = tool;
 	}
 	for (i = 0; i < NR_TOOLS; ++i) {
 		if ((pid = tools[i].pid) == 0)
@@ -209,9 +208,6 @@
 int
 main(int argc, char *argv[])
 {
-	int st, i;
-	pid_t pid;
-
 	atexit(terminate);
 
 	arch = getenv("ARCH");