diff options
author | eugeneswalker <38933153+eugeneswalker@users.noreply.github.com> | 2022-05-02 06:38:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-02 15:38:07 +0200 |
commit | e691d6df64da5cc22df4b015da5012086929a02d (patch) | |
tree | 679e36a854159cd243da4354fbe648e1c60a60a8 | |
parent | 25206c86c4a0dc3101410ecbac51ad57522b9297 (diff) | |
download | spack-e691d6df64da5cc22df4b015da5012086929a02d.tar.gz spack-e691d6df64da5cc22df4b015da5012086929a02d.tar.bz2 spack-e691d6df64da5cc22df4b015da5012086929a02d.tar.xz spack-e691d6df64da5cc22df4b015da5012086929a02d.zip |
binutils@2.38 %gcc: add -fPIC -fcommon -Wl,-z,notext (#30345)
-rw-r--r-- | var/spack/repos/builtin/packages/binutils/package.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/binutils/package.py b/var/spack/repos/builtin/packages/binutils/package.py index c537d36102..51aa860275 100644 --- a/var/spack/repos/builtin/packages/binutils/package.py +++ b/var/spack/repos/builtin/packages/binutils/package.py @@ -156,23 +156,24 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage): extradir) def flag_handler(self, name, flags): + spec = self.spec # Use a separate variable for injecting flags. This way, installing # `binutils cflags='-O2'` will still work as expected. iflags = [] # To ignore the errors of narrowing conversions for # the Fujitsu compiler if name == 'cxxflags' and ( - self.spec.satisfies('@:2.31.1') and + spec.satisfies('@:2.31.1') and self.compiler.name in ('fj', 'clang', 'apple-clang') ): iflags.append('-Wno-narrowing') elif name == 'cflags': - if self.spec.satisfies('@:2.34 %gcc@10:'): + if spec.satisfies('@:2.34 %gcc@10:'): iflags.append('-fcommon') - if self.spec.satisfies('%cce'): - iflags.append('-fPIC -fcommon') + if spec.satisfies('%cce') or spec.satisfies('@2.38 %gcc'): + iflags.extend([self.compiler.cc_pic_flag, '-fcommon']) elif name == 'ldflags': - if self.spec.satisfies('%cce'): + if spec.satisfies('%cce') or spec.satisfies('@2.38 %gcc'): iflags.append('-Wl,-z,notext') return (iflags, None, flags) |