aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-01-07 11:56:58 -0500
committerJack Lloyd <[email protected]>2018-01-08 16:31:58 -0500
commit513d19781a558fbd1ff03c7152f61b5e7f294297 (patch)
tree7e1980980e7fa1eb5a384714c7edb9dbe09ce129
parentda70e06c13c57245d4e79122e2ccefe08ccfa20d (diff)
Remove CPU specific optimization flags
These are best left to the user to set via CXXFLAGS or --cc-abi-flags Add override if arch ends in in {eb, el, be, le} to set the endian. Avoids an extra file for ppc64le.
-rwxr-xr-xconfigure.py121
-rw-r--r--src/build-data/arch/alpha.txt22
-rw-r--r--src/build-data/arch/arm32.txt33
-rw-r--r--src/build-data/arch/arm64.txt6
-rw-r--r--src/build-data/arch/hppa.txt6
-rw-r--r--src/build-data/arch/ia64.txt10
-rw-r--r--src/build-data/arch/m68k.txt7
-rw-r--r--src/build-data/arch/mips32.txt18
-rw-r--r--src/build-data/arch/mips64.txt19
-rw-r--r--src/build-data/arch/ppc32.txt17
-rw-r--r--src/build-data/arch/ppc64.txt20
-rw-r--r--src/build-data/arch/ppc64le.txt22
-rw-r--r--src/build-data/arch/s390.txt4
-rw-r--r--src/build-data/arch/s390x.txt4
-rw-r--r--src/build-data/arch/sparc32.txt24
-rw-r--r--src/build-data/arch/sparc64.txt12
-rw-r--r--src/build-data/arch/superh.txt5
-rw-r--r--src/build-data/arch/x86_32.txt49
-rw-r--r--src/build-data/arch/x86_64.txt28
-rw-r--r--src/build-data/buildh.in2
-rw-r--r--src/build-data/cc/clang.txt12
-rw-r--r--src/build-data/cc/ekopath.txt11
-rw-r--r--src/build-data/cc/gcc.txt50
-rw-r--r--src/build-data/cc/icc.txt11
-rw-r--r--src/build-data/cc/pgi.txt8
-rw-r--r--src/build-data/cc/sunstudio.txt24
-rw-r--r--src/build-data/cc/xlc.txt5
-rwxr-xr-xsrc/scripts/ci_build.py4
28 files changed, 54 insertions, 500 deletions
diff --git a/configure.py b/configure.py
index de15d7e72..41bfb6d51 100755
--- a/configure.py
+++ b/configure.py
@@ -294,7 +294,7 @@ def process_command_line(args): # pylint: disable=too-many-locals
target_group = optparse.OptionGroup(parser, 'Target options')
- target_group.add_option('--cpu', help='set the target CPU type/model')
+ target_group.add_option('--cpu', help='set the target CPU architecture')
target_group.add_option('--os', help='set the target operating system')
@@ -961,8 +961,8 @@ class ArchInfo(InfoObject):
super(ArchInfo, self).__init__(infofile)
lex = lex_me_harder(
infofile,
- ['aliases', 'submodels', 'isa_extensions'],
- ['submodel_aliases'],
+ ['aliases', 'isa_extensions'],
+ [],
{
'endian': None,
'family': None,
@@ -973,8 +973,6 @@ class ArchInfo(InfoObject):
self.endian = lex.endian
self.family = lex.family
self.isa_extensions = lex.isa_extensions
- self.submodels = lex.submodels
- self.submodel_aliases = lex.submodel_aliases
self.wordsize = int(lex.wordsize)
alphanumeric = re.compile('^[a-z0-9]+$')
@@ -982,16 +980,6 @@ class ArchInfo(InfoObject):
if alphanumeric.match(isa) is None:
logging.error('Invalid name for ISA extension "%s"', isa)
- def all_submodels(self):
- """
- Return a list of all submodels for this arch, ordered longest
- to shortest
- """
-
- return sorted([(k, k) for k in self.submodels] +
- [k for k in self.submodel_aliases.items()],
- key=lambda k: len(k[0]), reverse=True)
-
def supported_isa_extensions(self, cc, options):
isas = []
@@ -1003,16 +991,13 @@ class ArchInfo(InfoObject):
return sorted(isas)
-MachOptFlags = collections.namedtuple('MachOptFlags', ['flags', 'submodel_prefix'])
-
-
class CompilerInfo(InfoObject): # pylint: disable=too-many-instance-attributes
def __init__(self, infofile):
super(CompilerInfo, self).__init__(infofile)
lex = lex_me_harder(
infofile,
- ['mach_opt'],
- ['so_link_commands', 'binary_link_commands', 'mach_abi_linking', 'isa_flags'],
+ [],
+ ['cpu_flags', 'so_link_commands', 'binary_link_commands', 'mach_abi_linking', 'isa_flags'],
{
'binary_name': None,
'linker_name': None,
@@ -1051,6 +1036,7 @@ class CompilerInfo(InfoObject): # pylint: disable=too-many-instance-attributes
self.ar_output_to = lex.ar_output_to
self.binary_link_commands = lex.binary_link_commands
self.binary_name = lex.binary_name
+ self.cpu_flags = lex.cpu_flags
self.compile_flags = lex.compile_flags
self.coverage_flags = lex.coverage_flags
self.debug_info_flags = lex.debug_info_flags
@@ -1073,11 +1059,6 @@ class CompilerInfo(InfoObject): # pylint: disable=too-many-instance-attributes
self.visibility_build_flags = lex.visibility_build_flags
self.warning_flags = lex.warning_flags
- self.mach_opt_flags = {}
- 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:
return self.isa_flags[isa]
@@ -1147,7 +1128,6 @@ class CompilerInfo(InfoObject): # pylint: disable=too-many-instance-attributes
yield all_except
yield options.os
- yield options.arch
yield options.cpu
abi_link = list()
@@ -1212,20 +1192,8 @@ class CompilerInfo(InfoObject): # pylint: disable=too-many-instance-attributes
else:
yield self.optimization_flags
- 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:
- yield submodel_fixup(options.cpu, self.mach_opt_flags[options.cpu])
- elif options.arch in self.mach_opt_flags:
- yield submodel_fixup(options.cpu, self.mach_opt_flags[options.arch])
-
- all_arch = 'all_%s' % (options.arch)
-
- if all_arch in self.mach_opt_flags:
- yield self.mach_opt_flags[all_arch][0]
+ if options.arch in self.cpu_flags:
+ yield self.cpu_flags[options.arch]
return (' '.join(gen_flags(with_debug_info, enable_optimizations))).strip()
@@ -1373,21 +1341,7 @@ def canon_processor(archinfo, proc):
# First, try to search for an exact match
for ainfo in archinfo.values():
if ainfo.basename == proc or proc in ainfo.aliases:
- return (ainfo.basename, ainfo.basename)
-
- for (match, submodel) in ainfo.all_submodels():
- if proc == submodel or proc == match:
- return (ainfo.basename, submodel)
-
- logging.debug('Could not find an exact match for CPU "%s"' % (proc))
-
- # Now, try searching via regex match
- for ainfo in archinfo.values():
- for (match, submodel) in ainfo.all_submodels():
- if re.search(match, proc) != None:
- logging.debug('Possible match "%s" with "%s" (%s)' % (
- proc, match, submodel))
- return (ainfo.basename, submodel)
+ return ainfo.basename
return None
@@ -1401,21 +1355,8 @@ def system_cpu_info():
if platform.processor() != '':
cpu_info.append(platform.processor())
- try:
- with open('/proc/cpuinfo') as f:
- for line in f.readlines():
- colon = line.find(':')
- if colon > 1:
- key = line[0:colon].strip()
- val = ' '.join([s.strip() for s in line[colon+1:].split(' ') if s != ''])
-
- # Different Linux arch use different names for this field in cpuinfo
- if key in ["model name", "cpu model", "Processor"]:
- logging.info('Detected CPU model "%s" in /proc/cpuinfo' % (val))
- cpu_info.append(val)
- break
- except IOError:
- pass
+ if 'uname' in os.__dict__:
+ cpu_info.append(os.uname()[4])
return cpu_info
@@ -1764,6 +1705,17 @@ def create_template_vars(source_paths, build_config, options, modules, cc, arch,
return osinfo.ar_command
+ def choose_endian(arch_info, options):
+ if options.with_endian != None:
+ return options.with_endian
+
+ if options.cpu.endswith('eb') or options.cpu.endswith('be'):
+ return 'big'
+ elif options.cpu.endswith('el') or options.cpu.endswith('le'):
+ return 'little'
+
+ return arch_info.endian
+
build_dir = options.with_build_dir or os.path.curdir
program_suffix = options.program_suffix or osinfo.program_suffix
@@ -1842,8 +1794,7 @@ def create_template_vars(source_paths, build_config, options, modules, cc, arch,
'os': options.os,
'arch': options.arch,
'cpu_family': arch.family,
- 'submodel': options.cpu,
- 'endian': options.with_endian or arch.endian,
+ 'endian': choose_endian(arch, options),
'cpu_is_64bit': arch.wordsize == 64,
'bakefile_arch': 'x86' if options.arch == 'x86_32' else 'x86_64',
@@ -2676,9 +2627,8 @@ def set_defaults_for_unset_options(options, info_arch, info_cc): # pylint: disab
logging.info('Guessing to use compiler %s (use --cc to set)' % (options.compiler))
if options.cpu is None:
- (options.arch, options.cpu) = guess_processor(info_arch)
- logging.info('Guessing target processor is a %s/%s (use --cpu to set)' % (
- options.arch, options.cpu))
+ options.cpu = options.arch = guess_processor(info_arch)
+ logging.info('Guessing target processor is a %s (use --cpu to set)' % (options.arch))
if options.with_documentation is True:
if options.with_sphinx is None and have_program('sphinx-build'):
@@ -2701,15 +2651,13 @@ def canonicalize_options(options, info_os, info_arch):
options.os = find_canonical_os_name(options.os)
# canonical ARCH/CPU
- cpu_from_user = options.cpu
- results = canon_processor(info_arch, options.cpu)
- if results != None:
- (options.arch, options.cpu) = results
- logging.info('Canonicalized CPU target %s to %s/%s' % (
- cpu_from_user, options.arch, options.cpu))
- else:
+ options.arch = canon_processor(info_arch, options.cpu)
+ if options.arch is None:
raise UserError('Unknown or unidentifiable processor "%s"' % (options.cpu))
+ if options.cpu != options.arch:
+ logging.info('Canonicalized CPU target %s to %s', options.cpu, options.arch)
+
shared_libs_supported = options.os in info_os and info_os[options.os].building_shared_supported()
if not shared_libs_supported:
@@ -2992,10 +2940,7 @@ def main(argv):
policy.cross_check(info_modules)
logging.debug('Known CPU names: ' + ' '.join(
- sorted(flatten([[ainfo.basename] + \
- ainfo.aliases + \
- [x for (x, _) in ainfo.all_submodels()]
- for ainfo in info_arch.values()]))))
+ sorted(flatten([[ainfo.basename] + ainfo.aliases for ainfo in info_arch.values()]))))
set_defaults_for_unset_options(options, info_arch, info_cc)
canonicalize_options(options, info_os, info_arch)
@@ -3007,8 +2952,8 @@ def main(argv):
module_policy = info_module_policies[options.module_policy] if options.module_policy else None
cc_min_version = options.cc_min_version or calculate_cc_min_version(options, cc, source_paths)
- logging.info('Target is %s:%s-%s-%s-%s' % (
- options.compiler, cc_min_version, options.os, options.arch, options.cpu))
+ logging.info('Target is %s:%s-%s-%s' % (
+ options.compiler, cc_min_version, options.os, options.arch))
main_action_configure_build(info_modules, source_paths, options,
cc, cc_min_version, arch, osinfo, module_policy)
diff --git a/src/build-data/arch/alpha.txt b/src/build-data/arch/alpha.txt
index 233691b9e..c251cbee9 100644
--- a/src/build-data/arch/alpha.txt
+++ b/src/build-data/arch/alpha.txt
@@ -5,25 +5,3 @@ wordsize 64
axp
alphaaxp
</aliases>
-
-<submodels>
-alpha-ev4
-alpha-ev5
-alpha-ev56
-alpha-pca56
-alpha-ev6
-alpha-ev67
-alpha-ev68
-alpha-ev7
-</submodels>
-
-<submodel_aliases>
-alphaev4 -> alpha-ev4
-alphaev5 -> alpha-ev5
-alphaev56 -> alpha-ev56
-alphapca56 -> alpha-pca56
-alphaev6 -> alpha-ev6
-alphaev67 -> alpha-ev67
-alphaev68 -> alpha-ev68
-alphaev7 -> alpha-ev7
-</submodel_aliases>
diff --git a/src/build-data/arch/arm32.txt b/src/build-data/arch/arm32.txt
index e8657473d..d8a0780ec 100644
--- a/src/build-data/arch/arm32.txt
+++ b/src/build-data/arch/arm32.txt
@@ -3,41 +3,14 @@ family arm
<aliases>
arm
+armeb
armel # For Debian
armhf # For Debian
evbarm # For NetBSD
-</aliases>
-<submodels>
-armv2
-armv2a
-armv3
-armv3m
-armv4
-armv5
-armv5e
-armv5te
-armv6
-armv6j
-armv6t2
-armv6z
-armv6zk
-armv6-m
armv7
-armv7-a
-armv7-r
-armv7-m
-iwmmxt
-iwmmxt2
-ep9312
-</submodels>
-
-<submodel_aliases>
-strongarm -> armv4
-xscale -> armv5te
-cortex-a8 -> armv7-a
-cortex-a9 -> armv7-a
-</submodel_aliases>
+armv7l
+</aliases>
<isa_extensions>
neon
diff --git a/src/build-data/arch/arm64.txt b/src/build-data/arch/arm64.txt
index f556c864e..1685681bf 100644
--- a/src/build-data/arch/arm64.txt
+++ b/src/build-data/arch/arm64.txt
@@ -5,11 +5,9 @@ family arm
<aliases>
aarch64
-</aliases>
-
-<submodels>
+armv8
armv8-a
-</submodels>
+</aliases>
<isa_extensions>
neon
diff --git a/src/build-data/arch/hppa.txt b/src/build-data/arch/hppa.txt
index 0f7d90c68..0144cf4eb 100644
--- a/src/build-data/arch/hppa.txt
+++ b/src/build-data/arch/hppa.txt
@@ -5,9 +5,3 @@ pa-risc
hp-parisc
hp-pa-risc
</aliases>
-
-<submodels>
-hppa1.0
-hppa1.1
-hppa2.0
-</submodels>
diff --git a/src/build-data/arch/ia64.txt b/src/build-data/arch/ia64.txt
index 46b40eff8..8a448ff88 100644
--- a/src/build-data/arch/ia64.txt
+++ b/src/build-data/arch/ia64.txt
@@ -4,13 +4,3 @@ wordsize 64
itanium
itanic
</aliases>
-
-<submodels>
-merced
-mckinley
-montvale
-</submodels>
-
-<submodel_aliases>
-itanium2 -> mckinley
-</submodel_aliases>
diff --git a/src/build-data/arch/m68k.txt b/src/build-data/arch/m68k.txt
index 26dac5331..f171f4534 100644
--- a/src/build-data/arch/m68k.txt
+++ b/src/build-data/arch/m68k.txt
@@ -4,10 +4,3 @@ endian big
680x0
68k
</aliases>
-
-<submodels>
-68020
-68030
-68040
-68060
-</submodels>
diff --git a/src/build-data/arch/mips32.txt b/src/build-data/arch/mips32.txt
index b69abdacb..d9849e848 100644
--- a/src/build-data/arch/mips32.txt
+++ b/src/build-data/arch/mips32.txt
@@ -1,18 +1,6 @@
<aliases>
mips
-mipsel # For Debian
+mipsbe # RedHat
+mipsle # RedHat
+mipsel # Debian
</aliases>
-
-<submodels>
-r3000
-r6000
-</submodels>
-
-<submodel_aliases>
-r3k -> r3000
-r6k -> r6000
-
-# These are for RPM
-mipsbe -> r3000
-mipsle -> r3000
-</submodel_aliases>
diff --git a/src/build-data/arch/mips64.txt b/src/build-data/arch/mips64.txt
index 9a56a0334..6d67128ed 100644
--- a/src/build-data/arch/mips64.txt
+++ b/src/build-data/arch/mips64.txt
@@ -3,22 +3,3 @@ wordsize 64
<aliases>
mips64el
</aliases>
-
-<submodels>
-r4000
-r4100
-r4300
-r4400
-r4600
-r4560
-r5000
-r8000
-r10000
-</submodels>
-
-<submodel_aliases>
-r4k -> r4000
-r5k -> r5000
-r8k -> r8000
-r10k -> r10000
-</submodel_aliases>
diff --git a/src/build-data/arch/ppc32.txt b/src/build-data/arch/ppc32.txt
index 7d0ce5e24..da8b7654a 100644
--- a/src/build-data/arch/ppc32.txt
+++ b/src/build-data/arch/ppc32.txt
@@ -7,23 +7,6 @@ powerpc
ppc
</aliases>
-<submodels>
-ppc601
-ppc603
-ppc604
-ppc740
-ppc750
-ppc7400
-ppc7450
-e500v2
-</submodels>
-
-<submodel_aliases>
-g3 -> ppc740
-g4 -> ppc7450
-powerpcspe -> e500v2 # for Debian
-</submodel_aliases>
-
<isa_extensions>
altivec
</isa_extensions>
diff --git a/src/build-data/arch/ppc64.txt b/src/build-data/arch/ppc64.txt
index dac8379f0..f97334461 100644
--- a/src/build-data/arch/ppc64.txt
+++ b/src/build-data/arch/ppc64.txt
@@ -5,27 +5,9 @@ wordsize 64
<aliases>
powerpc64
+ppc64le
</aliases>
-<submodel_aliases>
-g5 -> ppc970
-</submodel_aliases>
-
-<submodels>
-ppc970
-power3
-power4
-power5
-power6
-power7
-power8
-cellppu
-</submodels>
-
-<submodel_aliases>
-cellbroadbandengine -> cellppu
-</submodel_aliases>
-
<isa_extensions>
altivec
</isa_extensions>
diff --git a/src/build-data/arch/ppc64le.txt b/src/build-data/arch/ppc64le.txt
deleted file mode 100644
index 533a4b0e8..000000000
--- a/src/build-data/arch/ppc64le.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-endian little
-
-family ppc
-wordsize 64
-
-<aliases>
-powerpc64
-</aliases>
-
-<submodel_aliases>
-</submodel_aliases>
-
-<submodels>
-power8
-</submodels>
-
-<submodel_aliases>
-</submodel_aliases>
-
-<isa_extensions>
-altivec
-</isa_extensions>
diff --git a/src/build-data/arch/s390.txt b/src/build-data/arch/s390.txt
index a5c35637f..64a1abdd3 100644
--- a/src/build-data/arch/s390.txt
+++ b/src/build-data/arch/s390.txt
@@ -1,5 +1 @@
endian big
-
-<submodels>
-s390
-</submodels>
diff --git a/src/build-data/arch/s390x.txt b/src/build-data/arch/s390x.txt
index 6ed2ec079..eb6a87d69 100644
--- a/src/build-data/arch/s390x.txt
+++ b/src/build-data/arch/s390x.txt
@@ -1,6 +1,2 @@
endian big
wordsize 64
-
-<submodels>
-s390x
-</submodels>
diff --git a/src/build-data/arch/sparc32.txt b/src/build-data/arch/sparc32.txt
index 69f3479aa..0680fdfc3 100644
--- a/src/build-data/arch/sparc32.txt
+++ b/src/build-data/arch/sparc32.txt
@@ -5,27 +5,3 @@ family sparc
<aliases>
sparc
</aliases>
-
-<submodels>
-sparc32-v7
-sparc32-v8
-sparc32-v9
-</submodels>
-
-<submodel_aliases>
-cypress -> sparc32-v7
-supersparc -> sparc32-v8
-hypersparc -> sparc32-v8
-microsparc -> sparc32-v8
-sparclite -> sparc32-v8
-
-sparcv7 -> sparc32-v7
-sparcv8 -> sparc32-v8
-sparcv9 -> sparc32-v9
-
-sparc-v7 -> sparc32-v7
-sparc-v8 -> sparc32-v8
-sparc-v9 -> sparc32-v9
-
-sun4u -> sparc32-v9
-</submodel_aliases>
diff --git a/src/build-data/arch/sparc64.txt b/src/build-data/arch/sparc64.txt
index 36fc4fccf..56130f26c 100644
--- a/src/build-data/arch/sparc64.txt
+++ b/src/build-data/arch/sparc64.txt
@@ -1,14 +1,2 @@
family sparc
wordsize 64
-
-<submodels>
-ultrasparc
-ultrasparc3
-niagra
-niagra2
-</submodels>
-
-<submodel_aliases>
-# Functionally the same for optimization purposes
-ultrasparc2 -> ultrasparc
-</submodel_aliases>
diff --git a/src/build-data/arch/superh.txt b/src/build-data/arch/superh.txt
index c7dc09861..e69de29bb 100644
--- a/src/build-data/arch/superh.txt
+++ b/src/build-data/arch/superh.txt
@@ -1,5 +0,0 @@
-<submodels>
-sh2
-sh3
-sh4
-</submodels>
diff --git a/src/build-data/arch/x86_32.txt b/src/build-data/arch/x86_32.txt
index 0aa9b6683..6cbc5d0b3 100644
--- a/src/build-data/arch/x86_32.txt
+++ b/src/build-data/arch/x86_32.txt
@@ -10,55 +10,10 @@ ix86
i86pc # for Solaris
x86pc # for QNX
bepc # for Haiku
-</aliases>
-<submodels>
-i386
-i486
-i586
i686
-pentium2
-pentium3
-pentium4
-pentium-m
-prescott
-k6
-athlon
-atom32
-</submodels>
-
-<submodel_aliases>
-pentium -> i586
-pentiumpro -> i686
-pentium_pro -> i686
-pentium2 -> pentium2
-pentiumii -> pentium2
-pentium3 -> pentium3
-pentiumiii -> pentium3
-
-x86family5 -> i586
-x86family6 -> i686
-
-pentiumm -> pentium-m
-intelpentiumm -> pentium-m
-
-intelpentium4 -> pentium4
-
-duron -> athlon
-athlon-xp -> athlon
-k7 -> athlon
-
-p2 -> i686
-p3 -> i686
-p4 -> pentium4
-
-intelcput2250 -> prescott
-intelcput2300 -> prescott
-intelcput2400 -> prescott
-intelcput2500 -> prescott
-intelcput2600 -> prescott
-intelcput2700 -> prescott
-</submodel_aliases>
+i386
+</aliases>
<isa_extensions>
aesni
diff --git a/src/build-data/arch/x86_64.txt b/src/build-data/arch/x86_64.txt
index 1757e4f42..729363e6f 100644
--- a/src/build-data/arch/x86_64.txt
+++ b/src/build-data/arch/x86_64.txt
@@ -11,34 +11,6 @@ x64
x86_amd64
</aliases>
-<submodels>
-k8
-barcelona
-atom
-nocona
-core2 # conroe
-nehalem
-westmere
-sandybridge
-ivybridge
-haswell
-broadwell
-skylake
-znver1
-</submodels>
-
-<submodel_aliases>
-core2duo -> core2
-intelcore2 -> core2
-intelcore2duo -> core2
-
-sledgehammer -> k8
-opteron -> k8
-amdopteron -> k8
-athlon64 -> k8
-zen -> znver1
-</submodel_aliases>
-
<isa_extensions>
aesni
avx2
diff --git a/src/build-data/buildh.in b/src/build-data/buildh.in
index d4972af15..10b03ca70 100644
--- a/src/build-data/buildh.in
+++ b/src/build-data/buildh.in
@@ -7,7 +7,7 @@
*
* Target
* - Compiler: %{cxx} %{cxx_abi_flags} %{cc_lang_flags} %{cc_compile_flags}
-* - Arch: %{submodel}/%{arch}
+* - Arch: %{arch}
* - OS: %{os}
*/
diff --git a/src/build-data/cc/clang.txt b/src/build-data/cc/clang.txt
index c4bfe1961..2e02cb7b5 100644
--- a/src/build-data/cc/clang.txt
+++ b/src/build-data/cc/clang.txt
@@ -51,15 +51,9 @@ arm32:neon -> "-mfpu=neon"
arm64:neon -> ""
</isa_flags>
-<mach_opt>
-all_llvm -> "-emit-llvm -fno-use-cxa-atexit"
-
-x86_32 -> "-march=SUBMODEL"
-x86_64 -> "-march=SUBMODEL"
-nehalem -> "-march=corei7"
-sandybridge -> "-march=corei7-avx"
-ivybridge -> "-march=core-avx-i"
-</mach_opt>
+<cpu_flags>
+llvm -> "-emit-llvm -fno-use-cxa-atexit"
+</cpu_flags>
<mach_abi_linking>
all!haiku -> "-pthread"
diff --git a/src/build-data/cc/ekopath.txt b/src/build-data/cc/ekopath.txt
index dedbaaf61..490396ac4 100644
--- a/src/build-data/cc/ekopath.txt
+++ b/src/build-data/cc/ekopath.txt
@@ -15,14 +15,3 @@ shared_flags "-fPIC"
<so_link_commands>
default -> "$(CXX) -shared -fPIC -Wl,-soname,{soname_abi}"
</so_link_commands>
-
-<mach_opt>
-athlon -> "-mcpu=athlon"
-pentium4 -> "-mcpu=pentium4"
-
-k8 -> "-mcpu=opteron"
-core2 -> "-mcpu=core"
-
-x86_32 -> "-mcpu=anyx86"
-x86_64 -> "-mcpu=athlon64"
-</mach_opt>
diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt
index 553e71295..236b588a5 100644
--- a/src/build-data/cc/gcc.txt
+++ b/src/build-data/cc/gcc.txt
@@ -63,52 +63,10 @@ arm32:neon -> "-mfpu=neon"
arm64:neon -> ""
</isa_flags>
-<mach_opt>
-# Avoid using -march=i[3456]86, instead tune for generic
-i386 -> "-mtune=generic"
-i486 -> "-mtune=generic"
-i586 -> "-mtune=generic"
-i686 -> "-mtune=generic"
-
-# Translate to GCC-speak
-nehalem -> "-march=corei7"
-sandybridge -> "-march=corei7-avx"
-ivybridge -> "-march=core-avx-i"
-
-ppc601 -> "-mpowerpc -mcpu=601"
-cellppu -> "-mcpu=cell"
-e500v2 -> "-mcpu=8548"
-
-# No scheduler in GCC for anything after EV67
-alpha-ev68 -> "-mcpu=ev67"
-alpha-ev7 -> "-mcpu=ev67"
-
-# The patch from Debian bug 594159 has this, don't know why though...
-sh4 -> "-m4 -mieee"
-
-# Default family options (SUBMODEL is substitued with the actual
-# submodel name). Anything after the pipe will be removed from the
-# submodel name before it's put into SUBMODEL.
-
-alpha -> "-mcpu=SUBMODEL|alpha-"
-arm32 -> "-march=SUBMODEL"
-arm64 -> "-march=SUBMODEL"
-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-"
-sparc64 -> "-mcpu=v9 -mtune=SUBMODEL"
-x86_32 -> "-march=SUBMODEL"
-x86_64 -> "-march=SUBMODEL"
-
-all_x86_32 -> "-momit-leaf-frame-pointer"
-all_x86_64 -> "-momit-leaf-frame-pointer"
-</mach_opt>
+<cpu_flags>
+x86_32 -> "-momit-leaf-frame-pointer"
+x86_64 -> "-momit-leaf-frame-pointer"
+</cpu_flags>
# Flags set here are included at compile and link time
<mach_abi_linking>
diff --git a/src/build-data/cc/icc.txt b/src/build-data/cc/icc.txt
index 10f9a6116..c8a1aa3dc 100644
--- a/src/build-data/cc/icc.txt
+++ b/src/build-data/cc/icc.txt
@@ -19,17 +19,6 @@ aesni -> "-march=corei7"
rdrand -> "-march=core-avx-i"
</isa_flags>
-<mach_opt>
-pentium3 -> "-march=pentium3"
-pentium4 -> "-march=pentium4"
-pentium-m -> "-march=pentium-m"
-core2 -> "-march=core2"
-
-nehalem -> "-march=corei7"
-sandybridge -> "-march=corei7-avx"
-ivybridge -> "-march=core-avx-i"
-</mach_opt>
-
<so_link_commands>
default -> "$(CXX) -fPIC -shared -Wl,-soname,{soname_abi}"
</so_link_commands>
diff --git a/src/build-data/cc/pgi.txt b/src/build-data/cc/pgi.txt
index 213a69d27..5ec658628 100644
--- a/src/build-data/cc/pgi.txt
+++ b/src/build-data/cc/pgi.txt
@@ -9,11 +9,3 @@ shared_flags "-fPIC"
linux -> "$(CXX) -shared -fPIC -Wl,-soname,{soname_abi}"
solaris -> "$(CXX) -G -fPIC -Wl,-h,{soname_abi}"
</so_link_commands>
-
-<mach_opt>
-i586 -> "-tp p5"
-i686 -> "-tp p6"
-athlon -> "-tp k7"
-pentium4 -> "-tp p6"
-x86_32 -> "-tp px"
-</mach_opt>
diff --git a/src/build-data/cc/sunstudio.txt b/src/build-data/cc/sunstudio.txt
index e983bf701..c5dac65de 100644
--- a/src/build-data/cc/sunstudio.txt
+++ b/src/build-data/cc/sunstudio.txt
@@ -15,30 +15,6 @@ ar_options "-xar -o"
default -> "$(CXX) -G -h{soname_abi}"
</so_link_commands>
-<mach_opt>
-i386 -> "-xtarget=486"
-i486 -> "-xtarget=486"
-i586 -> "-xtarget=pentium"
-k6 -> "-xtarget=pentium"
-i686 -> "-xtarget=pentium_pro"
-
-pentium3 -> "-xtarget=pentium3"
-pentium4 -> "-xtarget=pentium4"
-
-core2 -> "-xtarget=core2"
-opteron -> "-xtarget=opteron"
-nehalem -> "-xtarget=nehalem"
-
-sparc32-v9 -> "-xchip=ultra -xarch=v8"
-
-ultrasparc3 -> "-xchip=ultra3"
-niagra1 -> "-xchip=ultraT1"
-niagra2 -> "-xchip=ultraT2"
-
-sparc32 -> "-xchip=ultra -xarch=SUBMODEL|sparc32-"
-sparc64 -> "-xchip=generic"
-</mach_opt>
-
<mach_abi_linking>
# Needed on some Linux distros
linux -> "-library=stlport4"
diff --git a/src/build-data/cc/xlc.txt b/src/build-data/cc/xlc.txt
index c28fdb1a0..0ab45242a 100644
--- a/src/build-data/cc/xlc.txt
+++ b/src/build-data/cc/xlc.txt
@@ -6,11 +6,6 @@ optimization_flags "-O2"
lang_flags "-std=c++11"
-<mach_opt>
-power8 -> "-qarch=pwr8"
-power9 -> "-qarch=pwr9"
-</mach_opt>
-
<isa_flags>
altivec -> "-qaltivec"
</isa_flags>
diff --git a/src/scripts/ci_build.py b/src/scripts/ci_build.py
index b0843bf40..3a462fdb5 100755
--- a/src/scripts/ci_build.py
+++ b/src/scripts/ci_build.py
@@ -128,7 +128,7 @@ def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, ro
if target == 'cross-arm32':
flags += ['--cpu=armv7', '--cc-abi-flags=-arch armv7 -arch armv7s -stdlib=libc++']
elif target == 'cross-arm64':
- flags += ['--cpu=armv8-a', '--cc-abi-flags=-arch arm64 -stdlib=libc++']
+ flags += ['--cpu=arm64', '--cc-abi-flags=-arch arm64 -stdlib=libc++']
else:
raise Exception("Unknown cross target '%s' for iOS" % (target))
elif target == 'cross-win32':
@@ -145,7 +145,7 @@ def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, ro
cc_bin = 'arm-linux-gnueabihf-g++'
test_prefix = ['qemu-arm', '-L', '/usr/arm-linux-gnueabihf/']
elif target == 'cross-arm64':
- flags += ['--cpu=armv8-a']
+ flags += ['--cpu=aarch64']
cc_bin = 'aarch64-linux-gnu-g++'
test_prefix = ['qemu-aarch64', '-L', '/usr/aarch64-linux-gnu/']
elif target == 'cross-ppc32':