Project

General

Profile

Actions

Bug #3336

closed

Suricata compilation on windows / mingw

Added by Peter Manev about 3 years ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

It seems that in some cases a simple upgrade of the MinGW environment can make Suricata compilation fail.

  CC       util-unittest.o
  CC       util-unittest-helper.o
  CC       util-affinity.o
  CC       util-var.o
  CC       util-var-name.o
  CC       win32-syscall.o
  CC       win32-misc.o
  CC       win32-service.o
  CCLD     suricata.exe
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../libhtp/htp/.libs/libhtp.a(htp_multipart.o): in function `strncat':
C:/msys64/mingw64/x86_64-w64-mingw32/include/string.h:246: undefined reference to `__strncat_chk'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [Makefile:1291: suricata.exe] Error 1
make[2]: Leaving directory '/home/Administrator/suricata-5.0.0/src'
make[1]: *** [Makefile:499: all-recursive] Error 1
make[1]: Leaving directory '/home/Administrator/suricata-5.0.0'
make: *** [Makefile:425: all] Error 2

In this case MinGW was updated simply with

pacman -Syuu

then restarted.

The same Suricata source was working/compiling under MinGW before the environment/pkg upgrade.
I have tried to do different combinations of compiles (4.1.5/5.0/git/different versions of libhtp) they all fail.
This is on Windows 2016 and Win 10 as well - regardless of win upgrade/os versions.

It seems it just is related to just the MinGW package/tools versioning. (which was never an issue before)

Actions #1

Updated by Andreas Herz about 3 years ago

  • Assignee set to Community Ticket
  • Target version set to TBD
Actions #2

Updated by Victor Julien about 3 years ago

  • Assignee changed from Community Ticket to OISF Dev
Actions #3

Updated by Victor Julien about 3 years ago

It looks like somehow the stack protections get enabled in this mingw version. I was able to build things correctly by passing '--enable-gccprotect' to Suricata.

Actions #4

Updated by Peter Manev about 3 years ago

Can confirm it fixes the issue in my setups too.

Actions #5

Updated by Andreas Herz 10 months ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF