From e6cae978b8018f87d1129cbb7a33f0f27d9c497b Mon Sep 17 00:00:00 2001 From: Matthieu Dorier Date: Wed, 25 Sep 2019 18:41:02 -0500 Subject: [PATCH] llvm, mesa: update target comparison semantics (#12914) * llvm: fixed issues with syntax and formatting * use spec.architecture.target.family * use spec.target instead of spec.architecture.target * mesa: use == instead of __contains__ --- var/spack/repos/builtin/packages/llvm/package.py | 15 +++++++++------ var/spack/repos/builtin/packages/mesa/package.py | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index 407898d5f0..5946d6c784 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -683,16 +683,19 @@ def cmake_args(self): # hence the test to see if the version starts with "flang". targets.append('CppBackend') - if 'x86' in spec.architecture.target.lower(): + if spec.target.family == 'x86' or spec.target.family == 'x86_64': targets.append('X86') - elif 'arm' in spec.architecture.target.lower(): + elif spec.target.family == 'arm': targets.append('ARM') - elif 'aarch64' in spec.architecture.target.lower(): + elif spec.target.family == 'aarch64': targets.append('AArch64') - elif 'sparc' in spec.architecture.target.lower(): + elif (spec.target.family == 'sparc' or + spec.target.family == 'sparc64'): targets.append('Sparc') - elif ('ppc' in spec.architecture.target.lower() or - 'power' in spec.architecture.target.lower()): + elif (spec.target.family == 'ppc64' or + spec.target.family == 'ppc64le' or + spec.target.family == 'ppc' or + spec.target.family == 'ppcle'): targets.append('PowerPC') cmake_args.append( diff --git a/var/spack/repos/builtin/packages/mesa/package.py b/var/spack/repos/builtin/packages/mesa/package.py index dba6c5d982..918ae841d0 100644 --- a/var/spack/repos/builtin/packages/mesa/package.py +++ b/var/spack/repos/builtin/packages/mesa/package.py @@ -101,7 +101,7 @@ def configure_args(self): args_gallium_drivers = ['swrast'] args_dri_drivers = [] - if 'arm' in spec.architecture.target.lower(): + if spec.target.family == 'arm': args.append('--disable-libunwind') num_frontends = 0