@@ -1,4 +1,7 @@
1−{ fetchurl, stdenv, gettext, glibc }:
2+, gettext, glibc
3+, buildPlatform, hostPlatform
3stdenv.mkDerivation rec {
6stdenv.mkDerivation rec {
4 name = "libelf-0.8.13";
7 name = "libelf-0.8.13";
@@ -8,20 +11,20 @@ stdenv.mkDerivation rec {
8 sha256 = "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr";
11 sha256 = "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr";
14+ # TODO(@Ericson2314) Make unconditional next hash break
15+ patches = if hostPlatform == buildPlatform then null else [
11 doCheck = true;
19 doCheck = true;
13 # FIXME needs gcc 4.9 in bootstrap tools
21 # FIXME needs gcc 4.9 in bootstrap tools
14 hardeningDisable = [ "stackprotector" ];
22 hardeningDisable = [ "stackprotector" ];
16− # For cross-compiling, native glibc is needed for the "gencat" program.
18− nativeBuildInputs = [ gettext glibc ];
21 # Libelf's custom NLS macros fail to determine the catalog file extension on
24 # Libelf's custom NLS macros fail to determine the catalog file extension on
22 # Darwin, so disable NLS for now.
25 # Darwin, so disable NLS for now.
23 # FIXME: Eventually make Gettext a build input on all platforms.
26 # FIXME: Eventually make Gettext a build input on all platforms.
24− configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-nls";
27+ configureFlags = stdenv.lib.optional hostPlatform.isDarwin "--disable-nls";
26 nativeBuildInputs = [ gettext ];
29 nativeBuildInputs = [ gettext ];