pkgs/development/libraries/crypto++: fixed build impurity
* Don't build with "-march=native", because the generated binaries won't work reliably on systems with a different CPU. Instead, "--march=i686" is used on x86, and "--march=nocona" an x86_64. Otherwise, "--march" remains unset. * Compile with -O3 instead of -O2. This code is performance-critical. * Don't build with '-g'. svn path=/nixpkgs/trunk/; revision=22785
This commit is contained in:
parent
d81ed8201f
commit
b89f310c7a
2 changed files with 11 additions and 1 deletions
|
@ -24,6 +24,17 @@ stdenv.mkDerivation rec {
|
|||
sourceRoot="$PWD/${name}"
|
||||
'';
|
||||
|
||||
cxxflags = if stdenv.isi686 then "-march=i686" else
|
||||
if stdenv.isx86_64 then "-march=nocona" else
|
||||
"";
|
||||
|
||||
configurePhase = ''
|
||||
sed -i GNUmakefile \
|
||||
-e 's|-march=native|${cxxflags}|g' \
|
||||
-e 's|-mtune=native||g' \
|
||||
-e '/^CXXFLAGS =/s|-g -O2|-O3|'
|
||||
'';
|
||||
|
||||
# Deal with one of the crappiest build system around there.
|
||||
buildPhase = ''
|
||||
# These guys forgot a file or something.
|
||||
|
|
|
@ -3761,7 +3761,6 @@ let
|
|||
};
|
||||
|
||||
cryptopp = import ../development/libraries/crypto++ {
|
||||
# SIDE-EFFECT WARNING: crypto++-5.6.0 is compiled with "-O2 -march=native -mtune=native".
|
||||
inherit fetchurl stdenv unzip libtool;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue