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

Always use LLD on darwin #380

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dzbarsky
Copy link
Contributor

It sounds like a few folks have tried the -fuse-ld=lld option and it works for them, so let's try to roll it out more broadly.

@dzbarsky dzbarsky force-pushed the zbarsky/only-lld branch 13 times, most recently from 5068712 to 780b391 Compare August 29, 2024 00:38
@dzbarsky
Copy link
Contributor Author

dzbarsky commented Aug 29, 2024

@rrbutani are you the right person to take a look at this? I tried to keep the cmd lines generated the same as we did before this change (when running with --linkopt=-fuseld=ld64.lld) with the exception of the link sections, but perhaps we can change some of the flags for non-xcompile to the lld variants and simplify things further?

@@ -228,7 +210,19 @@ def cc_toolchain_config(
"-Bdynamic",
"-L{}lib".format(toolchain_path_prefix),
])

else:
# For single-platform builds, we can statically link the bundled
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this comment is preexisting but I don't think it's correct?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it actually might be right because of this bit here:

if stdlib == "builtin-libc++" and is_xcompile:
stdlib = "stdc++"

i.e. builtin-libc++ implies not is_xcompile, and this arm has exec_os != "darwin" implying linux (exec) -> linux (target)

Copy link
Collaborator

Choose a reason for hiding this comment

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

definitely no objection to rewording that comment though

Copy link
Collaborator

@rrbutani rrbutani left a comment

Choose a reason for hiding this comment

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

Apologies for the delay — unfortunately I haven't really kept up with the state of lld on darwin and no longer have a machine to test this on.

However, everything in this PR looks good to me. Appreciate the cleanup as well.

@@ -228,7 +210,19 @@ def cc_toolchain_config(
"-Bdynamic",
"-L{}lib".format(toolchain_path_prefix),
])

else:
# For single-platform builds, we can statically link the bundled
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it actually might be right because of this bit here:

if stdlib == "builtin-libc++" and is_xcompile:
stdlib = "stdc++"

i.e. builtin-libc++ implies not is_xcompile, and this arm has exec_os != "darwin" implying linux (exec) -> linux (target)

@@ -228,7 +210,19 @@ def cc_toolchain_config(
"-Bdynamic",
"-L{}lib".format(toolchain_path_prefix),
])

else:
# For single-platform builds, we can statically link the bundled
Copy link
Collaborator

Choose a reason for hiding this comment

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

definitely no objection to rewording that comment though

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.

2 participants