Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark binutils-related conflicts #15075

Merged
merged 3 commits into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion var/spack/repos/builtin/packages/binutils/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from spack import *
import glob
import sys


class Binutils(AutotoolsPackage, GNUMirrorPackage):
Expand All @@ -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)')
Expand All @@ -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

Expand Down
22 changes: 15 additions & 7 deletions var/spack/repos/builtin/packages/gcc/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -292,17 +297,20 @@ def configure_args(self):

# 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
Expand Down
3 changes: 2 additions & 1 deletion var/spack/repos/builtin/packages/llvm/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack import *
import sys


class Llvm(CMakePackage):
Expand Down Expand Up @@ -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, "
Expand Down