diff --git a/lib/spack/llnl/util/cpu/microarchitectures.json b/lib/spack/llnl/util/cpu/microarchitectures.json index 2e20cc98f8..ad985ba994 100644 --- a/lib/spack/llnl/util/cpu/microarchitectures.json +++ b/lib/spack/llnl/util/cpu/microarchitectures.json @@ -49,11 +49,18 @@ "vendor": "generic", "features": [], "compilers": { - "gcc": { - "versions": "4:", - "name": "x86-64", - "flags": "-march={name} -mtune={name}" - } + "gcc": [ + { + "versions": "4.2.0:", + "name": "x86-64", + "flags": "-march={name} -mtune=generic" + }, + { + "versions": "4.0:4.1.2", + "name": "x86-64", + "flags": "-march={name} -mtune={name}" + } + ] } }, "nocona": { diff --git a/lib/spack/spack/test/llnl/util/cpu.py b/lib/spack/spack/test/llnl/util/cpu.py index 836514cc3c..9af784d103 100644 --- a/lib/spack/spack/test/llnl/util/cpu.py +++ b/lib/spack/spack/test/llnl/util/cpu.py @@ -190,7 +190,9 @@ def test_target_json_schema(): @pytest.mark.parametrize('target_name,compiler,version,expected_flags', [ - ('x86_64', 'gcc', '4.9.3', '-march=x86-64 -mtune=x86-64'), + ('x86_64', 'gcc', '4.9.3', '-march=x86-64 -mtune=generic'), + ('x86_64', 'gcc', '4.2.0', '-march=x86-64 -mtune=generic'), + ('x86_64', 'gcc', '4.1.1', '-march=x86-64 -mtune=x86-64'), ('nocona', 'gcc', '4.9.3', '-march=nocona -mtune=nocona'), ('nehalem', 'gcc', '4.9.3', '-march=nehalem -mtune=nehalem'), ('nehalem', 'gcc', '4.8.5', '-march=corei7 -mtune=corei7'),