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

Remove uses of -lstdc++ on darwin #14542

Closed

Conversation

keith
Copy link
Member

@keith keith commented Jan 11, 2022

This flag has been invalid seemingly since macOS 10.9 from 2013. By
default clang remaps this back to -lc++, but if your linkopts pass
-nodefaultlibs this is not the case, in which case this invalid flag
fails the link. This happened for rust builds where the rust driver
passes this flag intentionally.

For more info see #14395 (comment)

Fixes google/cargo-raze#247 #14395 bazelbuild/rules_rust#226

This flag has been invalid seemingly since macOS 10.9 from 2013. By
default clang remaps this back to -lc++, but if your linkopts pass
-nodefaultlibs this is not the case, in which case this invalid flag
fails the link. This happened for rust builds where the rust driver
passes this flag intentionally.

For more info see bazelbuild#14395 (comment)
@uhthomas
Copy link
Contributor

Does this also fix bazelbuild/rules_rust#978?

@keith
Copy link
Member Author

keith commented Jan 11, 2022

I don't think so, I think we'd also have to change

and expand my new conditional to match that. Can you trace back the history of libstdc++ vs libc++ to verify that is a safe change? Either way I guess we can do that in a separate PR just in case.

@aiuto aiuto requested a review from oquenchil January 20, 2022 01:40
Copy link
Contributor

@oquenchil oquenchil left a comment

Choose a reason for hiding this comment

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

LGTM

@uhthomas
Copy link
Contributor

I guess we can do that in a separate PR just in case.

I agree, that sounds like the best thing to do.

For now, is it possible to get this change merged? We're essentially stuck on Bazel 4.2.1 until then.

@bazel-io bazel-io closed this in 8b60c90 Jan 27, 2022
@brentleyjones
Copy link
Contributor

@Wyverald This would be nice to get into 5.0.1.

@Wyverald Wyverald added this to the 5.1 release blockers milestone Jan 27, 2022
@keith keith deleted the ks/remove-uses-of-lstdc-on-darwin branch January 27, 2022 17:47
keith added a commit to keith/bazel that referenced this pull request Jan 29, 2022
This fix is the same as bazelbuild#14542
but for freebsd and openbsd
@keith
Copy link
Member Author

keith commented Jan 29, 2022

I submitted #14668 for the bsds

@Wyverald
Copy link
Member

Wyverald commented Feb 3, 2022

@bazel-io fork 5.1

@Wyverald Wyverald removed this from the 5.1 release blockers milestone Feb 3, 2022
brentleyjones pushed a commit to brentleyjones/bazel that referenced this pull request Feb 8, 2022
This flag has been invalid seemingly since macOS 10.9 from 2013. By
default clang remaps this back to -lc++, but if your linkopts pass
-nodefaultlibs this is not the case, in which case this invalid flag
fails the link. This happened for rust builds where the rust driver
passes this flag intentionally.

For more info see bazelbuild#14395 (comment)

Fixes google/cargo-raze#247 bazelbuild#14395 bazelbuild/rules_rust#226

Closes bazelbuild#14542.

PiperOrigin-RevId: 424588734
(cherry picked from commit 8b60c90)
Wyverald pushed a commit that referenced this pull request Feb 9, 2022
This flag has been invalid seemingly since macOS 10.9 from 2013. By
default clang remaps this back to -lc++, but if your linkopts pass
-nodefaultlibs this is not the case, in which case this invalid flag
fails the link. This happened for rust builds where the rust driver
passes this flag intentionally.

For more info see #14395 (comment)

Fixes google/cargo-raze#247 #14395 bazelbuild/rules_rust#226

Closes #14542.

PiperOrigin-RevId: 424588734
(cherry picked from commit 8b60c90)

Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
bazel-io pushed a commit that referenced this pull request Feb 17, 2022
This fix is the same as #14542
but for freebsd and openbsd

Hopefully fixes bazelbuild/rules_rust#978

Closes #14668.

PiperOrigin-RevId: 429354084
brentleyjones pushed a commit to brentleyjones/bazel that referenced this pull request Feb 17, 2022
This fix is the same as bazelbuild#14542
but for freebsd and openbsd

Hopefully fixes bazelbuild/rules_rust#978

Closes bazelbuild#14668.

PiperOrigin-RevId: 429354084
(cherry picked from commit a987b98)
Wyverald pushed a commit that referenced this pull request Feb 17, 2022
This fix is the same as #14542
but for freebsd and openbsd

Hopefully fixes bazelbuild/rules_rust#978

Closes #14668.

PiperOrigin-RevId: 429354084
(cherry picked from commit a987b98)

Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
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.

macos: ld: library not found for -lstdc++ when compiling no_deps example
6 participants