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
This commit is contained in:
parent
f5b5036ad5
commit
a1e3a1653a
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
from spack import *
|
from spack import *
|
||||||
import glob
|
import glob
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
class Binutils(AutotoolsPackage, GNUMirrorPackage):
|
class Binutils(AutotoolsPackage, GNUMirrorPackage):
|
||||||
@ -28,7 +29,8 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage):
|
|||||||
|
|
||||||
variant('plugins', default=False,
|
variant('plugins', default=False,
|
||||||
description="enable plugins, needed for gold linker")
|
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('libiberty', default=False, description='Also install libiberty.')
|
||||||
variant('nls', default=True, description='Enable Native Language Support')
|
variant('nls', default=True, description='Enable Native Language Support')
|
||||||
variant('headers', default=False, description='Install extra headers (e.g. ELF)')
|
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('m4', type='build', when='@:2.29.99 +gold')
|
||||||
depends_on('bison', 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):
|
def configure_args(self):
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
|
|
||||||
|
@ -187,6 +187,11 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
|
|||||||
conflicts('languages=jit', when='+nvptx')
|
conflicts('languages=jit', when='+nvptx')
|
||||||
conflicts('languages=objc', when='+nvptx')
|
conflicts('languages=objc', when='+nvptx')
|
||||||
conflicts('languages=obj-c++', 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':
|
if sys.platform == 'darwin':
|
||||||
# Fix parallel build on APFS filesystem
|
# Fix parallel build on APFS filesystem
|
||||||
@ -298,17 +303,20 @@ def configure_args(self):
|
|||||||
|
|
||||||
# Binutils
|
# Binutils
|
||||||
if spec.satisfies('+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([
|
options.extend([
|
||||||
'--with-sysroot=/',
|
'--with-sysroot=/',
|
||||||
'--with-stage1-ldflags={0} {1}'.format(
|
'--with-stage1-ldflags=' + stage1_ldflags,
|
||||||
self.rpath_args, static_bootstrap_flags),
|
'--with-boot-ldflags=' + boot_ldflags,
|
||||||
'--with-boot-ldflags={0} {1}'.format(
|
|
||||||
self.rpath_args, static_bootstrap_flags),
|
|
||||||
'--with-gnu-ld',
|
'--with-gnu-ld',
|
||||||
'--with-ld={0}/ld'.format(spec['binutils'].prefix.bin),
|
'--with-ld=' + binutils.ld,
|
||||||
'--with-gnu-as',
|
'--with-gnu-as',
|
||||||
'--with-as={0}/as'.format(spec['binutils'].prefix.bin),
|
'--with-as=' + binutils.join('as'),
|
||||||
|
'--enable-bootstrap',
|
||||||
])
|
])
|
||||||
|
|
||||||
# MPC
|
# MPC
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
from spack import *
|
from spack import *
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
class Llvm(CMakePackage):
|
class Llvm(CMakePackage):
|
||||||
@ -71,7 +72,7 @@ class Llvm(CMakePackage):
|
|||||||
description="Build the LLVM C++ standard library")
|
description="Build the LLVM C++ standard library")
|
||||||
variant('compiler-rt', default=True,
|
variant('compiler-rt', default=True,
|
||||||
description="Build LLVM compiler runtime, including sanitizers")
|
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")
|
description="Add support for LTO with the gold linker plugin")
|
||||||
variant('shared_libs', default=False,
|
variant('shared_libs', default=False,
|
||||||
description="Build all components as shared libraries, faster, "
|
description="Build all components as shared libraries, faster, "
|
||||||
|
Loading…
Reference in New Issue
Block a user