git.iko.soy/typeable/nixpkgs
on master help sign in
libgcrypt: fix clang build

Fixes #27906 Because #pragma GCC optimize ("O0") doesn't work for clang and NIX_CFLAGS_COMPILE bypasses the fixup done by the makefiles everything gets compiled with -O2. The build still uses optimisation for everything else.

commit07796ccb578e44b8545133bb7dc2a73537d94c59 authorDaiderd Jordan <daiderd@gmail.com> dateSat 5 Aug 2017, 15:20 (9 years ago) parenteb7312c
1 file changed+8−4
pkgs/development/libraries/libgcrypt/default.nix+8−4
pkgs/development/libraries/libgcrypt/default.nix+8−4
@@ -1,4 +1,4 @@
1−{ lib, stdenv, fetchurl, libgpgerror, enableCapabilities ? false, libcap }:
1+{ stdenv, fetchurl, libgpgerror, enableCapabilities ? false, libcap }:
22
33assert enableCapabilities -> stdenv.isLinux;
44
@@ -14,9 +14,13 @@ stdenv.mkDerivation rec {
1414 outputs = [ "out" "dev" "info" ];
1515 outputBin = "dev";
1616
17− buildInputs =
18− [ libgpgerror ]
19− ++ lib.optional enableCapabilities libcap;
17+ # The CPU Jitter random number generator must not be compiled with
18+ # optimizations and the optimize -O0 pragma only works for gcc.
19+ # The build enables -O2 by default for everything else.
20+ hardeningDisable = stdenv.lib.optional stdenv.cc.isClang "fortify";
21+
22+ buildInputs = [ libgpgerror ]
23+ ++ stdenv.lib.optional enableCapabilities libcap;
2024
2125 # Make sure libraries are correct for .pc and .la files
2226 # Also make sure includes are fixed for callers who don't use libgpgcrypt-config