Skip to content

Do not force linking of default link libs in Unix toolchain#19440

Closed
fmeum wants to merge 1 commit intobazelbuild:masterfrom
fmeum:do-not-link-libstdcpp
Closed

Do not force linking of default link libs in Unix toolchain#19440
fmeum wants to merge 1 commit intobazelbuild:masterfrom
fmeum:do-not-link-libstdcpp

Conversation

@fmeum
Copy link
Copy Markdown
Collaborator

@fmeum fmeum commented Sep 7, 2023

libstdc++ (libc++ on macOS) and libm are no longer linked in if none of their symbols are referenced, e.g., in a pure C target.

Fixes #6221

`libstdc++` (`libc++` on macOS) and `libm` are no longer linked in if
none of their symbols are referenced, e.g., in a pure C target.
@fmeum fmeum force-pushed the do-not-link-libstdcpp branch from e51efee to 9727201 Compare September 7, 2023 09:10
@fmeum fmeum marked this pull request as ready for review September 7, 2023 10:46
@github-actions github-actions Bot added awaiting-review PR is awaiting review from an assigned reviewer team-Rules-CPP Issues for C++ rules labels Sep 7, 2023
@buildbreaker2021 buildbreaker2021 added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Sep 7, 2023
@github-actions github-actions Bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Sep 13, 2023
@fmeum fmeum deleted the do-not-link-libstdcpp branch September 13, 2023 12:55
@brentleyjones
Copy link
Copy Markdown
Contributor

Is there a similar change that needs to be made in the apple_support Xcode toolchain?

@fmeum
Copy link
Copy Markdown
Collaborator Author

fmeum commented Sep 13, 2023

Is there a similar change that needs to be made in the apple_support Xcode toolchain?

Not sure. I searched for no-as-needed but didn't find a match, so this toolchain may not be affected. Do you know whether there is an equivalent flag for the Apple linker?

@brentleyjones
Copy link
Copy Markdown
Contributor

I do not know. Do you @keith?

@keith
Copy link
Copy Markdown
Member

keith commented Sep 13, 2023

nope, that toolchain never handled these libs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Rules-CPP Issues for C++ rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C shared libraries depend on libstdc++

4 participants