diff --git a/pkgs/development/libraries/gmp/5.0.3.nix b/pkgs/development/libraries/gmp/5.0.3.nix index 8c3d24d2d113..dbc9e83ed8d2 100644 --- a/pkgs/development/libraries/gmp/5.0.3.nix +++ b/pkgs/development/libraries/gmp/5.0.3.nix @@ -1,6 +1,6 @@ { stdenv, fetchurl, m4, cxx ? true }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (rec { name = "gmp-5.0.3"; src = fetchurl { @@ -51,3 +51,21 @@ stdenv.mkDerivation rec { platforms = stdenv.lib.platforms.all; }; } + +// + +(if stdenv.isFreeBSD + then { + # On FreeBSD, GMP's `config.guess' detects the sub-architecture (e.g., + # "k8") and generates code specific to that sub-architecture, in spite of + # `--enable-fat', leading to illegal instructions and similar errors on + # machines with a different sub-architecture. + # See , for an example. + # Thus, use GNU's standard `config.guess' so that it assumes the generic + # architecture (e.g., "x86_64"). + preConfigure = + '' rm config.guess && ln -s configfsf.guess config.guess + chmod +x configfsf.guess. + ''; + } + else { }))