diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py index 8ce9d81120..88e5e7b998 100644 --- a/lib/spack/spack/compilers/__init__.py +++ b/lib/spack/spack/compilers/__init__.py @@ -220,10 +220,10 @@ def _compiler_config_from_external(config): operating_system = host_platform.operating_system("default_os") target = host_platform.target("default_target").microarchitecture else: - target = spec.target + target = spec.architecture.target if not target: - host_platform = spack.platforms.host() - target = host_platform.target("default_target").microarchitecture + target = spack.platforms.host().target("default_target") + target = target.microarchitecture operating_system = spec.os if not operating_system: