aboutsummaryrefslogtreecommitdiff
path: root/tools/ccc/ccclib/Tools.py
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-01-12 02:24:21 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-01-12 02:24:21 +0000
commitee8cc26f374a9dff0ba9e34fda1bdf3364c5beab (patch)
tree8cb56c34b925a95f687053887c072f61101b0ffc /tools/ccc/ccclib/Tools.py
parentebaae2a3103b443d50444d335ab5ab0ff7680da2 (diff)
ccc: (Darwin) Pass -ObjC to linker if -ObjC, -ObjC++ or -fobjc is
present. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62070 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/ccc/ccclib/Tools.py')
-rw-r--r--tools/ccc/ccclib/Tools.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/ccc/ccclib/Tools.py b/tools/ccc/ccclib/Tools.py
index 5ac948cca7..17a9ce822a 100644
--- a/tools/ccc/ccclib/Tools.py
+++ b/tools/ccc/ccclib/Tools.py
@@ -359,7 +359,8 @@ class Darwin10_X86_LinkTool(Tool):
assert outputType is Types.ImageType
# The logic here is derived from gcc's behavior; most of which
- # comes from specs (link_command). Consult gcc for more information.
+ # comes from specs (starting with link_command). Consult gcc
+ # for more information.
# FIXME: gcc's spec controls when this is done; certain things
# like -filelist or -Wl, still trigger a link stage. I don't
@@ -371,9 +372,13 @@ class Darwin10_X86_LinkTool(Tool):
# Not sure why this particular decomposition exists in gcc.
self.addLinkArgs(cmd_args, arch, arglist)
- # FIXME: Need to insert "additional linker options accumulated
- # from compilation". What does this mean precisely? And where
- # do -Wl, options and -Xlinker options come in?
+ # This toolchain never accumlates options in specs, the only
+ # place this gets used is to add -ObjC.
+ if (arglist.getLastArg(arglist.parser.ObjCOption) or
+ arglist.getLastArg(arglist.parser.f_objcOption)):
+ cmd_args.append('-ObjC')
+ if arglist.getLastArg(arglist.parser.ObjCXXOption):
+ cmd_args.append('-ObjC')
# FIXME: gcc has %{x} in here. How could this ever happen?
# Cruft?