-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add additional compiler flags for tvOS #51241
Conversation
We had those in the original mono/mono build.
add_link_options(-fembed-bitcode) | ||
add_compile_options(-Wl,-no-undefined) | ||
add_compile_options(-fembed-bitcode -fno-gnu-inline-asm) | ||
add_link_options(-fembed-bitcode -fno-gnu-inline-asm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I came to the conclusion that -fno-gnu-inline-asm
is unnecessary but also harmless (but not implied by -fembed-bitcode
!).
Maybe add_compile_options(-Wl,-no-undefined)
should just be add_link_options(-no-undefined)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I tried add_link_options(-no-undefined)
but clang then complained about not recognizing the flag which led me to pass it via -Wl,-no-undefined
. However it turns out that the Apple linker ignores that one too, which is why the libraries build failed because it has an option set to error on unused command line options.
Apparently the replacement for the option is -undefined error
, but that in turn resulted in this error:
ld: -undefined and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
We don't set -bitcode_bundle
so I think it's implicit by the -fembed-bitcode
which leads me to believe this is actually pointless.
The simulator build failed because we do use inline asm there (which is allowed), so I moved it to mono.proj since checking for simulator isn't really straightforward in CMake. It means we don't set the flag on the libraries build but the chances of it using inline asm are quite slim :)
While doing that I noticed that we were actually missing to pass a bunch of options for the tvOS case in mono.proj, we only had the iOS case wired up so I fixed that.
We had those in the original mono/mono build.