diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2020-07-14 20:46:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-14 20:46:19 +0300 |
commit | b6ea3eec1f62ea003b609b77aa1aabe00f4990f5 (patch) | |
tree | 6a89a2ba33cc36b80c382802aaa0b7d8aaa00d5a | |
parent | 825ba92b98347cfe470fad605da467e59d699efb (diff) | |
parent | 20d405ec18845a18694e4985701dd89523d6dc73 (diff) | |
download | meson-b6ea3eec1f62ea003b609b77aa1aabe00f4990f5.zip meson-b6ea3eec1f62ea003b609b77aa1aabe00f4990f5.tar.gz meson-b6ea3eec1f62ea003b609b77aa1aabe00f4990f5.tar.bz2 |
Merge pull request #7422 from alanc/solaris-fixes
Solaris fixes revisited
-rw-r--r-- | mesonbuild/environment.py | 8 | ||||
-rw-r--r-- | mesonbuild/linkers.py | 8 | ||||
-rw-r--r-- | mesonbuild/scripts/symbolextractor.py | 8 |
3 files changed, 19 insertions, 5 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index bf09a88..00922c1 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.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 diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py index fe1441e..fa30b9a 100644 --- a/mesonbuild/linkers.py +++ b/mesonbuild/linkers.py @@ -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']) diff --git a/mesonbuild/scripts/symbolextractor.py b/mesonbuild/scripts/symbolextractor.py index 5240275..f4084be 100644 --- a/mesonbuild/scripts/symbolextractor.py +++ b/mesonbuild/scripts/symbolextractor.py @@ -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 |