Skip to content

Commit

Permalink
Merge pull request #57824 from illegalprime/fix/libmodbus-cross
Browse files Browse the repository at this point in the history
libmodbus: fix for cross compilation
  • Loading branch information
Mic92 authored Mar 29, 2019
2 parents b903820 bce7e3b commit 382333b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkgs/development/libraries/libmodbus/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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/;
Expand Down

0 comments on commit 382333b

Please sign in to comment.