[cfe-commits] r56853 - /cfe/trunk/utils/ccc

Daniel Dunbar daniel at zuster.org
Tue Sep 30 09:18:31 PDT 2008


Author: ddunbar
Date: Tue Sep 30 11:18:31 2008
New Revision: 56853

URL: http://llvm.org/viewvc/llvm-project?rev=56853&view=rev
Log:
Change ccc to not pass -x unknown down.

Pass through some more Mac OS X linker options.

Modified:
    cfe/trunk/utils/ccc

Modified: cfe/trunk/utils/ccc
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/ccc?rev=56853&r1=56852&r2=56853&view=diff

==============================================================================
--- cfe/trunk/utils/ccc (original)
+++ cfe/trunk/utils/ccc Tue Sep 30 11:18:31 2008
@@ -169,7 +169,7 @@
     elif extension == "S":
         return "assembler-with-cpp"
     else:
-        return "unknown"
+        return ""
 
 def main(args):
     action = 'link'
@@ -228,9 +228,14 @@
             compile_opts.append(args[i+1])
             i += 1
 
+        # Options with no arguments that should pass through
+        if arg in ('-dynamiclib',):
+            link_opts.append(arg)
+
         # Options with one argument that should pass through
         if arg in ('-framework', '-multiply_defined', '-bundle_loader',
-                   '-e'):
+                   '-e', '-unexported_symbols_list', '-install_name',
+                   '-compatibility_version', '-current_version'):
             link_opts.append(arg)
             link_opts.append(args[i+1])
             i += 1
@@ -299,10 +304,13 @@
                 files[i] = poutput
             else:
                 poutput = output
+            args = []
+            if language:
+                args.extend(['-x', language])
             if poutput:
-                args = ['-x', language, '-o', poutput, file] + compile_opts
+                args += ['-o', poutput, file] + compile_opts
             else:
-                args = ['-x', language, file] + compile_opts
+                args += [file] + compile_opts
             preprocess(args)
             # Discard the explicit language after used once
             language = ''
@@ -319,7 +327,10 @@
                 coutput = changeextension(file, "o")
             else:
                 coutput = output
-            args = ['-x', language, '-o', coutput, file] + compile_opts
+            args = []
+            if language:
+                args.extend(['-x', language])
+            args += ['-o', coutput, file] + compile_opts
             checked_compile(args, native, language, save_temps)
             language = ''
 
@@ -330,7 +341,10 @@
             ext = extension(file)
             if ext != "o" and ext != "a" and ext != "so":
                 out = changeextension(file, "o")
-                args = ['-x', language, '-o', out, file] + compile_opts
+                args = []
+                if language:
+                    args.extend(['-x', language])
+                args = ['-o', out, file] + compile_opts
                 checked_compile(args, native, language, save_temps)
                 language = ''
                 files[i] = out





More information about the cfe-commits mailing list