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

disable ubsan null checks with gcc #93

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

oliverlee
Copy link
Collaborator

@oliverlee oliverlee commented Sep 27, 2023

Use of GCC with UBSan and the null, returns-nonnull-attribute,
nonnull-attribute checks will cause the compiler to reject valid code
due to use of the underlying GCC option -fno-delete-null-pointer-checks.

This commit patches rules_cc to disable these checks if a GCC compiler
is used with the ubsan feature.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67762#c2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962

This change is needed by #89.

Change-Id: Ic0e5224850d8478aa92806a8f21248e979acce04

@codecov-commenter
Copy link

codecov-commenter commented Sep 27, 2023

Codecov Report

Merging #93 (d1c8b2e) into master (199bc3e) will not change coverage.
The diff coverage is n/a.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@           Coverage Diff           @@
##           master      #93   +/-   ##
=======================================
  Coverage   98.82%   98.82%           
=======================================
  Files          11       11           
  Lines         255      255           
=======================================
  Hits          252      252           
  Misses          3        3           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Owner

@garymm garymm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh. I hate carrying patches. OK for now I guess.

WORKSPACE.bazel Outdated Show resolved Hide resolved
WORKSPACE.bazel Outdated Show resolved Hide resolved
toolchain/rules_cc-gcc-ubsan-no-sanitize-null.patch Outdated Show resolved Hide resolved
@oliverlee
Copy link
Collaborator Author

oliverlee commented Sep 28, 2023 via email

Use of GCC with UBSan and the null, returns-nonnull-attribute,
nonnull-attribute checks will cause the compiler to reject valid code
due to use of the underlying GCC option -fno-delete-null-pointer-checks.

This commit patches rules_cc to disable these checks if a GCC compiler
is used with the ubsan feature.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67762#c2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962

This change is needed by #89.

Change-Id: Ic0e5224850d8478aa92806a8f21248e979acce04
@oliverlee oliverlee changed the base branch from If703d0b0a6307ebcf9e64722431069247ba51800 to master October 5, 2023 00:28
@oliverlee oliverlee force-pushed the Ic0e5224850d8478aa92806a8f21248e979acce04 branch from 9db71f1 to d1c8b2e Compare October 5, 2023 00:28
@oliverlee oliverlee requested a review from garymm October 5, 2023 00:28
@oliverlee oliverlee enabled auto-merge (squash) October 5, 2023 00:29
@oliverlee oliverlee merged commit ec4c69b into master Oct 5, 2023
26 checks passed
@oliverlee oliverlee deleted the Ic0e5224850d8478aa92806a8f21248e979acce04 branch October 5, 2023 00:45
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

Successfully merging this pull request may close these issues.

3 participants