Skip to content

AppleClang does not support "-ffunction-sections" and "-fdata-sections" CFLAGS when compiling with bitcode #931

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

Closed
SahilAshar opened this issue Sep 20, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@SahilAshar
Copy link
Contributor

SahilAshar commented Sep 20, 2021

When compiling the 1DS SDK with AppleClang (so compiling and linking the static lib directly in Xcode via the provided CMakeLists.txt), AppleClang throws these errors if the -fembed-bitcode and -fembed-bitcode-marker are passed to CMake as CFLAGS as well.

clang: error: -ffunction-sections is not supported with -fembed-bitcode
clang: error: -fdata-sections is not supported with -fembed-bitcode

Apple requires modern iOS apps to build with bitcode enabled, and the inclusion of the -ffunction-sections and -fdata-sections CFLAGS breaks this requirement. Additionally, on Darwin targets, these flags actually have no effect.

rust-lang/cc-rs#291 and rust-lang/cc-rs#294 both contain some additional information on this issue.

@SahilAshar SahilAshar added the bug Something isn't working label Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant