diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-01-12 02:24:21 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-01-12 02:24:21 +0000 |
| commit | 027c5fbb6d4d13b97edb98e8ed19f5dac5cfacd8 (patch) | |
| tree | eab3da5a8da485157eace3b34b18ed71e3a1335d | |
| parent | 00057e4e09d4f8a1aa88a74e112d36535548dd09 (diff) | |
| download | bcm5719-llvm-027c5fbb6d4d13b97edb98e8ed19f5dac5cfacd8.tar.gz bcm5719-llvm-027c5fbb6d4d13b97edb98e8ed19f5dac5cfacd8.zip | |
ccc: (Darwin) Pass -ObjC to linker if -ObjC, -ObjC++ or -fobjc is
present.
llvm-svn: 62070
| -rw-r--r-- | clang/tools/ccc/ccclib/Arguments.py | 7 | ||||
| -rw-r--r-- | clang/tools/ccc/ccclib/Tools.py | 13 |
2 files changed, 12 insertions, 8 deletions
diff --git a/clang/tools/ccc/ccclib/Arguments.py b/clang/tools/ccc/ccclib/Arguments.py index 5c5320ffe47..564114f405f 100644 --- a/clang/tools/ccc/ccclib/Arguments.py +++ b/clang/tools/ccc/ccclib/Arguments.py @@ -370,10 +370,8 @@ class OptionParser: self.oOption = self.addOption(JoinedOrSeparateOption('-o')) self.xOption = self.addOption(JoinedOrSeparateOption('-x')) - # FIXME: What do these actually do? The documentation is less than - # clear. - self.addOption(FlagOption('-ObjC')) - self.addOption(FlagOption('-ObjC++')) + self.ObjCOption = self.addOption(FlagOption('-ObjC')) + self.ObjCXXOption = self.addOption(FlagOption('-ObjC++')) # FIXME: Weird, gcc claims this here in help but I'm not sure why; # perhaps interaction with preprocessor? Investigate. @@ -559,6 +557,7 @@ class OptionParser: self.addOption(JoinedOption('-g')) self.f_exceptionsOption = self.addOption(FlagOption('-fexceptions')) + self.f_objcOption = self.addOption(FlagOption('-fobjc')) self.f_openmpOption = self.addOption(FlagOption('-fopenmp')) self.f_gnuRuntimeOption = self.addOption(FlagOption('-fgnu-runtime')) self.f_nestedFunctionsOption = self.addOption(FlagOption('-fnested-functions')) diff --git a/clang/tools/ccc/ccclib/Tools.py b/clang/tools/ccc/ccclib/Tools.py index 5ac948cca70..17a9ce822a9 100644 --- a/clang/tools/ccc/ccclib/Tools.py +++ b/clang/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? |

