From 884f317d50344101246f2892af492663a45be261 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Sun, 3 Jan 2016 17:22:13 -0800 Subject: tweak gold support, added to gcc The gold linker support and gold plugin variants now use the same name. Trying to apply use-flag-style discipline here despite the fact gold has other implications for clang, this way globally enabling gold will have a more consistent effect if that becomes possible. The gold support in gcc could use more testing to ensure it works consistently, but as long as a binutils including gold is used the gcc configure tends to pick it up, and it seems to work with 5.3.0 at least. --- var/spack/packages/gcc/package.py | 5 ++++- var/spack/packages/llvm/package.py | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/var/spack/packages/gcc/package.py b/var/spack/packages/gcc/package.py index 7ec160d595..61b16f3fd8 100644 --- a/var/spack/packages/gcc/package.py +++ b/var/spack/packages/gcc/package.py @@ -48,11 +48,14 @@ class Gcc(Package): version('4.7.4', '4c696da46297de6ae77a82797d2abe28') version('4.6.4', 'b407a3d1480c11667f293bfb1f17d1a4') version('4.5.4', '27e459c2566b8209ab064570e1b378f7') + + variant('gold', default=True, description="Build the gold linker plugin for ld-based LTO") depends_on("mpfr") depends_on("gmp") depends_on("mpc") # when @4.5: - depends_on("binutils~libiberty") + depends_on("binutils~libiberty", when='~gold') + depends_on("binutils~libiberty+gold", when='+gold') # Save these until we can do optional deps. depends_on("isl", when=DEPENDS_ON_ISL_PREDICATE) diff --git a/var/spack/packages/llvm/package.py b/var/spack/packages/llvm/package.py index 19d82d81b7..10e899437f 100644 --- a/var/spack/packages/llvm/package.py +++ b/var/spack/packages/llvm/package.py @@ -45,7 +45,7 @@ class Llvm(Package): variant('polly', default=True, description="Build the LLVM polyhedral optimization plugin, only builds for 3.7.0+") variant('libcxx', default=True, description="Build the LLVM C++ standard library") variant('compiler-rt', default=True, description="Build the LLVM compiler runtime, including sanitizers") - variant('lto', default=True, description="Add support for LTO with the gold linker plugin") + variant('gold', default=True, description="Add support for LTO with the gold linker plugin") # Universal dependency @@ -57,7 +57,7 @@ class Llvm(Package): depends_on('libedit', when='+lldb') # gold support - depends_on('binutils+gold', when='+lto') + depends_on('binutils+gold', when='+gold') # polly plugin depends_on('gmp', when='+polly') @@ -180,7 +180,7 @@ class Llvm(Package): '-DCLANG_DEFAULT_OPENMP_RUNTIME:STRING=libomp', '-DPYTHON_EXECUTABLE:PATH=%s/bin/python' % spec['python'].prefix ]) - if '+lto' in spec: + if '+gold' in spec: cmake_args.append('-DLLVM_BINUTILS_INCDIR=' + os.path.join( spec['binutils'].prefix, 'include')) if '+polly' in spec: cmake_args.append('-DLINK_POLLY_INTO_TOOLS:Bool=ON') -- cgit v1.2.3-70-g09d2