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

[Driver] TSan runtime now has a link-time dependency on libdispatch #23645

Merged
merged 1 commit into from Apr 1, 2019

Conversation

Projects
None yet
4 participants
@yln
Copy link
Contributor

yln commented Mar 29, 2019

Previously, the TSan runtime only required libdispatch on Darwin, which
required no explicit linker flags, because libdispatch is always
provided by the system (via libSystem).

Now, the TSan runtime also has a link-time dependency on libdispatch on
Linux, where libdispatch (and the blocks runtime) is just another
library. We therefore need to specify them as additional linker options.

[Driver] TSan runtime now has a link-time dependency on libdispatch
Previously, the TSan runtime only required libdispatch on Darwin, which
required no explicit linker flags, because libdispatch is always
provided by the system (libSystem).

Now, the TSan runtime also has a link-time dependency on libdispatch on
Linux, where libdispatch (and the blocks runtime) is just another
library. We therefore need to specify them as additonal linker options.

@yln yln self-assigned this Mar 29, 2019

@yln

This comment has been minimized.

Copy link
Contributor Author

yln commented Mar 29, 2019

@swift-ci please test


// The TSan runtime depends on the blocks runtime and libdispatch.
if (context.OI.SelectedSanitizers & SanitizerKind::Thread) {
Arguments.push_back("-lBlocksRuntime");

This comment has been minimized.

Copy link
@compnerd

compnerd Mar 29, 2019

Collaborator

This is slightly worrisome. -fblocks-runtime-optional controls where you have a blocks runtime library or not that you link against. (The GNU ObjC runtime also provides the blocks runtime implicitly). I wish that we could delegate to the clang driver for the blocks runtime linkage.

This comment has been minimized.

Copy link
@yln

yln Apr 1, 2019

Author Contributor

[...] delegate to the clang driver for the blocks runtime linkage.

This is what I am trying to do here. I don't really understand what you mean. What should we do instead?

@swift-ci

This comment has been minimized.

Copy link
Contributor

swift-ci commented Mar 29, 2019

Build failed
Swift Test Linux Platform
Git Sha - 1cac0be

@yln

This comment has been minimized.

Copy link
Contributor Author

yln commented Mar 29, 2019

@swift-ci please test Linux

@yln yln requested review from jrose-apple, brentdax and devincoughlin Apr 1, 2019

@yln yln merged commit da45361 into master Apr 1, 2019

4 checks passed

Swift Test Linux Platform No test results found.
Details
Swift Test Linux Platform (smoke test)
Details
Swift Test OS X Platform No test results found.
Details
Swift Test OS X Platform (smoke test)
Details

@yln yln deleted the driver-tsan-linux-linker-flags branch Apr 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.