From 4284a14ef78f372ad11a698ec1bb3c29e8a39dc7 Mon Sep 17 00:00:00 2001 From: Luna Nova Date: Tue, 30 Sep 2025 09:20:01 -0700 Subject: [PATCH] tests.cc-wrapper: regression test for fuse-ld=gold In #49071 fuse-ld=gold was broken in pkgsMusl. Adds a test that fuse-ld=gold works in cc-wrapper so pkgsMusl.tests.cc-wrapper.default can be used to verify this has not regressed. --- pkgs/test/cc-wrapper/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/test/cc-wrapper/default.nix b/pkgs/test/cc-wrapper/default.nix index 8d1bdbf3fed1..9dc3413f0e04 100644 --- a/pkgs/test/cc-wrapper/default.nix +++ b/pkgs/test/cc-wrapper/default.nix @@ -116,6 +116,16 @@ stdenv.mkDerivation { '' } + ${ + # Check whether fuse-ld=gold works on our GNU toolchain + # Regression test for https://github.com/NixOS/nixpkgs/issues/49071 + lib.optionalString stdenv.cc.isGNU '' + echo "checking whether compiler builds valid C binaries... " >&2 + CFLAGS="-fuse-ld=gold" ${CC} -o cc-check ${./cc-main.c} + ${emulator} ./cc-check + '' + } + echo "checking whether compiler uses NIX_CFLAGS_COMPILE... " >&2 mkdir -p foo/include cp ${./foo.c} foo/include/foo.h