Merge pull request #281371 from ConnorBaker/feat/stdenvAdapters-useLibsFrom-specify-coreutils

stdenvAdapters.useLibsFrom: use targetStdenv.cc.override
This commit is contained in:
Connor Baker 2024-03-20 13:14:42 -04:00 committed by GitHub
commit f6959c2de3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -237,14 +237,18 @@ rec {
});
});
/* Copy the libstdc++ from the model stdenv to the target stdenv.
*
* TODO(@connorbaker):
* This interface provides behavior which should be revisited prior to the
* release of 24.05. For a more detailed explanation and discussion, see
* https://github.com/NixOS/nixpkgs/issues/283517. */
useLibsFrom = modelStdenv: targetStdenv:
let
ccForLibs = modelStdenv.cc.cc;
cc = pkgs.wrapCCWith {
/* NOTE: cc.cc is the unwrapped compiler. Should we respect the old
* wrapper instead? */
cc = targetStdenv.cc.cc;
/* NOTE(@connorbaker):
* This assumes targetStdenv.cc is a cc-wrapper. */
cc = targetStdenv.cc.override {
/* NOTE(originally by rrbutani):
* Normally the `useCcForLibs`/`gccForLibs` mechanism is used to get a
* clang based `cc` to use `libstdc++` (from gcc).