Skip to content

[Backport staging-23.05] cc-wrapper: fix linking against GCC libs for non-GCC#267737

Merged
Artturin merged 1 commit intostaging-23.05from
backport-192459-to-staging-23.05
Nov 24, 2023
Merged

[Backport staging-23.05] cc-wrapper: fix linking against GCC libs for non-GCC#267737
Artturin merged 1 commit intostaging-23.05from
backport-192459-to-staging-23.05

Conversation

@github-actions
Copy link
Contributor

Bot-based backport to staging-23.05, triggered by a label in #192459.

  • Before merging, ensure that this backport is acceptable for the release.
    • Even as a non-commiter, if you find that it is not acceptable, leave a comment.

Currently, clang++ statically links against libstdc++ instead of
dynamically links, because the -L path included in the cc-wrapper is
incorrect. The gccForLibs.lib output only contains the architecture
subdirectory if the target and host platform are not the same. (See
targetConfig set in gcc/<version>/default.nix and the gcc/builder.nix)

This fixes the incorrect linking by using the correct path for both the
cross and native cases. This also matches the cc_solib set above in
cc-wrapper/default.nix

Tested by compiling a simple cpp binary and noting that it now correctly
dynamically links against libstdc++, natively on x86_64 and arm64, as
well as x86_64 -> arm64 cross compilation.

Co-Authored-By: Sebastian Ullrich <sebasti@nullri.ch>
(cherry picked from commit 2946b81)
@Artturin Artturin closed this Nov 15, 2023
@Artturin Artturin reopened this Nov 15, 2023
@ofborg ofborg bot added 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Nov 15, 2023
@Artturin Artturin merged commit fec1780 into staging-23.05 Nov 24, 2023
@Artturin Artturin deleted the backport-192459-to-staging-23.05 branch November 24, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants