Use the strip command detected by libtool#13282
Merged
dra27 merged 2 commits intoocaml:trunkfrom Jul 16, 2024
Merged
Conversation
Instead of using `strip` unconditionally to build `tmpheader.exe`, use the `strip` command detected by `libtool` during configure so that it is replaced with `:` when the command is absent and it becomes easy to override it if need be
GNU strip can be called safely on binaries generated by cl as well as by MinGW GCC (even if it doesn't produce a smaller executable for cl-generated binaries) so invoke strip also on Windows so that MinGW binaries are properly stripped Tested with GNU strip 2.42
MisterDA
approved these changes
Jul 5, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR proposes to use the
stripcommand detected bylibtoolduring configure so that it is replaced with:when the command is absent and it becomes easy to override it if need be, such as in cross-compilation cases.It also proposes to strip
tmpheader.exealso on Windows, as it seems that GNUstripcan be called safely on binaries generated by cl as well as by MinGW GCC (even if it doesn't produce a smaller executable for cl-generated binaries).Using GNU strip 2.42 on a basic hello-world example, I get:
I compared the output of
dumpbin /allbefore and after stripping. Symbols no longer appear in the stripped versions forclandclang-cleven if the files keep the exact same size, strangely.All the binaries run as expected, but that’s not a big test.