shithub: scc

Download patch

ref: 5e53dda919d0c31035eed65afa299f045dcbad7f
parent: d24f3a5a58d30f4d08224323fb802a6950d7657a
author: Quentin Rameau <quinq@fifth.space>
date: Mon May 30 07:41:59 EDT 2016

[driver] switch per tool in settool

We will need that later with the introduction of as and ld.

--- a/driver/posix/scc.c
+++ b/driver/posix/scc.c
@@ -57,7 +57,9 @@
 	int fds[2], n;
 	static int fdin;
 
-	if (tool != QBE) {
+	switch (tool) {
+	case CC1:
+	case CC2:
 		n = snprintf(tools[tool].bin, sizeof(tools[tool].bin),
 		             arch ? "%s-%s" : "%s", tools[tool].name, arch);
 		if (n < 0 || n >= sizeof(tools[tool].bin))
@@ -67,6 +69,9 @@
 		             "%s/libexec/scc/%s", PREFIX, tools[tool].bin);
 		if (n < 0 || n >= sizeof(tools[tool].cmd))
 			die("scc: target tool path too long");
+		break;
+	default:
+		break;
 	}
 
 	tools[tool].args[0] = tools[tool].bin;