ccc: Darwin/X86: Implement remainder of (non -Z...) generic argument
translation.
 - As is my general strategy, this is initially pedantically
   compatible with gcc and can be cleaned up later. So, for example,
   we still pass -static to collect2 4 times if you say '-mkernel
   -fapple-kext'. ;)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62353 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/ccc/ccclib/Tools.py b/tools/ccc/ccclib/Tools.py
index a12c84a..ce87d38 100644
--- a/tools/ccc/ccclib/Tools.py
+++ b/tools/ccc/ccclib/Tools.py
@@ -619,9 +619,8 @@
 
     def addLinkArgs(self, cmd_args, arch, arglist):
         # Derived from link spec.
-        if arglist.getLastArg(arglist.parser.staticOption):
-            cmd_args.append('-static')
-        else:
+        arglist.addAllArgs(cmd_args, arglist.parser.staticOption)
+        if not arglist.getLastArg(arglist.parser.staticOption):
             cmd_args.append('-dynamic')
         if arglist.getLastArg(arglist.parser.f_gnuRuntimeOption):
             # FIXME: Replace -lobjc in forward args with