self.client_nameOption = self.addOption(JoinedOrSeparateOption('-client_name'))
self.compatibility_versionOption = self.addOption(JoinedOrSeparateOption('-compatibility_version'))
self.current_versionOption = self.addOption(JoinedOrSeparateOption('-current_version'))
+ self.dependencyFileOption = self.addOption(SeparateOption('-dependency-file'))
self.dylinkerOption = self.addOption(FlagOption('-dylinker'))
self.dylinker_install_nameOption = self.addOption(JoinedOrSeparateOption('-dylinker_install_name'))
self.addOption(JoinedOrSeparateOption('-exported_symbols_list'))
self.addOption(JoinedOption('-d', group=self.dGroup))
self.gGroup = OptionGroup('-g')
+ self.gfullOption = self.addOption(JoinedOption('-gfull', self.gGroup))
+ self.gusedOption = self.addOption(JoinedOption('-gused', self.gGroup))
self.gstabsOption = self.addOption(JoinedOption('-gstabs', self.gGroup))
self.g0Option = self.addOption(JoinedOption('-g0', self.gGroup))
self.g3Option = self.addOption(JoinedOption('-g3', self.gGroup))
self.f_appleKextOption = self.addOption(FlagOption('-fapple-kext', self.fGroup))
self.f_constantCfstringsOption = self.addOption(FlagOption('-fconstant-cfstrings', self.fGroup))
self.f_createProfileOption = self.addOption(FlagOption('-fcreate-profile', self.fGroup))
+ self.f_eliminateUnusedDebugSymbolsOption = self.addOption(FlagOption('-feliminate-unused-debug-symbols', self.fGroup))
self.f_exceptionsOption = self.addOption(FlagOption('-fexceptions', self.fGroup))
self.f_gnuRuntimeOption = self.addOption(FlagOption('-fgnu-runtime', self.fGroup))
self.f_gnuRuntimeOption = self.addOption(FlagOption('-fgnu-runtime', self.fGroup))
+ self.f_indirectVirtualCallsOption = self.addOption(FlagOption('-findirect-virtual-calls', self.fGroup))
self.f_laxVectorConversionsOption = self.addOption(FlagOption('-flax-vector-conversions', self.fGroup))
self.f_msExtensionsOption = self.addOption(FlagOption('-fms-extensions', self.fGroup))
self.f_mudflapOption = self.addOption(FlagOption('-fmudflap', self.fGroup))
self.f_pieOption = self.addOption(FlagOption('-fpie', self.fGroup))
self.f_profileArcsOption = self.addOption(FlagOption('-fprofile-arcs', self.fGroup))
self.f_profileGenerateOption = self.addOption(FlagOption('-fprofile-generate', self.fGroup))
+ self.f_terminatedVtablesOption = self.addOption(FlagOption('-fterminated-vtables', self.fGroup))
self.f_traditionalOption = self.addOption(FlagOption('-ftraditional', self.fGroup))
self.f_writableStringsOption = self.addOption(FlagOption('-fwritable-strings', self.fGroup))
self.addOption(JoinedOption('-f', self.fGroup))
if not arch:
return args
+ # FIXME: We really want to get out of the tool chain level
+ # argument translation business, as it makes the driver
+ # functionality much more opaque. For now, we follow gcc
+ # closely solely for the purpose of easily achieving feature
+ # parity & testability. Once we have something that works, we
+ # should reevaluate each translation and try to push it down
+ # into tool specific logic.
+
al = Arguments.DerivedArgList(args)
if not args.getLastArg(args.parser.m_macosxVersionMinOption):
al.append(al.makeJoinedArg(self.getMacosxVersionMin(),
args.parser.m_macosxVersionMinOption))
for arg in args:
- if arg.opt is args.parser.f_constantCfstringsOption:
+ # Sob. These is strictly gcc compatible for the time
+ # being. Apple gcc translates options twice, which means
+ # that self-expanding options add duplicates.
+ if arg.opt is args.parser.m_kernelOption:
+ al.append(arg)
+ al.append(al.makeFlagArg(args.parser.staticOption))
+ al.append(al.makeFlagArg(args.parser.staticOption))
+ elif arg.opt is args.parser.dependencyFileOption:
+ al.append(al.makeSeparateArg(args.getValue(arg),
+ args.parser.MFOption))
+ elif arg.opt is args.parser.gfullOption:
+ al.append(al.makeFlagArg(args.parser.gOption))
+ al.append(al.makeFlagArg(args.parser.f_noEliminateUnusedDebugSymbolsOption))
+ elif arg.opt is args.parser.gusedOption:
+ al.append(al.makeFlagArg(args.parser.gOption))
+ al.append(al.makeFlagArg(args.parser.f_eliminateUnusedDebugSymbolsOption))
+ elif arg.opt is args.parser.f_appleKextOption:
+ al.append(arg)
+ al.append(al.makeFlagArg(args.parser.staticOption))
+ al.append(al.makeFlagArg(args.parser.staticOption))
+ elif arg.opt is args.parser.f_terminatedVtablesOption:
+ al.append(al.makeFlagArg(args.parser.f_appleKextOption))
+ al.append(al.makeFlagArg(args.parser.staticOption))
+ elif arg.opt is args.parser.f_indirectVirtualCallsOption:
+ al.append(al.makeFlagArg(args.parser.f_appleKextOption))
+ al.append(al.makeFlagArg(args.parser.staticOption))
+ elif arg.opt is args.parser.f_constantCfstringsOption:
al.append(al.makeFlagArg(args.parser.m_constantCfstringsOption))
elif arg.opt is args.parser.f_noConstantCfstringsOption:
al.append(al.makeFlagArg(args.parser.m_noConstantCfstringsOption))
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