Coova-Chilli Compile Error

Hi everyone, I got the following error when compiling coova-chilli on Openwrt/Lede 17.04.1:

make[6]: Entering directory '/home/openwrt/doc_version_install/openwrt/build_dir/target-x86_64_glibc-2.24/coova-chilli-1.3.0+20141128/src'
/bin/bash ../libtool  --tag=CC   --mode=compile x86_64-openwrt-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..   -I/home/openwrt/doc_version_install/openwrt/staging_dir/target-x86_64_glibc-2.24/usr/include -I/home/openwrt/doc_version_install/openwrt/staging_dir/target-x86_64_glibc-2.24/include -I/home/openwrt/doc_version_install/openwrt/staging_dir/toolchain-x86_64_gcc-5.4.0_glibc-2.24/usr/include -I/home/openwrt/doc_version_install/openwrt/staging_dir/toolchain-x86_64_gcc-5.4.0_glibc-2.24/include  -D_GNU_SOURCE -Wall -Werror -fno-builtin -fno-strict-aliasing -O2 -fomit-frame-pointer -funroll-loops -pipe -I../bstring -DDEFCHILLICONF='"/etc/chilli.conf"' -DDEFPIDFILE='"/var/run/chilli.pid"' -DDEFSTATEDIR='"/var/run"' -DSBINDIR='"/usr/sbin"'    -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -iremap /home/openwrt/doc_version_install/openwrt/build_dir/target-x86_64_glibc-2.24/coova-chilli-1.3.0+20141128:coova-chilli-1.3.0+20141128 -fpic  -MT chilli.lo -MD -MP -MF .deps/chilli.Tpo -c -o chilli.lo chilli.c
OpenWrt-libtool: compile:  x86_64-openwrt-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -I/home/openwrt/doc_version_install/openwrt/staging_dir/target-x86_64_glibc-2.24/usr/include -I/home/openwrt/doc_version_install/openwrt/staging_dir/target-x86_64_glibc-2.24/include -I/home/openwrt/doc_version_install/openwrt/staging_dir/toolchain-x86_64_gcc-5.4.0_glibc-2.24/usr/include -I/home/openwrt/doc_version_install/openwrt/staging_dir/toolchain-x86_64_gcc-5.4.0_glibc-2.24/include -D_GNU_SOURCE -Wall -Werror -fno-builtin -fno-strict-aliasing -O2 -fomit-frame-pointer -funroll-loops -pipe -I../bstring -DDEFCHILLICONF=\"/etc/chilli.conf\" -DDEFPIDFILE=\"/var/run/chilli.pid\" -DDEFSTATEDIR=\"/var/run\" -DSBINDIR=\"/usr/sbin\" -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -iremap /home/openwrt/doc_version_install/openwrt/build_dir/target-x86_64_glibc-2.24/coova-chilli-1.3.0+20141128:coova-chilli-1.3.0+20141128 -fpic -MT chilli.lo -MD -MP -MF .deps/chilli.Tpo -c chilli.c  -fPIC -DPIC -o .libs/chilli.o
chilli.c: In function 'acct_req':
chilli.c:1861:17: error: storage size of 'the_info' isn't known
  struct sysinfo the_info;
                 ^
chilli.c:1861:17: error: unused variable 'the_info' [-Werror=unused-variable]
cc1: all warnings being treated as errors
Makefile:900: recipe for target 'chilli.lo' failed
make[6]: *** [chilli.lo] Error 1
make[6]: Leaving directory '/home/openwrt/doc_version_install/openwrt/build_dir/target-x86_64_glibc-2.24/coova-chilli-1.3.0+20141128/src'

It seems like it couldn't find sysinfo struct, so the memory set for the variable 'the_info' can't be created. Does anyone have an idea to solve this situation?

Thanks.

You might consider to file a bug, as I suspect, your issue is target-specific. I have chiilis built for ramips and ar71xx without problems.

It was build for a x86_64, with glibc.

Coova-Chilli was recently updated to 1.4 in the packages repo. This may help. Your issue is glibc specific I think.

It's because "struct sysinfo" ins't declared at all, so the compiler can't determine the size of this struct. The lib <sys/sysinfo.h> must be included into chilli.c to work. Here is some patch that I made to solve this problem if someone still having this issue.

--- a/src/chilli.c
+++ b/src/chilli.c
@@ -18,6 +18,10 @@
  *
  */
 
+#if defined(HAVE_SYS_SYSINFO_H) && defined(HAVE_SYSINFO)
+#include <sys/sysinfo.h>
+#endif
+
 #include "chilli.h"
 #include "bstrlib.h"
 #ifdef ENABLE_MODULES

thanks, but such conditional include does not help.
I do int unconditionally,
only
#include <sys/sysinfo.h>

p.s. it's for tag v18.06.5, coova-chilli-1.3.0+20141128

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.