crowdsec: fix compilation with musl 1.2.4
authorNick Hainke <vincent@systemli.org>
Tue, 16 May 2023 22:20:44 +0000 (00:20 +0200)
committerTianling Shen <cnsztl@gmail.com>
Wed, 17 May 2023 14:01:35 +0000 (22:01 +0800)
commit4ec0459fd3e6c3d1ef446337671b6da5bb30d006
tree2c6affb5593ed54bfd80d7046e411a93fbdd2e2a
parentc2b8dbd08586d7fa225d8164c9a29e3d2aae1186
crowdsec: fix compilation with musl 1.2.4

_LARGEFILE64_SOURCE has to be defined in the source, or CFLAGS can be used
to pass -D_LARGEFILE64_SOURCE to allow to keep using LFS64 definitions.

Fixes errors in the form of:

Building targets
github.com/mattn/go-sqlite3
sqlite3-binding.c:35901:42: error: 'pread64' undeclared here (not in a function); did you mean 'pread'?
35901 |   { "pread64",      (sqlite3_syscall_ptr)pread64,    0  },
      |                                          ^~~~~~~
      |                                          pread
sqlite3-binding.c:35919:42: error: 'pwrite64' undeclared here (not in a function); did you mean 'pwrite'?
35919 |   { "pwrite64",     (sqlite3_syscall_ptr)pwrite64,   0  },
      |                                          ^~~~~~~~
      |                                          pwrite
sqlite3-binding.c: In function 'seekAndRead':
sqlite3-binding.c:35905:49: error: unknown type name 'off64_t'; did you mean 'off_t'?
35905 | #define osPread64 ((ssize_t(*)(int,void*,size_t,off64_t))aSyscall[10].pCurrent)
      |                                                 ^~~~~~~
sqlite3-binding.c:38767:11: note: in expansion of macro 'osPread64'
38767 |     got = osPread64(id->h, pBuf, cnt, offset);
      |           ^~~~~~~~~
sqlite3-binding.c:35905:58: error: expected ')' before 'aSyscall'
35905 | #define osPread64 ((ssize_t(*)(int,void*,size_t,off64_t))aSyscall[10].pCurrent)
      |                   ~                                      ^~~~~~~~
sqlite3-binding.c:38767:11: note: in expansion of macro 'osPread64'
38767 |     got = osPread64(id->h, pBuf, cnt, offset);
      |           ^~~~~~~~~
sqlite3-binding.c: In function 'seekAndWriteFd':
sqlite3-binding.c:35923:57: error: unknown type name 'off64_t'; did you mean 'off_t'?
35923 | #define osPwrite64  ((ssize_t(*)(int,const void*,size_t,off64_t))\
      |                                                         ^~~~~~~
sqlite3-binding.c:38896:17: note: in expansion of macro 'osPwrite64'
38896 |   do{ rc = (int)osPwrite64(fd, pBuf, nBuf, iOff);}while( rc<0 && errno==EINTR);
      |                 ^~~~~~~~~~
sqlite3-binding.c:35924:21: error: expected ')' before 'aSyscall'
35924 |                     aSyscall[13].pCurrent)
      |                     ^~~~~~~~
sqlite3-binding.c:38896:17: note: in expansion of macro 'osPwrite64'
38896 |   do{ rc = (int)osPwrite64(fd, pBuf, nBuf, iOff);}while( rc<0 && errno==EINTR);
      |                 ^~~~~~~~~~
sqlite3-binding.c:35923:21: note: to match this '('
35923 | #define osPwrite64  ((ssize_t(*)(int,const void*,size_t,off64_t))\
      |                     ^
sqlite3-binding.c:38896:17: note: in expansion of macro 'osPwrite64'
38896 |   do{ rc = (int)osPwrite64(fd, pBuf, nBuf, iOff);}while( rc<0 && errno==EINTR);
      |                 ^~~~~~~~~~

make[2]: *** [Makefile:153: /home/nick/openwrt/build_dir/target-aarch64_cortex-a53_musl/crowdsec-1.4.6/.built] Error 1
make[2]: Leaving directory '/home/nick/openwrt/feeds/packages/net/crowdsec'

Signed-off-by: Nick Hainke <vincent@systemli.org>
net/crowdsec/Makefile