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

stdenvAdapters.useLibsFrom: use targetStdenv.cc.override

authored by Connor Baker and committed by GitHub f6959c2d 99bba48f

+9 -5
+9 -5
pkgs/stdenv/adapters.nix
··· 237 }); 238 }); 239 240 useLibsFrom = modelStdenv: targetStdenv: 241 let 242 ccForLibs = modelStdenv.cc.cc; 243 - cc = pkgs.wrapCCWith { 244 - /* NOTE: cc.cc is the unwrapped compiler. Should we respect the old 245 - * wrapper instead? */ 246 - cc = targetStdenv.cc.cc; 247 - 248 /* NOTE(originally by rrbutani): 249 * Normally the `useCcForLibs`/`gccForLibs` mechanism is used to get a 250 * clang based `cc` to use `libstdc++` (from gcc).
··· 237 }); 238 }); 239 240 + /* Copy the libstdc++ from the model stdenv to the target stdenv. 241 + * 242 + * TODO(@connorbaker): 243 + * This interface provides behavior which should be revisited prior to the 244 + * release of 24.05. For a more detailed explanation and discussion, see 245 + * https://github.com/NixOS/nixpkgs/issues/283517. */ 246 useLibsFrom = modelStdenv: targetStdenv: 247 let 248 ccForLibs = modelStdenv.cc.cc; 249 + /* NOTE(@connorbaker): 250 + * This assumes targetStdenv.cc is a cc-wrapper. */ 251 + cc = targetStdenv.cc.override { 252 /* NOTE(originally by rrbutani): 253 * Normally the `useCcForLibs`/`gccForLibs` mechanism is used to get a 254 * clang based `cc` to use `libstdc++` (from gcc).