Fix stripping of macOS loadable bundles#13314
Fix stripping of macOS loadable bundles#13314cpsauer wants to merge 1 commit intobazelbuild:masterfrom cpsauer:patch-1
Conversation
Adds `-x` flag to stripping of macOS loadable bundles. Loadable bundles--i.e. truly dynamically loadable libraries on macOS--cannot be stripped without this flag, since you'd be trying to strip away the all symbols, including those used for dynamic loading. Doing so results in `error: symbols referenced by indirect symbol table entries that can't be stripped`. `-x` instead leads to the removal of the unneeded local symbols. As Apple notes in their man page: "For dynamic shared libraries, the maximum level of stripping is usually -x (to remove all non-global symbols)." This should fix #11869
|
(I understand that --objc_enable_binary_stripping has other issues, but this seems like a clear bugfix that unblocks some useful functionality.) |
|
cc @trybka |
|
This seems like a perfectly reasonable tweak to improve bundle usage. 👍 Thanks! |
allevato
left a comment
There was a problem hiding this comment.
Hopefully we can get these hardcoded conditions/flags out of Bazel entirely at some point and moved into crosstool features instead, but adding one more check here doesn't really set us back in the meantime, either.
|
Sweet! Thanks, all. Where do we go from here on merging? |
|
[With you, @allevato: Features look like a great, additional layer of indirection to wrap flags that differ across platforms. But in the meantime.] |
|
Hey all, quick bump. Now That it's approved, what's the path to merging? |
|
I sent it to internal code review to @allevato right now |
|
Sweet! Thanks, all! |
Adds `-x` flag to stripping of macOS loadable bundles. Loadable bundles--i.e. truly dynamically loadable libraries on macOS--cannot be stripped without this flag, since you'd be trying to strip away the all symbols, including those used for dynamic loading. Doing so results in `error: symbols referenced by indirect symbol table entries that can't be stripped`. `-x` instead leads to the removal of the unneeded local symbols. As Apple notes in their man page: "For dynamic shared libraries, the maximum level of stripping is usually -x (to remove all non-global symbols)." This should fix #11869 Closes #13314. PiperOrigin-RevId: 368841977
Adds `-x` flag to stripping of macOS loadable bundles. Loadable bundles--i.e. truly dynamically loadable libraries on macOS--cannot be stripped without this flag, since you'd be trying to strip away the all symbols, including those used for dynamic loading. Doing so results in `error: symbols referenced by indirect symbol table entries that can't be stripped`. `-x` instead leads to the removal of the unneeded local symbols. As Apple notes in their man page: "For dynamic shared libraries, the maximum level of stripping is usually -x (to remove all non-global symbols)." This should fix #11869 Closes #13314. PiperOrigin-RevId: 368841977
Adds
-xflag to stripping of macOS loadable bundles.Loadable bundles--i.e. truly dynamically loadable libraries on macOS--cannot be stripped without this flag, since you'd be trying to strip away the all symbols, including those used for dynamic loading. Doing so results in
error: symbols referenced by indirect symbol table entries that can't be stripped.-xinstead leads to the removal of the unneeded local symbols. As Apple notes in their man page: "For dynamic shared libraries, the maximum level of stripping is usually -x (to remove all non-global symbols)."This should fix #11869