-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support bitcode for Apple platforms #7356
Conversation
@sergiocampama @thomasvl if you could take a look that would be great! |
Related: bazelbuild/rules_apple#163 |
It also looks like after pulling this commit broke my change 71bc38f It seems that I might have to regenerate that file |
Yes, you should be editing the new file instead, sorry for the confusion, I'll go ahead and erase the CROSSTOOL files and templates now. |
This changes the osx crosstool to support bitcode for all apple platforms. The behavior of bitcode is: - For simulators, never pass any bitcode related linker, or compiler flags - For devices: - For embedded bitcode markers - Pass `-fembed-bitcode-marker` to the compile and link commands - For embedded bitcode - Pass `-fembed-bitcode` to the compile commands - Pass `-fembed-bitcode` to the link command - Pass `-bitcode_verify` `-bitcode_hide_symbols` `-bitcode_symbol_map` to the link command - Pass a output file path, wrapped in BITCODE_TOUCH_SYMBOL_MAP which is a clang wrapper workaround With any bitcode link commands, you cannot pass `-headerpad_max_install_names` or you get a warning. You can see the logic for that here: https://opensource.apple.com/source/ld64/ld64-253.9/src/ld/Options.cpp.auto.html To make sure that debug and release builds are as close as possible, I've disabled this flag for all builds including the simulator if bitcode is requsted.
In the meantime here's an example of a rule that can be used to propagate these linker flags correctly for multi arch binaries ios-bazel-users/ios-bazel-users#14 |
@trybka can you review the update? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll get this imported.
Thanks! |
Thanks @keith ! |
Can this feature be enabled/disabled with different cpus/platforms? We're not building with bitcode, but we have a watch app and building with bitcode is mandatory for watch apps. |
#10061 might help with that, but it's not implemented yet unfortunately |
In your ios_application target you might be able to do some |
hmm... |
huh yea that's what I would have tried, I wonder if those features aren't passed through to the binaries from |
This changes the osx crosstool to support bitcode for all apple
platforms.
The behavior of bitcode is:
-fembed-bitcode-marker
to the compile and link commands-fembed-bitcode
to the compile and link commands-bitcode_verify
-bitcode_hide_symbols
-bitcode_symbol_map
to the link commandBITCODE_TOUCH_SYMBOL_MAP
which is a clang wrapper workaroundWith any bitcode link commands, you cannot pass
-headerpad_max_install_names
or you get a warning. You can see the logic for that here. To make sure that debug and release builds are as close as possible, I've disabled this flag for all builds including the simulator if bitcode is requested.Fixes #4982