Beef icon indicating copy to clipboard operation
Beef copied to clipboard

[Bug] iOS link fails with 'ld: Invalid record for architecture arm64'

Open jazzbre opened this issue 3 years ago • 2 comments

It seems that BeefBuild generated object/archive is not compatible with Apple LLVM (with bitcode disabled). I've tried a bunch of triplets aarch64-apple-io, arm64-apple-ios always getting the same result. Lipo tool returns a bunch of 'invalid record' and 'Unsupported version of DISubrange' but says that arch is arm64.

Repo case is attached, just run the build.sh, it will build beef project and use the resulting .a file in the xcode build.

You think we should use https://github.com/apple/llvm-project on Apple devices? BeefLangiOSTest.zip

jazzbre avatar Mar 10 '21 19:03 jazzbre

I think languages like Rust manage to generate iOS-compatible obj/bitcode with the standard LLVM. Here's an old issue describing some of the bitcode generation issues: https://github.com/rust-lang/rust/issues/35968

bfiete avatar Mar 17 '21 11:03 bfiete

I think this is not a bitcode issue anyway. Apple says this: "For iOS apps, bitcode is the default, but optional. For watchOS and tvOS apps, bitcode is required. If you provide bitcode, all apps and frameworks in the app bundle (all targets in the project) need to include bitcode." So maybe we can ignore bitcode for now.

jazzbre avatar Mar 17 '21 12:03 jazzbre