Closed pyrmont closed 1 year ago
right, I admit I'm pretty much Linux-centric and had not considered or (or expected) issues with other OSes. Removing the strip makes sense, maybe we can come up with some tests for CI to make sure this does not break again if someone gets the same idea some time in the future.
Janet's Makefile calls
strip
onmake install
to remove certain symbols. This causes macOS to be unable to dynamically load shared objects at runtime. This PR adds the flags-x
and-S
which fixes this problem.Discussion
As part of #1140, @zevv added a call to
strip
to remove certain symbols when runningmake install
. This does not cause an issue on Linux (and presumably other POSIX systems) but prevents Janet from loading shared object files dynamically on macOS.A simple example is Janet's JSON project. When the test suite is run on macOS 13.4.1, the output is:
The changes in this PR fix this problem.
Alternatives
The addition of the call to
strip
was not the primary purpose of #1140 and I have guessed that the objective of callingstrip
was to remove debug symbols. I confess I am not very familiar with this aspect of compilation and so am not sure if the flags used in this PR are appropriate. More information about the flags is available in Apple's man page (I can't find an up to date web version of the macOS man pages so this is the link to the current version in Apple's open source repository on GitHub). A copy of the Linux man page is also viewable.If there's a more appropriate combination of flags, please let me know.