-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add UBSan support for C family languages #1733
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
Conversation
Sources/Build/Sanitizers.swift
Outdated
} | ||
|
||
/// Sanitization flags for the Swift compiler. | ||
public func compileSwiftFlags() -> [String] { | ||
return sanitizers.map({ "-sanitize=\($0.rawValue)" }) | ||
// UBSan is only available for C family languages | ||
return sanitizers.filter{ $0 != .undefined }.map{ $0.flagName } |
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.
this used to return -sanitize=asan
and now is -fsanitize=asan
, that's intentional?
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.
Wait, this is an old commit, one sec
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.
@keith - thats actually not correct though, before it was -sanitize=address
and the asan
/tsan
values were used to create the dylib path to the santizer runtime
d1077fb
to
0a6cfcf
Compare
@keith - Forgot to push my more recent changes, updated now! |
@@ -0,0 +1,3 @@ | |||
# CUBSan | |||
|
|||
A description of this package. |
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.
Hm? ;)
@@ -0,0 +1 @@ | |||
int main(int argc, char **argv); |
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.
The header is not required.
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.
Yeah I agree, if anything this seems like the linking testing is happening in the Swift PR and should be sufficient. Should we just remove the fixture entirely then?
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.
LGTM. We don't actually need the test case as we're doing anything extra at the swiftpm level.
0a6cfcf
to
0fcf93f
Compare
Cool, thanks! |
I'll hold off merging until swiftlang/swift#18553 is merged |
@swift-ci smoke test |
@aciidb0mb3r - Finally got back to this. I believe I figured out the test issues and updated my swift pr here swiftlang/swift#18553. Feel free to re-test |
@aciidb0mb3r - Swift PR just merged so this should be good to go! |
Thanks! |
Please test with following pull request:
swiftlang/swift#18553