Make symbols script work cross-platform #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The symbols script had darwin-x64 hardcoded as the platform and arch,
which means that running the script doesn't work on Linux.
This commit adds directory read and selects a file that starts with
'libsodium', which is a
.dylib
file on MacOS and.so
on Linux. Thiscommit also makes a slight changes to the nm execution, which was
previously depending on flags that aren't used across other versions of
nm.
This commit uses only
--dynamic
, and uses the symbol type column toselect the symbols that we want without depending on command-line flags
that aren't always available. I've output the results into the readme,
and the only surprising change is that numbers and underscores are now
being sorted differently in the 'missing altogether' section. This is
because the previous code sorted the unparsed lines from nm, which meant
that we were sorting by memory address rather than symbol name.