diff options
-rwxr-xr-x | configure.py | 23 | ||||
-rw-r--r-- | src/build-data/cc/gcc.txt | 20 | ||||
-rw-r--r-- | src/build-data/cc/sunstudio.txt | 2 |
3 files changed, 22 insertions, 23 deletions
diff --git a/configure.py b/configure.py index 007877f97..dd92df124 100755 --- a/configure.py +++ b/configure.py @@ -19,6 +19,7 @@ CPython 2.5 and earlier are not supported. On Jython target detection does not work (use --os and --cpu). """ +import collections import json import sys import os @@ -949,6 +950,10 @@ class ArchInfo(InfoObject): return macros + +MachOptFlags = collections.namedtuple('MachOptFlags', ['flags', 'submodel_prefix']) + + class CompilerInfo(InfoObject): def __init__(self, infofile): super(CompilerInfo, self).__init__(infofile) @@ -1009,16 +1014,9 @@ class CompilerInfo(InfoObject): self.warning_flags = lex.warning_flags self.mach_opt_flags = {} - while lex.mach_opt: - proc = lex.mach_opt.pop(0) - if lex.mach_opt.pop(0) != '->': - raise ConfigureError('Parsing err in %s mach_opt' % self.basename) - - flags = lex.mach_opt.pop(0) - regex = '' - if lex.mach_opt and (len(lex.mach_opt) == 1 or lex.mach_opt[1] != '->'): - regex = lex.mach_opt.pop(0) - self.mach_opt_flags[proc] = (flags, regex) + for key, value in parse_lex_dict(lex.mach_opt).items(): + parts = value.split("|") + self.mach_opt_flags[key] = MachOptFlags(parts[0], parts[1] if len(parts) == 2 else '') def isa_flags_for(self, isa, arch): if isa in self.isa_flags: @@ -1117,8 +1115,9 @@ class CompilerInfo(InfoObject): else: yield self.optimization_flags - def submodel_fixup(flags, tup): - return tup[0].replace('SUBMODEL', flags.replace(tup[1], '')) + def submodel_fixup(full_cpu, mach_opt_flags_tupel): + submodel_replacement = full_cpu.replace(mach_opt_flags_tupel.submodel_prefix, '') + return mach_opt_flags_tupel.flags.replace('SUBMODEL', submodel_replacement) if options.cpu != options.arch: if options.cpu in self.mach_opt_flags: diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt index 07c1d7d0a..5ace1931c 100644 --- a/src/build-data/cc/gcc.txt +++ b/src/build-data/cc/gcc.txt @@ -99,21 +99,21 @@ alpha-ev7 -> "-mcpu=ev67" sh4 -> "-m4 -mieee" # Default family options (SUBMODEL is substitued with the actual -# submodel name). Anything after the quotes is what should be -# *removed* from the submodel name before it's put into SUBMODEL. +# submodel name). Anything after the pipe will be removed from the +# submodel name before it's put into SUBMODEL. -alpha -> "-mcpu=SUBMODEL" alpha- +alpha -> "-mcpu=SUBMODEL|alpha-" arm32 -> "-march=SUBMODEL" arm64 -> "-march=SUBMODEL" -superh -> "-mSUBMODEL" sh -hppa -> "-march=SUBMODEL" hppa +superh -> "-mSUBMODEL|sh" +hppa -> "-march=SUBMODEL|hppa" ia64 -> "-mtune=SUBMODEL" m68k -> "-mSUBMODEL" -mips32 -> "-mips1 -mcpu=SUBMODEL" mips32- -mips64 -> "-mips3 -mcpu=SUBMODEL" mips64- -ppc32 -> "-mcpu=SUBMODEL" ppc -ppc64 -> "-mcpu=SUBMODEL" ppc -sparc32 -> "-mcpu=SUBMODEL -Wa,-xarch=v8plus" sparc32- +mips32 -> "-mips1 -mcpu=SUBMODEL|mips32-" +mips64 -> "-mips3 -mcpu=SUBMODEL|mips64-" +ppc32 -> "-mcpu=SUBMODEL|ppc" +ppc64 -> "-mcpu=SUBMODEL|ppc" +sparc32 -> "-mcpu=SUBMODEL -Wa,-xarch=v8plus|sparc32-" sparc64 -> "-mcpu=v9 -mtune=SUBMODEL" x86_32 -> "-march=SUBMODEL" x86_64 -> "-march=SUBMODEL" diff --git a/src/build-data/cc/sunstudio.txt b/src/build-data/cc/sunstudio.txt index 934b42099..c2fc97a01 100644 --- a/src/build-data/cc/sunstudio.txt +++ b/src/build-data/cc/sunstudio.txt @@ -43,7 +43,7 @@ ultrasparc3 -> "-xchip=ultra3" niagra1 -> "-xchip=ultraT1" niagra2 -> "-xchip=ultraT2" -sparc32 -> "-xchip=ultra -xarch=SUBMODEL" sparc32- +sparc32 -> "-xchip=ultra -xarch=SUBMODEL|sparc32-" sparc64 -> "-xchip=generic" </mach_opt> |