openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
3.95k stars 3.46k forks source link

snort: fails to compile on x86_64 #12020

Closed dl12345 closed 4 years ago

dl12345 commented 4 years ago

snort fails to compile on x86_64 (but compiles fine on mips_24kc_musl)

errors out with the following:

ccache_cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../src -I../../src/sfutil  -I../../src/output-plugins -I../../src/detection-plugins -I../../src/dynamic-plugins -I../../src/preprocessors -I../../src/preprocessors/portscan -I../../src/preprocessors/HttpInspect/include -I../../src/preprocessors/Session -I../../src/preprocessors/Stream6 -I../../src/target-based -I../../src/control -I../../src/file-process -I../../src/file-process/libs -I../../src/side-channel -I../../src/side-channel/plugins -I../../src/reload-adjust  -I/opt/openwrt/openwrt/staging_dir/target-x86_64_glibc/usr/include -I/opt/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-9.3.0_glibc/usr/include -I/opt/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-9.3.0_glibc/include -I/opt/openwrt/openwrt/staging_dir/target-x86_64_glibc/usr/include -I/opt/openwrt/openwrt/staging_dir/target-x86_64_glibc/usr/include -I/opt/openwrt/openwrt/staging_dir/target-x86_64_glibc/usr/include -I/opt/openwrt/openwrt/staging_dir/target-x86_64_glibc/usr/include -DLZMA -DGRE -DMPLS -DPPM_MGR -DNDEBUG -DENABLE_REACT -DENABLE_RESPOND -DENABLE_RESPONSE3 -DSF_WCHAR -DTARGET_BASED -DPERF_PROFILING -DSNORT_RELOAD -DNO_NON_ETHER_DECODER -DNORMALIZER -DACTIVE_RESPONSE -DFEAT_OPEN_APPID -DHAVE_LIBLUAJIT  -O2 -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/opt/openwrt/openwrt/build_dir/target-x86_64_glibc/snort/snort-2.9.15=snort-2.9.15 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-z,now -Wl,-z,relro -I/opt/openwrt/openwrt/staging_dir/target-x86_64_glibc/usr/include/tirpc -DSF_VISIBILITY -fvisibility=hidden -DHAVE_DAQ_EXT_MODFLOW -DHAVE_DAQ_DATA_CHANNEL_PARAMS -DHAVE_DAQ_DATA_CHANNEL_SEPARATE_IP_VERSIONS -Wall -c -o sfcontrol.o sfcontrol.c
In file included from ../../src/ipv6_port.h:29,
                 from ../../src/decode.h:52,
                 from ../../src/spo_plugbase.h:31,
                 from ../../src/snort.h:36,
                 from sfcontrol.c:37:
../../src/sfutil/sf_ip.h: In function '_ip6_cmp':
../../src/sfutil/sf_ip.h:231:31: warning: taking address of packed member of 'struct _sfaddr' may result in an unaligned pointer value [-Waddress-of-packed-member]
  231 | #define sfaddr_get_ip6_ptr(x) ((x)->ia32)
      |                               ^
../../src/sfutil/sf_ip.h:322:10: note: in expansion of macro 'sfaddr_get_ip6_ptr'
  322 |     p1 = sfaddr_get_ip6_ptr(ip1);
      |          ^~~~~~~~~~~~~~~~~~
../../src/sfutil/sf_ip.h:231:31: warning: taking address of packed member of 'struct _sfaddr' may result in an unaligned pointer value [-Waddress-of-packed-member]
  231 | #define sfaddr_get_ip6_ptr(x) ((x)->ia32)
      |                               ^
../../src/sfutil/sf_ip.h:323:10: note: in expansion of macro 'sfaddr_get_ip6_ptr'
  323 |     p2 = sfaddr_get_ip6_ptr(ip2);
      |          ^~~~~~~~~~~~~~~~~~
../../src/sfutil/sf_ip.h: In function 'sfip_fast_lt6':
../../src/sfutil/sf_ip.h:231:31: warning: taking address of packed member of 'struct _sfaddr' may result in an unaligned pointer value [-Waddress-of-packed-member]
  231 | #define sfaddr_get_ip6_ptr(x) ((x)->ia32)
      |                               ^
../../src/sfutil/sf_ip.h:409:10: note: in expansion of macro 'sfaddr_get_ip6_ptr'
  409 |     p1 = sfaddr_get_ip6_ptr(ip1);
      |          ^~~~~~~~~~~~~~~~~~
../../src/sfutil/sf_ip.h:231:31: warning: taking address of packed member of 'struct _sfaddr' may result in an unaligned pointer value [-Waddress-of-packed-member]
  231 | #define sfaddr_get_ip6_ptr(x) ((x)->ia32)
      |                               ^
../../src/sfutil/sf_ip.h:410:10: note: in expansion of macro 'sfaddr_get_ip6_ptr'
  410 |     p2 = sfaddr_get_ip6_ptr(ip2);
      |          ^~~~~~~~~~~~~~~~~~
../../src/sfutil/sf_ip.h: In function 'sfip_fast_gt6':
../../src/sfutil/sf_ip.h:231:31: warning: taking address of packed member of 'struct _sfaddr' may result in an unaligned pointer value [-Waddress-of-packed-member]
  231 | #define sfaddr_get_ip6_ptr(x) ((x)->ia32)
      |                               ^
../../src/sfutil/sf_ip.h:430:10: note: in expansion of macro 'sfaddr_get_ip6_ptr'
  430 |     p1 = sfaddr_get_ip6_ptr(ip1);
      |          ^~~~~~~~~~~~~~~~~~
../../src/sfutil/sf_ip.h:231:31: warning: taking address of packed member of 'struct _sfaddr' may result in an unaligned pointer value [-Waddress-of-packed-member]
  231 | #define sfaddr_get_ip6_ptr(x) ((x)->ia32)
      |                               ^
../../src/sfutil/sf_ip.h:431:10: note: in expansion of macro 'sfaddr_get_ip6_ptr'
  431 |     p2 = sfaddr_get_ip6_ptr(ip2);
      |          ^~~~~~~~~~~~~~~~~~
../../src/sfutil/sf_ip.h: In function 'sfip_fast_eq6':
../../src/sfutil/sf_ip.h:231:31: warning: taking address of packed member of 'struct _sfaddr' may result in an unaligned pointer value [-Waddress-of-packed-member]
  231 | #define sfaddr_get_ip6_ptr(x) ((x)->ia32)
      |                               ^
../../src/sfutil/sf_ip.h:451:10: note: in expansion of macro 'sfaddr_get_ip6_ptr'
  451 |     p1 = sfaddr_get_ip6_ptr(ip1);
      |          ^~~~~~~~~~~~~~~~~~
../../src/sfutil/sf_ip.h:231:31: warning: taking address of packed member of 'struct _sfaddr' may result in an unaligned pointer value [-Waddress-of-packed-member]
  231 | #define sfaddr_get_ip6_ptr(x) ((x)->ia32)
      |                               ^
../../src/sfutil/sf_ip.h:452:10: note: in expansion of macro 'sfaddr_get_ip6_ptr'
  452 |     p2 = sfaddr_get_ip6_ptr(ip2);
      |          ^~~~~~~~~~~~~~~~~~
In file included from ../../src/decode.h:56,
                 from ../../src/spo_plugbase.h:31,
                 from ../../src/snort.h:36,
                 from sfcontrol.c:37:
../../src/util.h: At top level:
../../src/util.h:377:21: error: static declaration of 'gettid' follows non-static declaration
  377 | static inline pid_t gettid(void)
      |                     ^~~~~~
In file included from /opt/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-9.3.0_glibc/include/unistd.h:1176,
                 from /opt/openwrt/openwrt/staging_dir/target-x86_64_glibc/usr/include/daq_common.h:25,
                 from /opt/openwrt/openwrt/staging_dir/target-x86_64_glibc/usr/include/daq.h:26,
                 from ../../src/decode.h:48,
                 from ../../src/spo_plugbase.h:31,
                 from ../../src/snort.h:36,
                 from sfcontrol.c:37:
/opt/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-9.3.0_glibc/include/bits/unistd_ext.h:34:16: note: previous declaration of 'gettid' was here
   34 | extern __pid_t gettid (void) __THROW;
      |                ^~~~~~
make[7]: *** [Makefile:361: sfcontrol.o] Error 1
make[7]: Leaving directory '/opt/openwrt/openwrt/build_dir/target-x86_64_glibc/snort/snort-2.9.15/src/control'
make[6]: *** [Makefile:557: all-recursive] Error 1
make[6]: Leaving directory '/opt/openwrt/openwrt/build_dir/target-x86_64_glibc/snort/snort-2.9.15/src'
make[5]: *** [Makefile:516: all-recursive] Error 1
make[5]: Leaving directory '/opt/openwrt/openwrt/build_dir/target-x86_64_glibc/snort/snort-2.9.15'
make[4]: *** [Makefile:382: all] Error 2
make[4]: Leaving directory '/opt/openwrt/openwrt/build_dir/target-x86_64_glibc/snort/snort-2.9.15'
make[3]: *** [Makefile:161: /opt/openwrt/openwrt/build_dir/target-x86_64_glibc/snort/snort-2.9.15/.built] Error 2
make[3]: Leaving directory '/opt/openwrt/openwrt/feeds/packages/net/snort'
time: package/feeds/packages/snort/compile#121.76#34.86#152.84
make[2]: *** [package/Makefile:113: package/feeds/packages/snort/compile] Error 2
make[2]: Leaving directory '/opt/openwrt/openwrt'
make[1]: *** [package/Makefile:107: /opt/openwrt/openwrt/staging_dir/target-x86_64_glibc/stamp/.package_compile] Error 2
make[1]: Leaving directory '/opt/openwrt/openwrt'
make: *** [/opt/openwrt/openwrt/include/toplevel.mk:220: world] Error 2

A simple bump from 2.9.15 to 2.9.15.1 fixes the problem. I'll submit a PR with a bump unless there's any reason not to? I've been running 2.9.15.1 on my live box for a while and it runs stable.

When bumping the version PKG_RELEASE gets reset to 1, correct?

hnyman commented 4 years ago

A simple bump from 2.9.15 to 2.9.15.1 fixes the problem. I'll submit a PR ... When bumping the version PKG_RELEASE gets reset to 1, correct?

Yes. When PKG_VERSION increases, PKG_RELEASE resets to 1.