Skip to content
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

Invalid tvOS binaries #103

Closed
naithar opened this issue Feb 14, 2021 · 6 comments
Closed

Invalid tvOS binaries #103

naithar opened this issue Feb 14, 2021 · 6 comments

Comments

@naithar
Copy link

naithar commented Feb 14, 2021

When uploading project containing library built with cctools App Store rejects the app with following error:

Invalid Bundle - The app cannot be processed because options not allowed to be embedded in bitcode are detected in the submission.

Using same library built on macOS results in correct application processing.

I've followed steps from #31. But using clang from https://opensource.apple.com/tarballs/clang/clang-800.0.42.1.tar.gz resulted in cctools not building at all (apple-libtapi and cctools was missing -lgcc for some reason).

I've switched to https://github.com/apple/llvm-project and managed to build cctools, but binary was still rejected.
Adding https://github.com/tpoechtrager/xar libraries as a dependency for cctools (since it seems that they are required for -fembed-bitcode and -bundle_bitcode to work) also didn't help.

Also binaries are not exactly corrupted - they do work on both x86_64 simulator and AppleTV device, but App Store rejects the binary for some reason.

Edit:

Also nm /opt/compiler/apple-clang/lib/libLTO.so |grep lto_codegen_hide_symbols from #31 didn't return anything.

@tpoechtrager
Copy link
Owner

Compare the bitcode files and check what's different. I don't know of a different solution.

https://llvm.org/docs/CommandGuide/llvm-bcanalyzer.html

@naithar
Copy link
Author

naithar commented Feb 14, 2021

llvm-bcanalyzer returns llvm-bcanalyzer: Invalid record at top-level for both (working and corrupt) tvOS libraries.

Any reason libLTO.so built from https://github.com/apple/llvm-project doesn't contain lto_codegen_hide_symbols ? Maybe that's the source of the issue? macOS built binary is 10 MB smaller then one build with cctools.

@tpoechtrager
Copy link
Owner

I don't know. Maybe lto_codegen_hide_symbols is not upstreamed on purpose.

@naithar
Copy link
Author

naithar commented Feb 18, 2021

Using -flto seems to be fixing App Store review issue. It requires a lot more time to build the project using such library, but it's better than nothing.

@tpoechtrager
Copy link
Owner

Interesting. -flto=thin should speed it up a bit.

@naithar
Copy link
Author

naithar commented Feb 18, 2021

Thanks! thin gave 3x speedup in building final app.

@naithar naithar closed this as completed Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants