Suricata 6.0.2 fails to compile from source under FreeBSD 13

HI all,

I am trying to compile Suricata 6.0.2 under a FreeBSD 13 host with the following options:

/configure --prefix=/opt/suricata --sysconfdir=/etc --localstatedir=/var --disable-gccmarch-native --enable-profiling --enable-profiling-locks --enable-ipfw --enable-netmap --enable-pie --enable-rust --enable-gccprotect --disable-suricata-update --enable-geoip … and compilation fails with the following errors:

Making all in libhtp
make all-recursive
Making all in htp
Making all in lzma
Making all in test
Making all in docs
Making all in rust
CARGO_HOME="/root/.cargo" CARGO_TARGET_DIR="/tmp/oo/suricata-6.0.2/rust/target" /usr/local/bin/cargo build --release --features "function-macro "
Finished release [optimized + debuginfo] target(s) in 0.07s
if test -e …/rust/target/release/suricata.lib; then cp …/rust/target/release/suricata.lib …/rust/target/release/libsuricata.a; fi
make gen/rust-bindings.h
Making all in src
make all-am
CC app-layer-expectation.o
app-layer-expectation.c:83:5: error: type name requires a specifier or qualifier
CIRCLEQ_ENTRY(Expectation_) entries;
^
app-layer-expectation.c:83:19: error: a parameter list without types is only allowed in a function definition
CIRCLEQ_ENTRY(Expectation_) entries;
^
app-layer-expectation.c:83:32: error: expected ‘;’ at end of declaration list
CIRCLEQ_ENTRY(Expectation_) entries;
^
;
app-layer-expectation.c:93:5: error: type name requires a specifier or qualifier
CIRCLEQ_HEAD(EList, Expectation_) list;
^
app-layer-expectation.c:93:18: error: a parameter list without types is only allowed in a function definition
CIRCLEQ_HEAD(EList, Expectation_) list;
^
app-layer-expectation.c:93:38: error: expected ‘;’ at end of declaration list
CIRCLEQ_HEAD(EList, Expectation_) list;
^
;
app-layer-expectation.c:132:9: error: implicit declaration of function ‘CIRCLEQ_FOREACH_SAFE’ is invalid in C99 [-Werror,-Wimplicit-function-declaration]
CIRCLEQ_FOREACH_SAFE(exp, &exp_list->list, entries, pexp) {
^
app-layer-expectation.c:132:46: error: no member named ‘list’ in ‘struct ExpectationList_’
CIRCLEQ_FOREACH_SAFE(exp, &exp_list->list, entries, pexp) {
~~~~~~~~ ^
app-layer-expectation.c:132:52: error: use of undeclared identifier ‘entries’
CIRCLEQ_FOREACH_SAFE(exp, &exp_list->list, entries, pexp) {
^
app-layer-expectation.c:188:5: error: implicit declaration of function ‘CIRCLEQ_REMOVE’ is invalid in C99 [-Werror,-Wimplicit-function-declaration]
CIRCLEQ_REMOVE(&exp_list->list, exp, entries);
^
app-layer-expectation.c:188:31: error: no member named ‘list’ in ‘struct ExpectationList_’
CIRCLEQ_REMOVE(&exp_list->list, exp, entries);
~~~~~~~~ ^
app-layer-expectation.c:188:42: error: use of undeclared identifier ‘entries’
CIRCLEQ_REMOVE(&exp_list->list, exp, entries);
^
app-layer-expectation.c:245:9: error: implicit declaration of function ‘CIRCLEQ_INSERT_HEAD’ is invalid in C99 [-Werror,-Wimplicit-function-declaration]
CIRCLEQ_INSERT_HEAD(&exp_list->list, exp, entries);
^
app-layer-expectation.c:245:40: error: no member named ‘list’ in ‘struct ExpectationList_’
CIRCLEQ_INSERT_HEAD(&exp_list->list, exp, entries);
~~~~~~~~ ^
app-layer-expectation.c:245:51: error: use of undeclared identifier ‘entries’
CIRCLEQ_INSERT_HEAD(&exp_list->list, exp, entries);
^
app-layer-expectation.c:249:37: error: implicit declaration of function ‘CIRCLEQ_LAST’ is invalid in C99 [-Werror,-Wimplicit-function-declaration]
Expectation *last_exp = CIRCLEQ_LAST(&exp_list->list);
^
app-layer-expectation.c:249:61: error: no member named ‘list’ in ‘struct ExpectationList_’
Expectation *last_exp = CIRCLEQ_LAST(&exp_list->list);
~~~~~~~~ ^
app-layer-expectation.c:250:13: error: implicit declaration of function ‘CIRCLEQ_REMOVE’ is invalid in C99 [-Werror,-Wimplicit-function-declaration]
CIRCLEQ_REMOVE(&exp_list->list, last_exp, entries);
^
app-layer-expectation.c:250:39: error: no member named ‘list’ in ‘struct ExpectationList_’
CIRCLEQ_REMOVE(&exp_list->list, last_exp, entries);
~~~~~~~~ ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
*** Error code 1

Stop.
make[2]: stopped in /tmp/oo/suricata-6.0.2/src
*** Error code 1

Stop.
make[1]: stopped in /tmp/oo/suricata-6.0.2/src
*** Error code 1

Stop.
make: stopped in /tmp/oo/suricata-6.0.2

Any idea?

Hi,

Sorry about this! @ish has prepared a PR that will fix the problems you’ve encountered: 6.0.x/ish/backports/v1 - dns - freebsd - v1 by jasonish · Pull Request #6079 · OISF/suricata · GitHub

1 Like

Yep … Many thanks for your fast answer Jeff … Is this will be fixed for 6.0.3?

Thanks.

Yes – this fix will be included in 6.0.3.

Hi @Jeff_Lucovsky just FYI, same error occurs in Suricata 5.0.6 under FreeBSD 13 …