From bce7e3b5853595b1306f76a54f7e201c51c7dbeb Mon Sep 17 00:00:00 2001 From: Michael Eden Date: Sat, 16 Mar 2019 11:53:14 -0400 Subject: libmodbus: fix for cross compilation --- pkgs/development/libraries/libmodbus/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pkgs/development/libraries/libmodbus') diff --git a/pkgs/development/libraries/libmodbus/default.nix b/pkgs/development/libraries/libmodbus/default.nix index 10bd7af7fadd4..d1ee30698a097 100644 --- a/pkgs/development/libraries/libmodbus/default.nix +++ b/pkgs/development/libraries/libmodbus/default.nix @@ -8,6 +8,16 @@ stdenv.mkDerivation rec { sha256 = "0drnil8bzd4n4qb0wv3ilm9zvypxvwmzd65w96d6kfm7x6q65j68"; }; + configureFlags = [ + # when cross-compiling we assume that the host system will return a valid + # pointer for calls to malloc(0) or realloc(0) + # https://www.uclibc.org/FAQ.html#gnu_malloc + # https://www.gnu.org/software/autoconf/manual/autoconf.html#index-AC_005fFUNC_005fMALLOC-454 + # the upstream source should be patched to avoid needing this + "ac_cv_func_malloc_0_nonnull=yes" + "ac_cv_func_realloc_0_nonnull=yes" + ]; + meta = with stdenv.lib; { description = "Library to send/receive data according to the Modbus protocol"; homepage = http://libmodbus.org/; -- cgit 1.4.1