Skip to content

Link sanitizers when creating dynamic libraries on macOS #74793

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
merged 1 commit into from
Aug 13, 2020

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Jul 26, 2020

Link sanitizer runtime when creating dynamic libraries on macOS
to resolve sanitizer runtime symbols and avoid failure at link time.

Closes #74571.

@rust-highfive
Copy link
Contributor

r? @kennytm

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 26, 2020
@tmiasko tmiasko marked this pull request as ready for review July 26, 2020 21:23
@Dylan-DPC-zz
Copy link

r? @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

This seems somewhat reasonable, but it's not clear to me why it wasn't needed for Linux. Do we implicitly link to sanitizers there? Why is that not happening on macOS?

I think that merits some comments in the code.

Regardless, I'm not really familiar enough with sanitizers to do more than rubber stamp this. I guess let's cc @cuviper @nikic and @nagisa as LLVM wg (since that's where our sanitizers come from); can one of you either take over review or suggest an assignee?

@tmiasko
Copy link
Contributor Author

tmiasko commented Aug 13, 2020

Added a comment explaining the rationale. The implementation as usual is intended to follow clang, except that we currently don't have any switches to select between static / shared type of runtime on targets were both could be supported.

@cuviper
Copy link
Member

cuviper commented Aug 13, 2020

The explanation makes sense to me, but I don't know enough about the macOS target to approve this change.

@Mark-Simulacrum
Copy link
Member

That explanation feels sufficient to me, so I'm going to @bors r+

That said I'm mostly only approving because this affects sanitizers only which are unstable.

@bors
Copy link
Collaborator

bors commented Aug 13, 2020

📌 Commit 4fbbc81 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2020
@bors
Copy link
Collaborator

bors commented Aug 13, 2020

⌛ Testing commit 4fbbc81 with merge b6396b7...

@bors
Copy link
Collaborator

bors commented Aug 13, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: Mark-Simulacrum
Pushing b6396b7 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 13, 2020
@bors bors merged commit b6396b7 into rust-lang:master Aug 13, 2020
@tmiasko tmiasko deleted the san-macos branch August 13, 2020 19:37
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Address sanitizer fails to link on nightly-x86_64-apple-darwin toolchain
7 participants