]> granicus.if.org Git - clang/commitdiff
"This maps the -pthread option to -lpthread - this isn't 100% correct,
authorChris Lattner <sabre@nondot.org>
Sat, 21 Jun 2008 17:46:11 +0000 (17:46 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 21 Jun 2008 17:46:11 +0000 (17:46 +0000)
since handling this correctly is quite complex, and on some platforms
requires additional -D options and on some implies linking against a
different libc, but this works better than just ignoring the option.

The other change passes the -x option across to clang, which allows
compiling .c files as Objective-C and so on.  For some reason a lot of
configure scripts seem to be under the misguided impression that this
is a sensible thing to do."

Patch by David Chisnall!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52579 91177308-0d34-0410-b5e6-96231b3b80d8

utils/ccc

index b58bf616c24cc7c46e7f8df218fc4cac5eae2bb5..794c166b87951518e04e701c005781c24f5fbc00 100755 (executable)
--- a/utils/ccc
+++ b/utils/ccc
@@ -139,6 +139,10 @@ def main(args):
             if arg == '-Os': arg = '-O2'
             link_opts.append(arg)
 
+        # Enable threads
+        if arg == '-pthread':
+          link_opts.append('-lpthread')
+
         # Input files
         if arg == '-filelist':
             f = open(args[i+1])
@@ -148,6 +152,8 @@ def main(args):
             i += 1
         if arg == '-x':
             language = args[i+1]
+            compile_opts.append(arg)
+            compile_opts.append(args[i+1])
             i += 1
         if arg[0] != '-':
             files.append(arg)