[cfe-commits] r62059 - in /cfe/trunk/tools/ccc/ccclib: HostInfo.py ToolChain.py Tools.py Types.py
Daniel Dunbar
daniel at zuster.org
Sun Jan 11 15:13:15 PST 2009
Author: ddunbar
Date: Sun Jan 11 17:13:15 2009
New Revision: 62059
URL: http://llvm.org/viewvc/llvm-project?rev=62059&view=rev
Log:
ccc: Add fairly complete argument translation for Darwin link step.
- Some things are still hardcoded, and macosx-version-min comparison
isn't implemented, but otherwise this very closely matches gcc.
- The one exception is that arguments (like -framework or -Wl,) which are
treated as linker inputs instead of options are not being
forwarded yet.
Modified:
cfe/trunk/tools/ccc/ccclib/HostInfo.py
cfe/trunk/tools/ccc/ccclib/ToolChain.py
cfe/trunk/tools/ccc/ccclib/Tools.py
cfe/trunk/tools/ccc/ccclib/Types.py
Modified: cfe/trunk/tools/ccc/ccclib/HostInfo.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/HostInfo.py?rev=62059&r1=62058&r2=62059&view=diff
==============================================================================
--- cfe/trunk/tools/ccc/ccclib/HostInfo.py (original)
+++ cfe/trunk/tools/ccc/ccclib/HostInfo.py Sun Jan 11 17:13:15 2009
@@ -31,7 +31,7 @@
def getToolChainForArch(self, arch):
if arch in ('i386', 'x86_64'):
- return ToolChain.Darwin_ToolChain(self.driver)
+ return ToolChain.Darwin10_X86_ToolChain(self.driver)
return ToolChain.Generic_GCC_ToolChain(self.driver)
Modified: cfe/trunk/tools/ccc/ccclib/ToolChain.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/ToolChain.py?rev=62059&r1=62058&r2=62059&view=diff
==============================================================================
--- cfe/trunk/tools/ccc/ccclib/ToolChain.py (original)
+++ cfe/trunk/tools/ccc/ccclib/ToolChain.py Sun Jan 11 17:13:15 2009
@@ -14,15 +14,15 @@
some particular action."""
abstract
-class Darwin_ToolChain(ToolChain):
+class Darwin10_X86_ToolChain(ToolChain):
def __init__(self, driver):
- super(Darwin_ToolChain, self).__init__(driver)
+ super(Darwin10_X86_ToolChain, self).__init__(driver)
self.toolMap = {
Phases.PreprocessPhase : Tools.GCC_PreprocessTool(),
Phases.CompilePhase : Tools.GCC_CompileTool(),
Phases.PrecompilePhase : Tools.GCC_PrecompileTool(),
Phases.AssemblePhase : Tools.DarwinAssembleTool(),
- Phases.LinkPhase : Tools.Collect2Tool(),
+ Phases.LinkPhase : Tools.Darwin10_X86_LinkTool(),
Phases.LipoPhase : Tools.LipoTool(),
}
Modified: cfe/trunk/tools/ccc/ccclib/Tools.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Tools.py?rev=62059&r1=62058&r2=62059&view=diff
==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Tools.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Tools.py Sun Jan 11 17:13:15 2009
@@ -1,3 +1,5 @@
+import sys # FIXME: Shouldn't be needed.
+
import Arguments
import Jobs
import Types
@@ -36,8 +38,10 @@
# Only pass -x if gcc will understand it; otherwise hope gcc
# understands the suffix correctly. The main use case this
- # would go wrong in is for linker inputs, say if the user
- # tried to make an executable named 'a.c'.
+ # would go wrong in is for linker inputs if they happened to
+ # have an odd suffix; really the only way to get this to
+ # happen is a command like '-x foobar a.c' which will treat
+ # a.c like a linker input.
#
# FIXME: For the linker case specifically, can we safely
# convert inputs into '-Wl,' options?
@@ -134,29 +138,400 @@
output, outputType, args, arglist,
[])
-class Collect2Tool(Tool):
+class Darwin10_X86_LinkTool(Tool):
kCollect2Path = '/usr/libexec/gcc/i686-apple-darwin10/4.2.1/collect2'
def __init__(self):
- super(Collect2Tool, self).__init__('collect2')
+ super(Darwin10_X86_LinkTool, self).__init__('collect2')
+
+ def addDarwinArch(self, cmd_args, arch, arglist):
+ # Derived from darwin_arch spec.
+ cmd_args.append('-arch')
+ # FIXME: The actual spec uses -m64 for this, but we want to
+ # respect arch. Figure out what exactly gcc is doing.
+ #if arglist.getLastArg(arglist.parser.m_64Option):
+ if arglist.getValue(arch) == 'x86_64':
+ cmd_args.append('x86_64')
+ else:
+ cmd_args.append('i386')
+
+ def addDarwinSubArch(self, cmd_args, arch, arglist):
+ # Derived from darwin_subarch spec, not sure what the
+ # distinction exists for but at least for this chain it is the same.
+ return self.addDarwinArch(cmd_args, arch, arglist)
+
+ def addLinkArgs(self, cmd_args, arch, arglist):
+ # Derived from link spec.
+ if arglist.getLastArg(arglist.parser.staticOption):
+ cmd_args.append('-static')
+ else:
+ cmd_args.append('-dynamic')
+ if arglist.getLastArg(arglist.parser.f_gnuRuntimeOption):
+ # FIXME: Replace -lobjc in forward args with
+ # -lobjc-gnu. How do we wish to handle such things?
+ pass
+
+ if not arglist.getLastArg(arglist.parser.ZdynamiclibOption):
+ if arglist.getLastArg(arglist.parser.Zforce_cpusubtype_ALLOption):
+ self.addDarwinArch(cmd_args, arch, arglist)
+ cmd_args.append('-force_cpusubtype_all')
+ else:
+ self.addDarwinSubArch(cmd_args, arch, arglist)
+
+ if arglist.getLastArg(arglist.parser.ZbundleOption):
+ cmd_args.append('-bundle')
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.Zbundle_loaderOption,
+ '-bundle_loader')
+ arglist.addAllArgs(cmd_args, arglist.parser.client_nameOption)
+ if arglist.getLastArg(arglist.parser.compatibility_versionOption):
+ # FIXME: Where should diagnostics go?
+ print >>sys.stderr, "-compatibility_version only allowed with -dynamiclib"
+ sys.exit(1)
+ if arglist.getLastArg(arglist.parser.current_versionOption):
+ print >>sys.stderr, "-current_version only allowed with -dynamiclib"
+ sys.exit(1)
+ if arglist.getLastArg(arglist.parser.Zforce_flat_namespaceOption):
+ cmd_args.append('-force_flat_namespace')
+ if arglist.getLastArg(arglist.parser.Zinstall_nameOption):
+ print >>sys.stderr, "-install_name only allowed with -dynamiclib"
+ sys.exit(1)
+ arglist.addLastArg(cmd_args, arglist.parser.keep_private_externsOption)
+ arglist.addLastArg(cmd_args, arglist.parser.private_bundleOption)
+ else:
+ cmd_args.append('-dylib')
+ if arglist.getLastArg(arglist.parser.ZbundleOption):
+ print >>sys.stderr, "-bundle not allowed with -dynamiclib"
+ sys.exit(1)
+ if arglist.getLastArg(arglist.parser.Zbundle_loaderOption):
+ print >>sys.stderr, "-bundle_loader not allowed with -dynamiclib"
+ sys.exit(1)
+ if arglist.getLastArg(arglist.parser.client_nameOption):
+ print >>sys.stderr, "-client_name not allowed with -dynamiclib"
+ sys.exit(1)
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.compatibility_versionOption,
+ '-dylib_compatibility_version')
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.current_versionOption,
+ '-dylib_current_version')
+
+ if arglist.getLastArg(arglist.parser.Zforce_cpusubtype_ALLOption):
+ self.addDarwinArch(cmd_args, arch, arglist)
+ # NOTE: We don't add -force_cpusubtype_ALL on this path. Ok.
+ else:
+ self.addDarwinSubArch(cmd_args, arch, arglist)
+
+ if arglist.getLastArg(arglist.parser.Zforce_flat_namespaceOption):
+ print >>sys.stderr, "-force_flat_namespace not allowed with -dynamiclib"
+ sys.exit(1)
+
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.Zinstall_nameOption,
+ '-dylib_install_name')
+
+ if arglist.getLastArg(arglist.parser.keep_private_externsOption):
+ print >>sys.stderr, "-keep_private_externs not allowed with -dynamiclib"
+ sys.exit(1)
+ if arglist.getLastArg(arglist.parser.private_bundleOption):
+ print >>sys.stderr, "-private_bundle not allowed with -dynamiclib"
+ sys.exit(1)
+
+ if arglist.getLastArg(arglist.parser.Zall_loadOption):
+ cmd_args.append('-all_load')
+
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.Zallowable_clientOption,
+ '-allowable_client')
+
+ if arglist.getLastArg(arglist.parser.Zbind_at_loadOption):
+ cmd_args.append('-bind_at_load')
+
+ if arglist.getLastArg(arglist.parser.Zdead_stripOption):
+ cmd_args.append('-dead_strip')
+
+ if arglist.getLastArg(arglist.parser.Zno_dead_strip_inits_and_termsOption):
+ cmd_args.append('-no_dead_strip_inits_and_terms')
+
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.Zdylib_fileOption,
+ '-dylib_file')
+
+ if arglist.getLastArg(arglist.parser.ZdynamicOption):
+ cmd_args.append('-dynamic')
+
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.Zexported_symbols_listOption,
+ '-exported_symbols_list')
+
+ if arglist.getLastArg(arglist.parser.Zflat_namespaceOption):
+ cmd_args.append('-flat_namespace')
+
+ arglist.addAllArgs(cmd_args, arglist.parser.headerpad_max_install_namesOption)
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.Zimage_baseOption,
+ '-image_base')
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.ZinitOption,
+ '-init')
+
+ if not arglist.getLastArg(arglist.parser.m_macosxVersionMinOption):
+ if not arglist.getLastArg(arglist.parser.m_iphoneosVersionMinOption):
+ # FIXME: I don't understand what is going on
+ # here. This is supposed to come from
+ # darwin_ld_minversion, but gcc doesn't seem to be
+ # following that; it must be getting over-ridden
+ # somewhere.
+ cmd_args.append('-macosx_version_min')
+ # FIXME: De-hardcode.
+ cmd_args.append('10.6.0')
+ pass
+ else:
+ # addAll doesn't make sense here but this is what gcc
+ # does.
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.m_macosxVersionMinOption,
+ '-macosx_version_min')
+
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.m_iphoneosVersionMinOption,
+ '-iphoneos_version_min')
+ arglist.addLastArg(cmd_args, arglist.parser.nomultidefsOption)
+
+ if arglist.getLastArg(arglist.parser.Zmulti_moduleOption):
+ cmd_args.append('-multi_module')
+
+ if arglist.getLastArg(arglist.parser.Zsingle_moduleOption):
+ cmd_args.append('-single_module')
+
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.Zmultiply_definedOption,
+ '-multiply_defined')
+
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.ZmultiplydefinedunusedOption,
+ '-multiply_defined_unused')
+
+ if arglist.getLastArg(arglist.parser.f_pieOption):
+ cmd_args.append('-pie')
+
+ arglist.addLastArg(cmd_args, arglist.parser.prebindOption)
+ arglist.addLastArg(cmd_args, arglist.parser.noprebindOption)
+ arglist.addLastArg(cmd_args, arglist.parser.nofixprebindingOption)
+ arglist.addLastArg(cmd_args, arglist.parser.prebind_all_twolevel_modulesOption)
+ arglist.addLastArg(cmd_args, arglist.parser.read_only_relocsOption)
+ arglist.addAllArgs(cmd_args, arglist.parser.sectcreateOption)
+ arglist.addAllArgs(cmd_args, arglist.parser.sectorderOption)
+ arglist.addAllArgs(cmd_args, arglist.parser.seg1addrOption)
+ arglist.addAllArgs(cmd_args, arglist.parser.segprotOption)
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.ZsegaddrOption,
+ '-segaddr')
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.Zsegs_read_only_addrOption,
+ '-segs_read_only_addr')
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.Zsegs_read_write_addrOption,
+ '-segs_read_write_addr')
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.Zseg_addr_tableOption,
+ '-seg_addr_table')
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.Zfn_seg_addr_table_filenameOption,
+ '-fn_seg_addr_table_filename')
+ arglist.addAllArgs(cmd_args, arglist.parser.sub_libraryOption)
+ arglist.addAllArgs(cmd_args, arglist.parser.sub_umbrellaOption)
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.isysrootOption,
+ '-syslibroot')
+ arglist.addLastArg(cmd_args, arglist.parser.twolevel_namespaceOption)
+ arglist.addLastArg(cmd_args, arglist.parser.twolevel_namespace_hintsOption)
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.ZumbrellaOption,
+ '-umbrella')
+ arglist.addAllArgs(cmd_args, arglist.parser.undefinedOption)
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.Zunexported_symbols_listOption,
+ '-unexported_symbols_list')
+ arglist.addAllArgsTranslated(cmd_args, arglist.parser.Zweak_reference_mismatchesOption,
+ '-weak_reference_mismatches')
+
+ if not arglist.getLastArg(arglist.parser.Zweak_reference_mismatchesOption):
+ cmd_args.append('-weak_reference_mismatches')
+ cmd_args.append('non-weak')
+
+ arglist.addLastArg(cmd_args, arglist.parser.XOption)
+ arglist.addAllArgs(cmd_args, arglist.parser.yOption)
+ arglist.addLastArg(cmd_args, arglist.parser.wOption)
+ arglist.addAllArgs(cmd_args, arglist.parser.pagezero_sizeOption)
+ arglist.addAllArgs(cmd_args, arglist.parser.segs_read_Option)
+ arglist.addLastArg(cmd_args, arglist.parser.seglinkeditOption)
+ arglist.addLastArg(cmd_args, arglist.parser.noseglinkeditOption)
+ arglist.addAllArgs(cmd_args, arglist.parser.sectalignOption)
+ arglist.addAllArgs(cmd_args, arglist.parser.sectobjectsymbolsOption)
+ arglist.addAllArgs(cmd_args, arglist.parser.segcreateOption)
+ arglist.addLastArg(cmd_args, arglist.parser.whyloadOption)
+ arglist.addLastArg(cmd_args, arglist.parser.whatsloadedOption)
+ arglist.addAllArgs(cmd_args, arglist.parser.dylinker_install_nameOption)
+ arglist.addLastArg(cmd_args, arglist.parser.dylinkerOption)
+ arglist.addLastArg(cmd_args, arglist.parser.MachOption)
def constructJob(self, phase, arch, jobs, inputs,
output, outputType, args, arglist):
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.
+
+ # FIXME: gcc's spec controls when this is done; certain things
+ # like -filelist or -Wl, still trigger a link stage. I don't
+ # quite understand how gcc decides to execute the linker,
+ # investigate. Also, the spec references -fdump= which seems
+ # to have disappeared?
cmd_args = []
- for arg in args:
- if arg.opt.name in ('-framework',):
- cmd_args.extend(arglist.render(arg))
+
+ # 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?
+
+ # FIXME: gcc has %{x} in here. How could this ever happen?
+ # Cruft?
+ arglist.addLastArg(cmd_args, arglist.parser.dOption)
+ arglist.addLastArg(cmd_args, arglist.parser.tOption)
+ arglist.addLastArg(cmd_args, arglist.parser.ZOption)
+ arglist.addLastArg(cmd_args, arglist.parser.uOption)
+ arglist.addLastArg(cmd_args, arglist.parser.AOption)
+ arglist.addLastArg(cmd_args, arglist.parser.eOption)
+ arglist.addLastArg(cmd_args, arglist.parser.mOption)
+ arglist.addLastArg(cmd_args, arglist.parser.rOption)
+
+ cmd_args.extend(arglist.render(output))
+
+ if (not arglist.getLastArg(arglist.parser.AOption) and
+ not arglist.getLastArg(arglist.parser.nostdlibOption) and
+ not arglist.getLastArg(arglist.parser.nostartfilesOption)):
+ # Derived from startfile spec.
+ if arglist.getLastArg(arglist.parser.ZdynamiclibOption):
+ # Derived from darwin_dylib1 spec.
+ if arglist.getLastArg(arglist.parser.m_iphoneosVersionMinOption):
+ cmd_args.append('-ldylib1.o')
+ else:
+ if self.macosxVersionCmp('<', '10.5', arglist):
+ cmd_args.append('-ldylib1.o')
+ else:
+ cmd_args.append('-ldylib1.10.5.o')
+ else:
+ if arglist.getLastArg(arglist.parser.ZbundleOption):
+ if not arglist.getLastArg(arglist.parser.staticOption):
+ cmd_args.append('-lbundle1.o')
+ else:
+ if arglist.getLastArg(arglist.parser.pgOption):
+ if arglist.getLastArg(arglist.parser.staticOption):
+ cmd_args.append('-lgcrt0.o')
+ else:
+ if arglist.getLastArg(arglist.parser.objectOption):
+ cmd_args.append('-lgcrt0.o')
+ else:
+ if arglist.getLastArg(arglist.parser.preloadOption):
+ cmd_args.append('-lgcrt0.o')
+ else:
+ cmd_args.append('-lgcrt1.o')
+
+ # darwin_crt2 spec is empty.
+ pass
+ else:
+ if arglist.getLastArg(arglist.parser.staticOption):
+ cmd_args.append('-lcrt0.o')
+ else:
+ if arglist.getLastArg(arglist.parser.objectOption):
+ cmd_args.append('-lcrt0.o')
+ else:
+ if arglist.getLastArg(arglist.parser.preloadOption):
+ cmd_args.append('-lcrt0.o')
+ else:
+ # Derived from darwin_crt1 spec.
+ if arglist.getLastArg(arglist.parser.m_iphoneosVersionMinOption):
+ cmd_args.append('-lcrt1.o')
+ else:
+ if self.macosxVersionCmp('<', '10.5', arglist):
+ cmd_args.append('-lcrt1.o')
+ else:
+ cmd_args.append('-lcrt1.10.5.o')
+
+ # darwin_crt2 spec is empty.
+ pass
+
+ if arglist.getLastArg(arglist.parser.sharedLibgccOption):
+ if not arglist.getLastArg(arglist.parser.m_iphoneosVersionMinOption):
+ if self.macosxVersionCmp('<', '10.5', arglist):
+ # FIXME: gcc does a library search for this
+ # file, this will be be broken currently.
+ cmd_args.append('crt3.o')
+
+ arglist.addAllArgs(cmd_args, arglist.parser.LOption)
+
+ if arglist.getLastArg(arglist.parser.f_openmpOption):
+ # This is more complicated in gcc...
+ cmd_args.append('-lgomp')
+
+ # FIXME: Derive these correctly.
+ if arglist.getValue(arch) == 'x86_64':
+ cmd_args.extend(["-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64",
+ "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64"])
+ cmd_args.extend(["-L/usr/lib/i686-apple-darwin10/4.2.1",
+ "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1",
+ "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1",
+ "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1",
+ "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../.."])
+
for input in inputs:
cmd_args.append(arglist.getValue(input.source))
- cmd_args.extend(arglist.render(output))
- cmd_args.extend(['-L/usr/lib/gcc/i686-apple-darwin10/4.2.1',
- '-lcrt1.10.5.o',
- '-lgcc_s.10.5',
- '-lgcc',
- '-lSystem'])
+
+ if (arglist.getLastArg(arglist.parser.f_profileArcsOption) or
+ arglist.getLastArg(arglist.parser.f_profileGenerateOption) or
+ arglist.getLastArg(arglist.parser.f_createProfileOption) or
+ arglist.getLastArg(arglist.parser.coverageOption)):
+ cmd_args.append('-lgcov')
+
+ if arglist.getLastArg(arglist.parser.f_nestedFunctionsOption):
+ cmd_args.append('-allow_stack_execute')
+
+ if (not arglist.getLastArg(arglist.parser.nostdlibOption) and
+ not arglist.getLastArg(arglist.parser.nodefaultlibsOption)):
+ # link_ssp spec is empty.
+
+ # Derived from libgcc spec.
+ if arglist.getLastArg(arglist.parser.staticOption):
+ cmd_args.append('-lgcc_static')
+ elif arglist.getLastArg(arglist.parser.staticLibgccOption):
+ cmd_args.append('-lgcc_eh')
+ cmd_args.append('-lgcc')
+ elif arglist.getLastArg(arglist.parser.m_iphoneosVersionMinOption):
+ # Derived from darwin_iphoneos_libgcc spec.
+ cmd_args.append('-lgcc_s.10.5')
+ cmd_args.append('-lgcc')
+ elif (arglist.getLastArg(arglist.parser.sharedLibgccOption) or
+ arglist.getLastArg(arglist.parser.f_exceptionsOption) or
+ arglist.getLastArg(arglist.parser.f_gnuRuntimeOption)):
+ if self.macosxVersionCmp('<', '10.5', arglist):
+ cmd_args.append('-lgcc_s.10.4')
+ else:
+ cmd_args.append('-lgcc_s.10.5')
+ cmd_args.append('-lgcc')
+ else:
+ if (self.macosxVersionCmp('<', '10.5', arglist) and
+ self.macosxVersionCmp('>=', '10.3.9', arglist)):
+ cmd_args.append('-lgcc_s.10.4')
+ else:
+ cmd_args.append('-lgcc_s.10.5')
+ cmd_args.append('-lgcc')
+
+ # Derived from lib spec.
+ if not arglist.getLastArg(arglist.parser.staticOption):
+ cmd_args.append('-lSystem')
+
+ if (not arglist.getLastArg(arglist.parser.AOption) and
+ not arglist.getLastArg(arglist.parser.nostdlibOption) and
+ not arglist.getLastArg(arglist.parser.nostartfilesOption)):
+ # endfile_spec is empty.
+ pass
+
+ arglist.addAllArgs(cmd_args, arglist.parser.TOption)
+ arglist.addAllArgs(cmd_args, arglist.parser.FOption)
+
jobs.addJob(Jobs.Command(self.kCollect2Path, cmd_args))
+ # FIXME: We need to add a dsymutil job here in some particular
+ # cases (basically whenever we have a c-family input we are
+ # compiling, I think). Find out why this is the condition, and
+ # implement. See link_command spec for more details.
+
+ def macosxVersionCmp(self, cmp, version, arglist):
+ import sys
+ print >>sys.stderr, 'FIXME: macosxVersionCmp unimplemented.'
+ return False
+
class LipoTool(Tool):
def __init__(self):
super(LipoTool, self).__init__('lipo')
Modified: cfe/trunk/tools/ccc/ccclib/Types.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Types.py?rev=62059&r1=62058&r2=62059&view=diff
==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Types.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Types.py Sun Jan 11 17:13:15 2009
@@ -14,13 +14,13 @@
self.canBeUserSpecified = canBeUserSpecified
def __repr__(self):
- return '%s(%r, %r, %r, %r, %r)' % (self.__class__.__name__,
- self.name,
- self.preprocess,
- self.onlyAssemble,
- self.onlyPrecompile,
- self.tempSuffix,
- self.canBeUserSpecified)
+ return '%s(%r, %r, %r, %r, %r, %r)' % (self.__class__.__name__,
+ self.name,
+ self.preprocess,
+ self.onlyAssemble,
+ self.onlyPrecompile,
+ self.tempSuffix,
+ self.canBeUserSpecified)
# C family source language (with and without preprocessing).
CTypeNoPP = InputType('cpp-output', tempSuffix='i',
@@ -41,18 +41,22 @@
canBeUserSpecified=True)
# C family input files to precompile.
-CHeaderNoPPType = InputType('c-header-cpp-output', onlyPrecompile=True, tempSuffix='pch')
-CHeaderType = InputType('c-header', CHeaderNoPPType, onlyPrecompile=True,
- canBeUserSpecified=True)
-ObjCHeaderNoPPType = InputType('objective-c-header-cpp-output', onlyPrecompile=True, tempSuffix='pch')
-ObjCHeaderType = InputType('objective-c-header', ObjCHeaderNoPPType, onlyPrecompile=True,
- canBeUserSpecified=True)
-CXXHeaderNoPPType = InputType('c++-header-cpp-output', onlyPrecompile=True, tempSuffix='pch')
-CXXHeaderType = InputType('c++-header', CXXHeaderNoPPType, onlyPrecompile=True,
- canBeUserSpecified=True)
-ObjCXXHeaderNoPPType = InputType('objective-c++-header-cpp-output', onlyPrecompile=True, tempSuffix='pch')
-ObjCXXHeaderType = InputType('objective-c++-header', ObjCXXHeaderNoPPType, onlyPrecompile=True,
- canBeUserSpecified=True)
+CHeaderNoPPType = InputType('c-header-cpp-output', tempSuffix='i',
+ onlyPrecompile=True)
+CHeaderType = InputType('c-header', CHeaderNoPPType,
+ onlyPrecompile=True, canBeUserSpecified=True)
+ObjCHeaderNoPPType = InputType('objective-c-header-cpp-output', tempSuffix='mi',
+ onlyPrecompile=True)
+ObjCHeaderType = InputType('objective-c-header', ObjCHeaderNoPPType,
+ onlyPrecompile=True, canBeUserSpecified=True)
+CXXHeaderNoPPType = InputType('c++-header-cpp-output', tempSuffix='ii',
+ onlyPrecompile=True)
+CXXHeaderType = InputType('c++-header', CXXHeaderNoPPType,
+ onlyPrecompile=True, canBeUserSpecified=True)
+ObjCXXHeaderNoPPType = InputType('objective-c++-header-cpp-output', tempSuffix='mii',
+ onlyPrecompile=True)
+ObjCXXHeaderType = InputType('objective-c++-header', ObjCXXHeaderNoPPType,
+ onlyPrecompile=True, canBeUserSpecified=True)
# Other languages.
AdaType = InputType('ada', canBeUserSpecified=True)
@@ -65,7 +69,7 @@
JavaType = InputType('java', canBeUserSpecified=True)
# Misc.
-PCHType = InputType('precompiled-header')
+PCHType = InputType('precompiled-header', tempSuffix='gch')
ObjectType = InputType('object', tempSuffix='o')
TreelangType = InputType('treelang', canBeUserSpecified=True)
ImageType = InputType('image', tempSuffix='out')
More information about the cfe-commits
mailing list