diff options
author | Seth R. Johnson <johnsonsr@ornl.gov> | 2020-02-20 13:00:48 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-20 12:00:48 -0600 |
commit | a1e3a1653a5772f6b4d119b0778e662ea3177026 (patch) | |
tree | da32ac86cf6c2b2004aa7866ec55dec5d3f7aa7e /var | |
parent | f5b5036ad55bf6e56cd5e1013d4eaacd6c56db7b (diff) | |
download | spack-a1e3a1653a5772f6b4d119b0778e662ea3177026.tar.gz spack-a1e3a1653a5772f6b4d119b0778e662ea3177026.tar.bz2 spack-a1e3a1653a5772f6b4d119b0778e662ea3177026.tar.xz spack-a1e3a1653a5772f6b4d119b0778e662ea3177026.zip |
Mark binutils-related conflicts (#15075)
* Mark conflicts with binutils on darwin
* Explicitly require binutils bootstrapping and mark conflict with nvptx
* Disable gold variant by default on darwin
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/binutils/package.py | 7 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/gcc/package.py | 22 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/llvm/package.py | 3 |
3 files changed, 23 insertions, 9 deletions
diff --git a/var/spack/repos/builtin/packages/binutils/package.py b/var/spack/repos/builtin/packages/binutils/package.py index ad5f7fb5ef..d84dd32bc5 100644 --- a/var/spack/repos/builtin/packages/binutils/package.py +++ b/var/spack/repos/builtin/packages/binutils/package.py @@ -5,6 +5,7 @@ from spack import * import glob +import sys class Binutils(AutotoolsPackage, GNUMirrorPackage): @@ -28,7 +29,8 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage): variant('plugins', default=False, description="enable plugins, needed for gold linker") - variant('gold', default=True, description="build the gold linker") + variant('gold', default=(sys.platform != 'darwin'), + description="build the gold linker") variant('libiberty', default=False, description='Also install libiberty.') variant('nls', default=True, description='Enable Native Language Support') variant('headers', default=False, description='Install extra headers (e.g. ELF)') @@ -44,6 +46,9 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage): depends_on('m4', type='build', when='@:2.29.99 +gold') depends_on('bison', type='build', when='@:2.29.99 +gold') + conflicts('+gold', when='platform=darwin', + msg="Binutils cannot build linkers on macOS") + def configure_args(self): spec = self.spec diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 2c38296f11..431fcaa9da 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -187,6 +187,11 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage): conflicts('languages=jit', when='+nvptx') conflicts('languages=objc', when='+nvptx') conflicts('languages=obj-c++', when='+nvptx') + # NVPTX build disables bootstrap + conflicts('+binutils', when='+nvptx') + + # Binutils can't build ld on macOS + conflicts('+binutils', when='platform=darwin') if sys.platform == 'darwin': # Fix parallel build on APFS filesystem @@ -298,17 +303,20 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage): # Binutils if spec.satisfies('+binutils'): - static_bootstrap_flags = '-static-libstdc++ -static-libgcc' + stage1_ldflags = str(self.rpath_args) + boot_ldflags = stage1_ldflags + ' -static-libstdc++ -static-libgcc' + if '%gcc' in spec: + stage1_ldflags = boot_ldflags + binutils = spec['binutils'].prefix.bin options.extend([ '--with-sysroot=/', - '--with-stage1-ldflags={0} {1}'.format( - self.rpath_args, static_bootstrap_flags), - '--with-boot-ldflags={0} {1}'.format( - self.rpath_args, static_bootstrap_flags), + '--with-stage1-ldflags=' + stage1_ldflags, + '--with-boot-ldflags=' + boot_ldflags, '--with-gnu-ld', - '--with-ld={0}/ld'.format(spec['binutils'].prefix.bin), + '--with-ld=' + binutils.ld, '--with-gnu-as', - '--with-as={0}/as'.format(spec['binutils'].prefix.bin), + '--with-as=' + binutils.join('as'), + '--enable-bootstrap', ]) # MPC diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index 05e9404592..871559d453 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * +import sys class Llvm(CMakePackage): @@ -71,7 +72,7 @@ class Llvm(CMakePackage): description="Build the LLVM C++ standard library") variant('compiler-rt', default=True, description="Build LLVM compiler runtime, including sanitizers") - variant('gold', default=True, + variant('gold', default=(sys.platform != 'darwin'), description="Add support for LTO with the gold linker plugin") variant('shared_libs', default=False, description="Build all components as shared libraries, faster, " |