symbolextractor: Add support for Solaris

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
pull/7370/head
Alan Coopersmith 4 years ago
parent d42cd735a4
commit 45793b6ee2
  1. 9
      mesonbuild/scripts/symbolextractor.py

@ -121,6 +121,13 @@ def gnu_syms(libfilename: str, outfilename: str):
result += [' '.join(entry)]
write_if_changed('\n'.join(result) + '\n', outfilename)
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
def osx_syms(libfilename: str, outfilename: str):
# Get the name of the library
output = call_tool('otool', ['-l', libfilename])
@ -270,6 +277,8 @@ def gen_symbols(libfilename: str, impfilename: str, outfilename: str, cross_host
# No import library. Not sure how the DLL is being used, so just
# rebuild everything that links to it every time.
dummy_syms(outfilename)
elif mesonlib.is_sunos():
solaris_syms(libfilename, outfilename)
else:
if not os.path.exists(TOOL_WARNING_FILE):
mlog.warning('Symbol extracting has not been implemented for this '

Loading…
Cancel
Save