summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-02-16 02:50:15 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2020-02-16 20:43:27 +0530
commit431283b35dff5b43ecc65fe19ae581b3c6d8b9be (patch)
tree686e75192a4299abbe2abc61a38f19f1ed67b89f
parent77d163a0e9eb9717a13a9c1a8839df9d48b9fc84 (diff)
downloadmeson-431283b35dff5b43ecc65fe19ae581b3c6d8b9be.tar.gz
symbolextractor: Correctly filter undefined symbols on macOS
-g is --extern-only and -P is --format=posix. We were missing --defined-only for some reason, which we pass to `nm` on Linux. This avoids having to manually filter later.
-rw-r--r--mesonbuild/scripts/symbolextractor.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/scripts/symbolextractor.py b/mesonbuild/scripts/symbolextractor.py
index 1bce6e49a..e889f6299 100644
--- a/mesonbuild/scripts/symbolextractor.py
+++ b/mesonbuild/scripts/symbolextractor.py
@@ -92,10 +92,12 @@ def osx_syms(libfilename, outfilename):
match = i
break
result = [arr[match + 2], arr[match + 5]] # Libreoffice stores all 5 lines but the others seem irrelevant.
- pnm, output = Popen_safe(['nm', '-g', '-P', libfilename])[0:2]
+ pnm, output = Popen_safe(['nm', '--extern-only',
+ '--defined-only', '--format=posix',
+ libfilename])[0:2]
if pnm.returncode != 0:
raise RuntimeError('nm does not work.')
- result += [' '.join(x.split()[0:2]) for x in output.split('\n') if x and not x.endswith('U')]
+ result += [' '.join(x.split()[0:2]) for x in output.split('\n')]
write_if_changed('\n'.join(result) + '\n', outfilename)
def gen_symbols(libfilename, outfilename, cross_host):