Merge pull request #7422 from alanc/solaris-fixes

Solaris fixes revisited
pull/7459/head
Jussi Pakkanen 4 years ago committed by GitHub
commit b6ea3eec1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      mesonbuild/environment.py
  2. 8
      mesonbuild/linkers.py
  3. 8
      mesonbuild/scripts/symbolextractor.py

@ -930,9 +930,15 @@ class Environment:
cls = GnuBFDDynamicLinker
linker = cls(compiler, for_machine, comp_class.LINKER_PREFIX, override, version=v)
elif 'Solaris' in e or 'Solaris' in o:
for line in (o+e).split('\n'):
if 'ld: Software Generation Utilities' in line:
v = line.split(':')[2].lstrip()
break
else:
v = 'unknown version'
linker = SolarisDynamicLinker(
compiler, for_machine, comp_class.LINKER_PREFIX, override,
version=search_version(e))
version=v)
else:
raise EnvironmentException('Unable to determine dynamic linker')
return linker

@ -1087,7 +1087,13 @@ class SolarisDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
def get_pie_args(self) -> T.List[str]:
# Available in Solaris 11.2 and later
return ['-z', 'type=pie']
pc, stdo, stde = mesonlib.Popen_safe(self.exelist + self._apply_prefix('-zhelp'))
for line in (stdo + stde).split('\n'):
if '-z type' in line:
if 'pie' in line:
return ['-z', 'type=pie']
break
return []
def get_asneeded_args(self) -> T.List[str]:
return self._apply_prefix(['-z', 'ignore'])

@ -124,9 +124,11 @@ def gnu_syms(libfilename: str, outfilename: str):
def solaris_syms(libfilename: str, outfilename: str):
# gnu_syms() works with GNU nm & readelf, not Solaris nm & elfdump
origpath = os.environ['PATH']
os.environ['PATH'] = '/usr/gnu/bin:' + origpath
gnu_syms(libfilename, outfilename)
os.environ['PATH'] = origpath
try:
os.environ['PATH'] = '/usr/gnu/bin:' + origpath
gnu_syms(libfilename, outfilename)
finally:
os.environ['PATH'] = origpath
def osx_syms(libfilename: str, outfilename: str):
# Get the name of the library

Loading…
Cancel
Save