Skip to content

How to enable bitcode when using apple_framework #660

Open

Description

@sanju-naik

Hi,

We are using cocoapods-bazel to generate BUILD files for Cocoapods, We want to enable bitcode for these pods, How Can I do this?

I tried passing these options to apple_framework macro, but it didn't work

  objc_copts = ["-embed-bitcode"],
  linkopts = ["-fembed-bitcode"],

The main ios_application where bitcode is enabled, still fails with this error:

/Users/sanju/repo/BUILD.bazel:53:16: Linking App_bin_unstripped failed: (Aborted): wrapped_clang failed: error executing command
  (cd /private/var/tmp/_bazel_sanju/<id>/execroot/__main__ && \
  exec env - \
    APPLE_SDK_PLATFORM=iPhoneOS \
    APPLE_SDK_VERSION_OVERRIDE=15.4 \
    PATH=/Users/sanju/Library/Caches/bazelisk/downloads/bazelbuild/bazel-5.0.0-darwin-arm64/bin:/opt/homebrew/opt/openjdk/bin:/Users/sanju/.rbenv/shims:/Users/sanju/.rbenv/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin \
    XCODE_VERSION_OVERRIDE=13.3.0.13E113 \
    ZERO_AR_DATE=1 \
  external/local_config_cc/wrapped_clang @bazel-out/ios-arm64-min12.0-applebin_ios-ios_arm64-opt-ST-6b6216040413/bin/GojekHost_bin_unstripped-2.params)
# Configuration: a2ea44cd09dd810bcd6d0b79c10ebdaee24d6a7c4b364b0c024ba538e4f12530
# Execution platform: @local_config_platform//:host
ld: warning: -headerpad_max_install_names is ignored when used with -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES)
ld: 'bazel-out/ios-arm64-min9.0-applebin_ios-ios_arm64-opt-ST-b50fc8c042fb/bin/Pods/FLEX/libFLEX_objc.a(FLEXFilteringTableViewController.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file 'bazel-out/ios-arm64-min9.0-applebin_ios-ios_arm64-opt-ST-b50fc8c042fb/bin/Pods/FLEX/libFLEX_objc.a'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions