beefytech / Beef

Beef Programming Language
http://www.beeflang.org
Other
2.51k stars 130 forks source link

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

Open jazzbre opened 3 years ago

jazzbre commented 3 years ago

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

bfiete commented 3 years ago

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

jazzbre commented 3 years ago

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.