Apple requires bitcode for tvOS builds, and strongly encourages bitcode for iOS builds. Also, the compiler has recently added a check in clang/lib/Driver/ToolChains/Clang.cpp, which does not allow -mllvm in CFLAGS when -fembed-bitcode is present.
This didn't happen before, on llvm-9.0.1 (but that was not compatible with the modern Xcode).
I tried to simply remove the error check for mllvm from Clang.cpp, but this resulted in lots of suspicious warnings while compiling and my iOS code, I tried to simply hardcode -mllvm -bcf -mllvm -sub -mllvm -fla -mllvm -sobf in the compiler. Now, build passes smoothly.
Is there a better way to work around this problem? Also, I am not sure (have not tried) that the bitcode that is produced after my 'fix' is valid.
Apple requires bitcode for tvOS builds, and strongly encourages bitcode for iOS builds. Also, the compiler has recently added a check in
clang/lib/Driver/ToolChains/Clang.cpp, which does not allow-mllvmin CFLAGS when-fembed-bitcodeis present.This didn't happen before, on llvm-9.0.1 (but that was not compatible with the modern Xcode).
I tried to simply remove the error check for mllvm from
Clang.cpp, but this resulted in lots of suspicious warnings while compiling and my iOS code, I tried to simply hardcode-mllvm -bcf -mllvm -sub -mllvm -fla -mllvm -sobfin the compiler. Now, build passes smoothly.Is there a better way to work around this problem? Also, I am not sure (have not tried) that the bitcode that is produced after my 'fix' is valid.