binutils@2.38 %gcc: add -fPIC -fcommon -Wl,-z,notext (#30345)
This commit is contained in:
parent
25206c86c4
commit
e691d6df64
@ -156,23 +156,24 @@ def install_headers(self):
|
||||
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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user