Skip to content
Snippets Groups Projects
Unverified Commit b727f922 authored by Greg Becker's avatar Greg Becker Committed by Todd Gamblin
Browse files

cpu: fix clang flags for generic x86_64 (#13491)

* cpu: differentiate flags used for pristine LLVM vs. Apple's version
parent 835df4b2
No related branches found
No related tags found
No related merge requests found
...@@ -61,11 +61,18 @@ ...@@ -61,11 +61,18 @@
"flags": "-march={name} -mtune={name}" "flags": "-march={name} -mtune={name}"
} }
], ],
"clang": { "clang": [
"versions": ":", {
"family": "x86-64", "versions": "0.0.0-apple:",
"flags": "-march={family} -mcpu=generic" "family": "x86-64",
}, "flags": "-march={family}"
},
{
"versions": ":",
"family": "x86-64",
"flags": "-march={family} -mcpu=generic"
}
],
"intel": { "intel": {
"versions": ":", "versions": ":",
"name": "pentium4", "name": "pentium4",
......
...@@ -176,8 +176,9 @@ def test_arch_spec_container_semantic(item, architecture_str): ...@@ -176,8 +176,9 @@ def test_arch_spec_container_semantic(item, architecture_str):
('gcc@4.7.2', 'ivybridge', '-march=core-avx-i -mtune=core-avx-i'), ('gcc@4.7.2', 'ivybridge', '-march=core-avx-i -mtune=core-avx-i'),
# Check mixed toolchains # Check mixed toolchains
('clang@8.0.0', 'broadwell', ''), ('clang@8.0.0', 'broadwell', ''),
('clang@3.5', 'x86_64', '-march=x86-64 -mcpu=generic'),
# Check clang compilers with 'apple' suffix # Check clang compilers with 'apple' suffix
('clang@9.1.0-apple', 'x86_64', '-march=x86-64 -mcpu=generic') ('clang@9.1.0-apple', 'x86_64', '-march=x86-64')
]) ])
@pytest.mark.filterwarnings("ignore:microarchitecture specific") @pytest.mark.filterwarnings("ignore:microarchitecture specific")
def test_optimization_flags( def test_optimization_flags(
...@@ -199,9 +200,9 @@ def test_optimization_flags( ...@@ -199,9 +200,9 @@ def test_optimization_flags(
(spack.spec.CompilerSpec('gcc@4.4.0-special'), '9.2.0', 'icelake', (spack.spec.CompilerSpec('gcc@4.4.0-special'), '9.2.0', 'icelake',
'-march=icelake-client -mtune=icelake-client'), '-march=icelake-client -mtune=icelake-client'),
# Check that the special case for Apple's clang is treated correctly # Check that the special case for Apple's clang is treated correctly
# i.e. it won't try to dtect the version again # i.e. it won't try to detect the version again
(spack.spec.CompilerSpec('clang@9.1.0-apple'), None, 'x86_64', (spack.spec.CompilerSpec('clang@9.1.0-apple'), None, 'x86_64',
'-march=x86-64 -mcpu=generic'), '-march=x86-64'),
]) ])
def test_optimization_flags_with_custom_versions( def test_optimization_flags_with_custom_versions(
compiler, real_version, target_str, expected_flags, monkeypatch, config compiler, real_version, target_str, expected_flags, monkeypatch, config
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment