diff --git a/pkgs/development/interpreters/guile/2.0.nix b/pkgs/development/interpreters/guile/2.0.nix index ef473214c324..9d207f70c0c7 100644 --- a/pkgs/development/interpreters/guile/2.0.nix +++ b/pkgs/development/interpreters/guile/2.0.nix @@ -90,14 +90,6 @@ builder rec { }) ]; - # Explicitly link against libgcc_s, to work around the infamous - # "libgcc_s.so.1 must be installed for pthread_cancel to work". - - # don't have "libgcc_s.so.1" on darwin - LDFLAGS = lib.optionalString ( - !stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isMusl - ) "-lgcc_s"; - configureFlags = [ "--with-libreadline-prefix" ] @@ -118,6 +110,12 @@ builder rec { env = { NIX_CFLAGS_COMPILE = "-std=gnu17"; + } + // lib.optionalAttrs (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isMusl) { + # Explicitly link against libgcc_s, to work around the infamous + # "libgcc_s.so.1 must be installed for pthread_cancel to work". + # don't have "libgcc_s.so.1" on darwin + LDFLAGS = "-lgcc_s"; }; postInstall = '' diff --git a/pkgs/development/interpreters/guile/2.2.nix b/pkgs/development/interpreters/guile/2.2.nix index 146b29407b30..c48fa78594bd 100644 --- a/pkgs/development/interpreters/guile/2.2.nix +++ b/pkgs/development/interpreters/guile/2.2.nix @@ -85,7 +85,9 @@ builder rec { # "libgcc_s.so.1 must be installed for pthread_cancel to work". # don't have "libgcc_s.so.1" on clang - LDFLAGS = lib.optionalString (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) "-lgcc_s"; + env = lib.optionalAttrs (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) { + LDFLAGS = "-lgcc_s"; + }; configureFlags = [ "--with-libreadline-prefix=${lib.getDev readline}" diff --git a/pkgs/development/interpreters/guile/3.0.nix b/pkgs/development/interpreters/guile/3.0.nix index b0ff7ae3af26..d400a4059cec 100644 --- a/pkgs/development/interpreters/guile/3.0.nix +++ b/pkgs/development/interpreters/guile/3.0.nix @@ -100,11 +100,16 @@ builder rec { sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207"; }); - # Explicitly link against libgcc_s, to work around the infamous - # "libgcc_s.so.1 must be installed for pthread_cancel to work". - - # don't have "libgcc_s.so.1" on clang - LDFLAGS = lib.optionalString (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) "-lgcc_s"; + env = { + # Fix build with gcc15 + NIX_CFLAGS_COMPILE = toString [ "-std=gnu17" ]; + } + // lib.optionalAttrs (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) { + # Explicitly link against libgcc_s, to work around the infamous + # "libgcc_s.so.1 must be installed for pthread_cancel to work". + # don't have "libgcc_s.so.1" on clang + LDFLAGS = "-lgcc_s"; + }; configureFlags = [ "--with-libreadline-prefix=${lib.getDev readline}" @@ -126,9 +131,6 @@ builder rec { # https://github.com/NixOS/nixpkgs/pull/160051#issuecomment-1046193028 ++ lib.optional (stdenv.hostPlatform.isDarwin) "--disable-lto"; - # Fix build with gcc15 - env.NIX_CFLAGS_COMPILE = toString [ "-std=gnu17" ]; - postInstall = '' wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" ''