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

Add additional compiler flags for tvOS #51241

Merged
merged 2 commits into from
Apr 15, 2021

Conversation

akoeplinger
Copy link
Member

We had those in the original mono/mono build.

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)
Copy link
Member

@filipnavara filipnavara Apr 14, 2021

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)?

Copy link
Member Author

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.

@akoeplinger akoeplinger merged commit e254b56 into dotnet:main Apr 15, 2021
@akoeplinger akoeplinger deleted the add-tvos-flags branch April 15, 2021 12:54
@ghost ghost locked as resolved and limited conversation to collaborators May 15, 2021
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants