shithub: scc

Download patch

ref: 186e05bb5830df614015417a929d44db151af1e9
parent: 4b15d284ea6576d5229c43162e4c6dc38a386266
author: Quentin Rameau <quinq@fifth.space>
date: Wed Feb 21 12:26:28 EST 2018

Add internal include paths to cc1

--- a/driver/posix/Makefile
+++ b/driver/posix/Makefile
@@ -9,6 +9,7 @@
 HDR = config.h \
       $(PROJECTDIR)/inc/scc.h \
       $(PROJECTDIR)/inc/arg.h \
+      $(PROJECTDIR)/inc/sysincludes.h \
       $(PROJECTDIR)/inc/syslibs.h \
       $(PROJECTDIR)/inc/ldflags.h
 
--- a/driver/posix/scc.c
+++ b/driver/posix/scc.c
@@ -16,6 +16,7 @@
 #include "config.h"
 #include "../../inc/arg.h"
 #include "../../inc/scc.h"
+#include "../../inc/sysincludes.h"
 #include "../../inc/syslibs.h"
 #include "../../inc/ldflags.h"
 
@@ -118,6 +119,10 @@
 
 	switch (tool) {
 	case CC1:
+		for (n = 0; sysincludes[n]; ++n) {
+			addarg(tool, "-I");
+			addarg(tool, sysincludes[n]);
+		}
 	case CC2:
 		fmt = (qbe(tool)) ? "%s-qbe_%s-%s" : "%s-%s-%s";
 		n = snprintf(t->bin, sizeof(t->bin), fmt, t->cmd, arch, abi);