Menu

#2904 MSYS2-MINGW64 OpenSSL.1.1.1a problem with net-snmp 5.8

windows
closed
5
2019-05-14
2018-11-24
No

Dear All,
I have tried to build net-snmp 5.8 against mingw64 (packaged within msys2), but i have had tons of errors with openssl, in particular with x509 module. Before open this ticket i have open an issue with openssl group (https://github.com/openssl/openssl/issues/7686, where there is a complete log) and msys2 (https://github.com/Alexpux/MINGW-packages/issues/4685). Moreover i have had problems with suggested IPv6 Trasports. I succeed in building net-snmp with suggested configure options but adding --without-openssl and removing the ipv6 transports (but leaving enabled ipv6 support). Best Regards.

Discussion

  • Bart Van Assche

    Bart Van Assche - 2018-11-25

    Building Net-SNMP against the Cygwin Mingw-w64 packages works fine on my setup. How did you install Mingw-w64? Which OpenSSL packages did you install? And how did you configure and build Net-SNMP?

     
  • saverio mori

    saverio mori - 2018-11-25

    I have used the latest release of MSYS2, with its own MINGW64 package, for me is more easy than cigwin and usually very effective. This environment include openSSL release 1.1.1a, so i have not installed openssl specifically. Moreover the link indicated in readme.win32 indicate a package that does not immediately support mingw but only visual studio. I have installed Msys and mingw using the standard setup and updated all to the latest packages. Finally i have build net-snmp using these setup:

    ./configure --prefix="$BASEDIR" --with-mibdirs="$BASEDIR/share/snmp/mibs" --with-mib-modules="agentx disman/event-mib winExtDLL examples/example" --disable-embedded-perl --without-perl-modules --enable-ipv6 --with-transports="TCPIPv6 UDPIPv6"

    but i have had to delete '--with-transports="TCPIPv6 UDPIPv6"' and add "--without-openssl".

     
  • saverio mori

    saverio mori - 2018-11-25

    As already said, i have already involved MSYS2 and OpenSSL teams.

     
  • Bart Van Assche

    Bart Van Assche - 2019-01-18

    I will update README.win32. If I build Net-SNMP as follows against MSYS2 + MinGW64:

    ./configure --enable-developer --enable-ipv6 --prefix=/usr/local/net-snmp-master --with-cflags= --with-defaults --disable-embedded-perl --without-perl-modules --with-transports=DTLSUDP TLSTCP SSH --with-security-modules="usm tsm" --with-mib-modules="examples/data_set examples/delayed_instance examples/example examples/notification examples/scalar_int examples/ucdDemoPublic examples/watched smux mibII snmp-notification-mib ucd-snmp/dlmod ucd-snmp/extensible winExtDLL" CFLAGS=-I/usr/include CPPFLAGS=-I/usr/include LDFLAGS=-L/usr/lib

    then the compiler reports the following error message:

    libtool: compile:  gcc -I../include -I. -I../snmplib -D_WIN32_WINNT=0x0501 -DWIN32 -DVC_EXTRALEAN -DWIN32_LEAN_AND_MEAN -D_GNU_SOURCE -D_ALL_SOURCE -D_THREAD_SAFE -D__EXTENSIONS__ -I/usr/include -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -DNETSNMP_REMOVE_U64 -Umingw32 -Dmingw32=mingw32 -Wall -Wextra -Wstrict-prototypes -Wwrite-strings -Wcast-qual -Wimplicit-fallthrough=2 -Wlogical-op -Wno-format-truncation -Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter -Wno-type-limits -c snmp_logging.c  -DDLL_EXPORT -DPIC -o .libs/snmp_logging.o
    In file included from C:/msys64/usr/include/sys/fcntl.h:3,
                     from C:/msys64/usr/include/fcntl.h:12,
                     from snmp_logging.c:42:
    C:/msys64/usr/include/sys/_default_fcntl.h:181:8: error: redefinition of 'struct flock'
     struct flock {
            ^~~~~
    In file included from C:/msys64/usr/include/sys/types.h:240,
                     from C:/msys64/usr/include/stdio.h:61,
                     from snmp_logging.c:27:
    C:/msys64/usr/include/machine/types.h:46:8: note: originally defined here
     struct flock {
            ^~~~~
    make[1]: *** [Makefile:100: snmp_logging.lo] Error 1
    

    I think the above indicates a MinGW64 bug. Do you agree with my conclusion?

     
  • Bart Van Assche

    Bart Van Assche - 2019-01-18
    • assigned_to: bart
     
  • saverio mori

    saverio mori - 2019-01-18

    Thanks Bart. Yes, now i do not remember well my compiling problems using openssl included in the msys2 bundle, but i remember redefinitions.

     
  • Bart Van Assche

    Bart Van Assche - 2019-01-22

    By reading more about MSYS2 and MinGW64 I learned that the above command causes gcc to include both MSYS2 and MinGW64 header files. That's something that is not supported. The following commands allowed me to build Net-SNMP with OpenSSL support:

    pacman -S mingw-w64-x86_64-openssl-devel
     ./configure --enable-developer --enable-ipv6 --with-defaults --disable-embedded-perl --without-perl-modules --with-transports='DTLSUDP TLSTCP' --with-security-modules='usm tsm' --with-mib-modules='examples/data_set examples/delayed_instance examples/example examples/notification examples/scalar_int examples/ucdDemoPublic examples/watched smux mibII snmp-notification-mib ucd-snmp/dlmod ucd-snmp/extensible winExtDLL'
    
     

    Last edit: Bart Van Assche 2019-01-22
  • saverio mori

    saverio mori - 2019-01-27

    Thanks. The pacman command does not work for me, this package does not appear existent... On the other hand, i have integrated your configure within mine and it works, as make and make install.

     
  • Bart Van Assche

    Bart Van Assche - 2019-01-27

    Sorry that I got the package name wrong. Does installing mingw-w64-x86_64-openssl work on your setup?

     
  • Bart Van Assche

    Bart Van Assche - 2019-05-14
    • status: open --> closed
     
  • Bart Van Assche

    Bart Van Assche - 2019-05-14

    Instructions for building against MSYS2 and MinGW64 have been added to README.win32. The MSYS2 and MinGW64 builds pass reliably on my setup. Please reopen this ticket if you think that it needs further attention.

     

Log in to post a comment.

Auth0 Logo