summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2021-04-19 11:55:39 +0200
committerGitHub <noreply@github.com>2021-04-19 11:55:39 +0200
commit0f47464df41e5c48ce5287923397b87ff6e67d0b (patch)
treea8d2816c78ec996ee63cba937c7475505af4c181
parent618edbe5d5175697470383eb6b8895d8740a8d8e (diff)
downloadspack-0f47464df41e5c48ce5287923397b87ff6e67d0b.tar.gz
spack-0f47464df41e5c48ce5287923397b87ff6e67d0b.tar.bz2
spack-0f47464df41e5c48ce5287923397b87ff6e67d0b.tar.xz
spack-0f47464df41e5c48ce5287923397b87ff6e67d0b.zip
binutils: add option for assembler, constrain 'as' and 'ld' variants (#23065)
Avoid that the user builds the assembler without the linker, because you may run into problems when the host linker is old: https://wiki.gentoo.org/wiki/Binutils_2.32_upgrade_notes/elfutils_0.175:_unable_to_initialize_decompress_status_for_section_.debug_info
-rw-r--r--var/spack/repos/builtin/packages/binutils/package.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/binutils/package.py b/var/spack/repos/builtin/packages/binutils/package.py
index bcab50c477..3f73bdbe9f 100644
--- a/var/spack/repos/builtin/packages/binutils/package.py
+++ b/var/spack/repos/builtin/packages/binutils/package.py
@@ -39,6 +39,7 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage):
variant('headers', default=False, description='Install extra headers (e.g. ELF)')
variant('lto', default=False, description='Enable lto.')
variant('ld', default=False, description='Enable ld.')
+ variant('gas', default=False, description='Enable as assembler.')
variant('interwork', default=False, description='Enable interwork.')
patch('cr16.patch', when='@:2.29.1')
@@ -60,6 +61,15 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage):
conflicts('+gold', when='platform=darwin',
msg="Binutils cannot build linkers on macOS")
+ # When you build binutils with ~ld and +gas and load it in your PATH, you may
+ # end up with an incompatibility between linker and assembler, in particular:
+ # "unable to initialize decompress status for section .debug_info" is the error
+ # I've encountered.
+ conflicts('~gas', '+ld', msg="Linker and assembler should be the same version")
+ conflicts('+gas', '~ld', msg="Linker and assembler should be the same version")
+ conflicts('~gas', '+gold', msg="Linker and assembler should be the same version")
+ conflicts('+gas', '~gold', msg="Linker and assembler should be the same version")
+
def configure_args(self):
spec = self.spec
@@ -76,6 +86,7 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage):
args += self.enable_or_disable('lto')
args += self.enable_or_disable('ld')
+ args += self.enable_or_disable('gas')
args += self.enable_or_disable('interwork')
args += self.enable_or_disable('gold')
args += self.enable_or_disable('plugins')