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

Only add sanitizer runtimes when linking an executable (#64629). #64780

Merged
merged 1 commit into from Oct 7, 2019

Conversation

@choller
Copy link
Contributor

commented Sep 25, 2019

This change modifies the code to only add sanitizer runtimes if we are linking an executable, as those runtimes should never be part of libraries. I successfully compiled mozilla-central with ASan using this patch.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Sep 25, 2019

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @zackmdavis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@choller

This comment has been minimized.

Copy link
Contributor Author

commented Sep 25, 2019

Just to clarify, this will fix issue #64629 and ensure that we match Clang's behavior with respect to DSO linking. There is no corresponding code for the static library case because static libraries are typically produced directly by invoking ar. Especially since static libraries can be linked into DSOs again, they should never contain sanitizer runtimes either.

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

commented Oct 2, 2019

Thanks for the PR, @choller! This looks correct to me. The logic in Clang seems to be quite a bit more complicated but for rustc's limited support, this looks good.

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Oct 2, 2019

📌 Commit 640c261 has been approved by michaelwoerister

@bors

This comment has been minimized.

Copy link
Contributor

commented Oct 2, 2019

⌛️ Testing commit 640c261 with merge 9de12ba...

bors added a commit that referenced this pull request Oct 2, 2019
Only add sanitizer runtimes when linking an executable (#64629).

This change modifies the code to only add sanitizer runtimes if we are linking an executable, as those runtimes should never be part of libraries. I successfully compiled `mozilla-central` with ASan using this patch.
@bors

This comment has been minimized.

Copy link
Contributor

commented Oct 2, 2019

💥 Test timed out

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

commented Oct 7, 2019

@bors retry

@bors

This comment has been minimized.

Copy link
Contributor

commented Oct 7, 2019

⌛️ Testing commit 640c261 with merge 59a31c8...

bors added a commit that referenced this pull request Oct 7, 2019
Only add sanitizer runtimes when linking an executable (#64629).

This change modifies the code to only add sanitizer runtimes if we are linking an executable, as those runtimes should never be part of libraries. I successfully compiled `mozilla-central` with ASan using this patch.
@bors

This comment has been minimized.

Copy link
Contributor

commented Oct 7, 2019

☀️ Test successful - checks-azure
Approved by: michaelwoerister
Pushing 59a31c8 to master...

@bors bors added the merged-by-bors label Oct 7, 2019
@bors bors merged commit 640c261 into rust-lang:master Oct 7, 2019
5 checks passed
5 checks passed
homu Test successful
Details
pr Build #20190925.50 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-6.0) Linux x86_64-gnu-llvm-6.0 succeeded
Details
pr (LinuxTools) LinuxTools succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.