aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/linkers.py
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2020-07-07 19:02:08 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2020-07-07 22:08:38 -0700
commit5b82bb8689b3cb598289f734de21e07a64fa6898 (patch)
tree7ddf5bd95b16889abd0a2bcb7dee27703cc97f46 /mesonbuild/linkers.py
parente801e0435ea69b64443dd16ef5a13e93ea13546c (diff)
downloadmeson-5b82bb8689b3cb598289f734de21e07a64fa6898.zip
meson-5b82bb8689b3cb598289f734de21e07a64fa6898.tar.gz
meson-5b82bb8689b3cb598289f734de21e07a64fa6898.tar.bz2
SolarisDynamicLinker: Check if linker supports -z type=pie
As suggested by dcbaker in https://github.com/mesonbuild/meson/pull/7370#discussion_r445145889 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'mesonbuild/linkers.py')
-rw-r--r--mesonbuild/linkers.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py
index 4264e7d..c6c677c 100644
--- a/mesonbuild/linkers.py
+++ b/mesonbuild/linkers.py
@@ -1100,7 +1100,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'])