Skip to content

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

Closed
@SahilAshar

Description

@SahilAshar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions