Support #1207
closedCannot compile on CentOS 5 x64 with --enable-profiling
Description
Hello,
I'm trying to install Suricata 2.0.1 on CentOS 5.10 x64, but it's erroring out on make when configuring with --enable-profiling. Details below:
Configure command
%configure \ --prefix=/usr/ \ --sysconfdir=/etc/ \ --localstatedir=/var/ \ --enable-unix-socket \ --enable-profiling \ --enable-geoip \ --with-libnss-libraries=/usr/lib64 \ --with-libnss-includes=/usr/include/nss3 \ --with-libnspr-libraries=/usr/lib64 \ --with-libnspr-includes=/usr/include/nspr4 \ --enable-nfqueue
OS details
# cat /etc/redhat-release CentOS release 5.10 (Final) # uname -a Linux vpspaiu4.accountservergroup.com 3.2.58-grsec.31.el5 #1 SMP Tue May 13 08:10:54 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
Dependencies
# rpm -q rpm -q libpcap libpcap-devel libnet libnet-devel pcre pcre-devel gcc gcc-c++ automake autoconf libtool make libyaml libyaml-devel zlib zlib-devel geoip geoip-devel rpm-4.4.2.3-34.el5 libpcap-0.9.4-15.el5 libpcap-devel-0.9.4-15.el5 libnet-1.1.6-7.el5 libnet-devel-1.1.6-7.el5 pcre-6.6-9.el5 pcre-6.6-9.el5 pcre-devel-6.6-9.el5 pcre-devel-6.6-9.el5 gcc-4.1.2-54.el5 gcc-c++-4.1.2-54.el5 automake-1.9.6-2.3.el5 autoconf-2.59-12 libtool-1.5.22-7.el5_4 make-3.81-3.el5 libyaml-0.1.4-1.el5.rf libyaml-devel-0.1.4-1.el5.rf zlib-1.2.3-7.el5 zlib-1.2.3-7.el5 zlib-devel-1.2.3-7.el5 zlib-devel-1.2.3-7.el5 geoip-1.4.6-1.el5.rf geoip-devel-1.4.6-1.el5.rf * Along with Jansson 2.6 complied from source
Error that's received
util-profiling.c:100: error: expected declaration specifiers or ‘...’ before ‘&’ token util-profiling.c:100: error: expected declaration specifiers or ‘...’ before numeric constant util-profiling.c:100: warning: data definition has no type or storage class util-profiling.c:100: warning: type defaults to ‘int’ in declaration of ‘pthread_spin_init’ make[3]: *** [util-profiling.o] Error 1 make[3]: Leaving directory `/root/setup/suricata-2.0.1/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/root/setup/suricata-2.0.1/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/root/setup/suricata-2.0.1' make: *** [all] Error 2
I was able to install the latest 1.x version without issues, even with --enable-profile enabled, but for some reason I can't get past make on version 2.0.1. It installed flawlessly on CentOS 6 with the same configure command.
Is there anything that I'm missing by any chance? If there's any other info I can provide, let me know.
Thanks.
Updated by Gabriel Paiu over 10 years ago
Any feedback on this would be greatly appreciate,
Thanks,
Gabriel Paiu
Updated by Victor Julien over 10 years ago
- Priority changed from High to Low
Can you try editing that line (util-profiling.c, line 100) and remove the 'static' keyword there?
Since CentOS5 is old and it only affects profiling, I'm setting priority to low.
Updated by Gabriel Paiu over 10 years ago
I've commented out all occurrences of SC_ATOMIC_DECL_AND_INIT from the util-profiling C script, and then it still errors out at another point:
util-profiling.c: In function ‘SCProfilePacketStart’: util-profiling.c:961: error: ‘samples_sc_atomic__’ undeclared (first use in this function) util-profiling.c:961: error: (Each undeclared identifier is reported only once util-profiling.c:961: error: for each function it appears in.) util-profiling.c:961: warning: type defaults to ‘int’ in declaration of ‘var’ util-profiling.c:961: error: ‘samples_sc_lock__’ undeclared (first use in this function) util-profiling.c: In function ‘SCProfileRuleStart’: util-profiling.c:976: error: ‘samples_sc_atomic__’ undeclared (first use in this function) util-profiling.c:976: warning: type defaults to ‘int’ in declaration of ‘var’ util-profiling.c:976: error: ‘samples_sc_lock__’ undeclared (first use in this function) make[1]: *** [util-profiling.o] Error 1 make[1]: Leaving directory `/root/setup/suricata-2.0.1/src' make: *** [all] Error 2
Seems to me like this will lead to basically disabling packet profiling one way or another? I.E if not by avoiding it on ./configure, then by commenting out the related code in the source files? Was this feature conceived to work on CentOS 5 or not ?
Thank you
Updated by Victor Julien over 10 years ago
Yes, that won't work. Please remove only the static word, not the entire line.
Updated by Gabriel Paiu over 10 years ago
Ah ok sorry I misread that and I understand what you were going for. That fixed most of the errors and now I'm left with:
util-profiling.c:100: error: expected declaration specifiers or ‘...’ before ‘&’ token util-profiling.c:100: error: expected declaration specifiers or ‘...’ before numeric constant util-profiling.c:100: warning: data definition has no type or storage class util-profiling.c:100: warning: type defaults to ‘int’ in declaration of ‘pthread_spin_init’
The header at line 100 now looks like:
SC_ATOMIC_DECL_AND_INIT(uint64_t, samples);
Is it possibly related to the uppercase name of the function that's being "confused" with a constant perhaps?
Updated by Victor Julien over 10 years ago
- Status changed from New to Closed
- Assignee set to Victor Julien
- Target version set to 2.0.3
- % Done changed from 0 to 100
Should be fixed by https://github.com/inliniac/suricata/pull/1034