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

Fix for #3374 #3475

Merged
merged 2 commits into from
Aug 15, 2020
Merged

Conversation

dbankov-vmware
Copy link
Contributor

Introduce -platformlib option to control libraries added automatically for Windows targets.

@@ -85,6 +94,26 @@ void addSanitizerLibs(std::vector<std::string> &args) {

//////////////////////////////////////////////////////////////////////////////

static std::vector<std::string> getPlatformLibNames() {
Copy link
Member

Choose a reason for hiding this comment

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

Thx for following up. - Please move this to linker.cpp (perhaps as getExplicitPlatformLibs() returning an llvm::Optional<std::vector<string>>) as we'll support this option for Posix targets too (see here). The tokenizing can then be extracted as little helper, used for both -defaultlib and -platformlib.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Finally got some time to do this. I'm sorry for the delay.
Please take a look and let me know if I should change something.

Copy link
Member

Choose a reason for hiding this comment

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

No worries. - I've pushed a commit, slightly revising a few things, extending it to Posix targets too as well as extending the tests as requested by Johan.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you very much Kinke!
I was going to take care of this over the weekend as I've been quite busy at work lately...

Introduce -platformlib option to control libraries added automatically for Windows targets.
* -mtriple=x86_64-unknown-windows-coff.
*/

// RUN: not %ldc -v -mtriple=x86_64-unknown-windows-coff -platformlib= %s | FileCheck %s
Copy link
Member

Choose a reason for hiding this comment

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

can you also add a testcase where you pass some strings through the new option?

@kinke kinke merged commit e1ecb41 into ldc-developers:master Aug 15, 2020
@kinke
Copy link
Member

kinke commented Aug 15, 2020

[I've apparently hit some GitHub bug while merging this - this shouldn't have been a squash-merge, plus I've customized the merge commit msg - then got an error and pressed a retry button, which squash-merged it without further confirmation...]

@dbankov-vmware
Copy link
Contributor Author

I'm not particularly proud of my part of the change so IMO it is better that things happened this way :).

@dbankov-vmware dbankov-vmware deleted the platformlib-option branch August 17, 2020 13:10
@kinke
Copy link
Member

kinke commented Aug 18, 2020

Well, if it wasn't for you and your initiative, we wouldn't have this. :) - This wasn't a squash merge, but a normal merge with the actual merge commit (title + msg) looking like a squash-merge-commit...

@denizzzka
Copy link
Contributor

What exactly is the difference between --platformlib and --defaultlib?

@kinke
Copy link
Member

kinke commented Aug 11, 2024

IIRC, mainly that -defaultlib doesn't apply to -betterC, and that the default lib names are affected by -link-defaultlib-{shared,debug} (extra suffix). And for a simpler overriding of the default libs, e.g., -defaultlib=druntime-ldc when wanting to exclude Phobos, or -defaultlib=phobos2-ldc-lto,druntime-ldc-to to use the LTO variants.

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.

4 participants