[Oisf-users] Odd build error on hardened-gentoo

Victor Julien lists at inliniac.net
Mon Oct 14 11:12:20 UTC 2013

Hash: SHA1

On 10/13/2013 02:26 AM, Cooper F. Nelson wrote:
> The suricata dev. branch fails to build on my gentoo system with
> gcc v4.7.3 with this error:
>> gcc -DHAVE_CONFIG_H -I. -I..   -I./../libhtp/
>> -I/usr/include/nspr  -I/usr/include/nss -I/usr/include/nspr
>> -DLOCAL_STATE_DIR=\"/var\" -g -O2 -Wextra
>> -Werror-implicit-function-declaration -fno-tree-pre -Wall
>> -fno-strict-aliasing -Wno-unused-parameter -std=gnu99
>> -DHAVE_LIBCAP_NG -DREVISION="64203be" -MT suricata.o -MD -MP -MF
>> .deps/suricata.Tpo -c -o suricata.o suricata.c suricata.c: In
>> function 'SCPrintBuildInfo': suricata.c:682:50: error: 'defined'
>> undeclared (first use in this function) suricata.c:682:50: note:
>> each undeclared identifier is reported only once for each
>> function it appears in suricata.c:682:50: error: expected ')'
>> before numeric constant make[3]: *** [suricata.o] Error 1

That line looks like this:

    printf("compiled with _FORTIFY_SOURCE=%d\n", _FORTIFY_SOURCE);

as part of a block:

    printf("compiled with _FORTIFY_SOURCE=%d\n", _FORTIFY_SOURCE);

printf shouldn't be the problem, as it was called before this line as
well, so I think something happened to the definition of _FORTIFY_SOURCE.

It's expected to contain a simple int value, but maybe in this case
it's defined very differently.

We can try to figure this out by invoking the C preprocessor directly:

$ cpp src/suricata.c -I/opt/htp-0.5.x/include/ -I. -I/usr/include/nss/
- -I/usr/include/nspr/|grep _FORTIFY_SOURCE
In file included from src/suricata.c:24:0:
src/suricata-common.h:44:2: warning: #warning "L1 cache line size not
detected during build. Assuming 64 bytes." [-Wcpp]
    printf("compiled with _FORTIFY_SOURCE=%d\n", 2);

So in my case _FORTIFY_SOURCE is defined as 2.

Can you try this as well and post the results? You may have to adapt
the -I options to include your own "include" paths. cpp will error out
if you get them wrong.

- -- 
- ---------------------------------------------
Victor Julien
PGP: http://www.inliniac.net/victorjulien.asc
- ---------------------------------------------

Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/


More information about the Oisf-users mailing list