changeset 1327:64d310e39a12

Teach ccwrap to switch off -xc after command line sources listed, so cc doesn't try to interpret libc and such as C sources.
author Rob Landley <rob@landley.net>
date Sat, 22 Jan 2011 14:40:00 -0600
parents be1f24b10864
children 08d92a215472
files sources/toys/ccwrap.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sources/toys/ccwrap.c	Wed Feb 09 21:10:04 2011 -0600
+++ b/sources/toys/ccwrap.c	Sat Jan 22 14:40:00 2011 -0600
@@ -112,7 +112,7 @@
 
 int main(int argc, char **argv)
 {
-	int linking = 1, use_static_linking = 0, use_shared_libgcc;
+	int linking = 1, use_static_linking = 0, use_shared_libgcc, used_x = 0;
 	int use_stdinc = 1, use_start = 1, use_stdlib = 1, use_shared = 0;
 	int source_count = 0, verbose = 0;
 	int i, argcnt, lplen;
@@ -357,6 +357,10 @@
 					if (strcmp("-fprofile-arcs",argv[i]) == 0) profile = 1;
 					break;
 
+				case 'x':
+					used_x++;
+					break;
+
 				// --longopts
 
 				case '-':
@@ -433,6 +437,8 @@
 
 		for (i=1; i<argc; i++) if (argv[i]) cc_argv[argcnt++] = argv[i];
 
+		if (used_x) cc_argv[argcnt++] = "-xnone";
+
 		// Add standard libraries
 
 		if (use_stdlib) {