Skip to content

Commit

Permalink
Make symbol check even more portable again
Browse files Browse the repository at this point in the history
Also ignore symbols of type N (debugging symbol on Linux and FreeBSD,
unused on macOS) and ignore (on non-macOS) support library symbols
that start with `$`, `.`, or `@` (in addition to `_`), which are
non-C-identifier characters. Fixes #1121.
  • Loading branch information
jmarshall committed Jul 19, 2022
1 parent 0930949 commit 064c802
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ def run_nm_defined_symbols(objfile):
symbols = set()
for line in stdout.splitlines():
(sym, symtype) = line.split()[:2]
if symtype not in "UFWw":
if symtype not in "UFNWw":
if IS_DARWIN:
# On macOS, all symbols have a leading underscore
symbols.add(sym.lstrip('_'))
else:
# Ignore symbols such as _edata (present in all shared objects)
if not sym.startswith('_'): symbols.add(sym)
if sym[0] not in "_$.@": symbols.add(sym)

return symbols

Expand Down

0 comments on commit 064c802

Please sign in to comment.