-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
compiler: Improve handling of -fno-builtin
and compiler-rt options
#21920
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clang only uses the system assembler for nvptx and xcore nowadays.
This option, by its very nature, needs to be attached to a module. If it isn't, the code in a module could break at random when compiled into an application that doesn't have this option set. After this change, skip_linker_dependencies no longer implies no_builtin in the LLVM backend.
This looks to be a refactoring leftover.
-fno-builtin
and compiler-rt options-fno-builtin
and compiler-rt options
…tion. From `zig build-exe --help`: -fno-builtin Disable implicit builtin knowledge of functions It seems entirely reasonable and even expected that this option should imply both no-builtins on functions (which disables transformation of recognized code patterns to libcalls) and nobuiltin on call sites (which disables transformation of libcalls to intrinsics). We now match Clang's behavior for -fno-builtin. In both cases, we're painting with a fairly broad brush by applying this to an entire module, but it's better than nothing. ziglang#21833 proposes a more fine-grained way to apply nobuiltin.
In particular: * -fms-extensions for MinGW * -fno-builtin * -fno-emulated-tls for Android 29+ * -fno-exceptions * -fomit-frame-pointer * -fvisibility=hidden
This is already handled by build_crt_file().
…nd-tables. These are already handled by build_crt_file().
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #21831.
Note: I don't consider this to supersede #21900. Having a way to apply
nobuiltin
to individual calls is still useful when you don't want to apply it to an entire module, and is important for us to have feature parity with C compilers.@ParfenovIgor note that ae69c8c will introduce a small (but easily fixable) merge conflict with your PR since this PR will likely be merged before Andrew gets around to looking at #21833.