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>
pull/7422/head
Alan Coopersmith 4 years ago
parent e801e0435e
commit 5b82bb8689
  1. 8
      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'])

Loading…
Cancel
Save