···237237 });
238238 });
239239240240+ /* Copy the libstdc++ from the model stdenv to the target stdenv.
241241+ *
242242+ * TODO(@connorbaker):
243243+ * This interface provides behavior which should be revisited prior to the
244244+ * release of 24.05. For a more detailed explanation and discussion, see
245245+ * https://github.com/NixOS/nixpkgs/issues/283517. */
240246 useLibsFrom = modelStdenv: targetStdenv:
241247 let
242248 ccForLibs = modelStdenv.cc.cc;
243243- cc = pkgs.wrapCCWith {
244244- /* NOTE: cc.cc is the unwrapped compiler. Should we respect the old
245245- * wrapper instead? */
246246- cc = targetStdenv.cc.cc;
247247-249249+ /* NOTE(@connorbaker):
250250+ * This assumes targetStdenv.cc is a cc-wrapper. */
251251+ cc = targetStdenv.cc.override {
248252 /* NOTE(originally by rrbutani):
249253 * Normally the `useCcForLibs`/`gccForLibs` mechanism is used to get a
250254 * clang based `cc` to use `libstdc++` (from gcc).