From 52f4dd95d4c34fbf6b95e61e846002a11fc3e093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 11 Apr 2012 16:38:21 +0000 Subject: [PATCH] GMP 5.0.3: Fix FreeBSD builds. svn path=/nixpkgs/trunk/; revision=33748 --- pkgs/development/libraries/gmp/5.0.3.nix | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/gmp/5.0.3.nix b/pkgs/development/libraries/gmp/5.0.3.nix index 8c3d24d2d11..dbc9e83ed8d 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 { }))