From 14de0380da76de3f4cd662a9ef2352eed0c95b7d Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Wed, 22 May 2024 20:18:51 -0700 Subject: [PATCH] binutils: do not build with -static-libgcc on FreeBSD --- pkgs/development/tools/misc/binutils/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index c707d0daec89..adcde34556ce 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -170,8 +170,13 @@ stdenv.mkDerivation (finalAttrs: { # As binutils takes part in the stdenv building, we don't want references # to the bootstrap-tools libgcc (as uses to happen on arm/mips) + # + # for FreeBSD it's more complicated. With -static-libgcc, configure + # thinks that limits.h does not exist and the build fails for not finding + # LONG_MIN. The configure test itself succeeds but the compiler issues a + # warning about -static-libgcc being unused. env.NIX_CFLAGS_COMPILE = - if hostPlatform.isDarwin + if (hostPlatform.isDarwin || hostPlatform.isFreeBSD) then "-Wno-string-plus-int -Wno-deprecated-declarations" else "-static-libgcc";