Merge pull request #51515 from lopsided98/gmp-uname-purity

gmp: don't use uname to detect system features
This commit is contained in:
Jörg Thalheim 2019-01-09 12:22:30 +00:00 committed by GitHub
commit 5611611677
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 14 deletions

View file

@ -29,17 +29,14 @@ let self = stdenv.mkDerivation rec {
#
# no darwin because gmp uses ASM that clang doesn't like
(stdenv.lib.enableFeature (!stdenv.isSunOS && stdenv.hostPlatform.isx86) "fat")
# The config.guess in GMP tries to runtime-detect various
# ARM optimization flags via /proc/cpuinfo (and is also
# broken on multicore CPUs). Avoid this impurity.
"--build=${stdenv.buildPlatform.config}"
] ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions"
++ optional (stdenv.isDarwin && stdenv.is64bit) "ABI=64"
;
# The config.guess in GMP tries to runtime-detect various
# ARM optimization flags via /proc/cpuinfo (and is also
# broken on multicore CPUs). Avoid this impurity.
preConfigure = optionalString stdenv.isAarch32 ''
configureFlagsArray+=("--build=$(./configfsf.guess)")
'';
doCheck = true;
dontDisableStatic = withStatic;

View file

@ -30,18 +30,15 @@ let self = stdenv.mkDerivation rec {
#
# no darwin because gmp uses ASM that clang doesn't like
(stdenv.lib.enableFeature (!stdenv.isSunOS && stdenv.hostPlatform.isx86) "fat")
# The config.guess in GMP tries to runtime-detect various
# ARM optimization flags via /proc/cpuinfo (and is also
# broken on multicore CPUs). Avoid this impurity.
"--build=${stdenv.buildPlatform.config}"
] ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions"
++ optional (stdenv.isDarwin && stdenv.is64bit) "ABI=64"
++ optional (with stdenv.hostPlatform; useAndroidPrebuilt || useiOSPrebuilt) "--disable-assembly"
;
# The config.guess in GMP tries to runtime-detect various
# ARM optimization flags via /proc/cpuinfo (and is also
# broken on multicore CPUs). Avoid this impurity.
preConfigure = optionalString stdenv.isAarch32 ''
configureFlagsArray+=("--build=$(./configfsf.guess)")
'';
doCheck = true; # not cross;
dontDisableStatic = withStatic;