Bug 228522 - net-mgmt/net-snmp ver 5.7.3 failed to build with option MYSQL for MariaDB 10.2
Summary: net-mgmt/net-snmp ver 5.7.3 failed to build with option MYSQL for MariaDB 10.2
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Ryan Steinmetz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-26 21:43 UTC by Tommy P
Modified: 2020-09-12 12:59 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (zi)


Attachments
extra patch for MariaDB 10 (1.54 KB, patch)
2019-05-17 00:42 UTC, Tommy P
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tommy P 2018-05-26 21:43:13 UTC
The port net-mgmt/net-snmp v5.7.3 failed to build on FreeBSD 11.1 p10 with the same error as mentioned in this post:

https://sourceforge.net/p/net-snmp/bugs/2782/

The proposed patch for the file apps/snmptrapd_sql.c [1] would allow the net-snmp port to build successfully.

[1] https://sourceforge.net/p/net-snmp/bugs/_discuss/thread/7bfe0c54/cbed/attachment/net-snmp-5.7.3-mysql.patch
Comment 1 Tommy P 2018-05-26 22:59:42 UTC
Here's the error when building the port without the patch:

libtool: link: cc -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -pipe -msse3 -msse4a -march=amdfam10 -I/usr/local/include -I/include -fstack-protector -fno-strict-aliasing -std=c99 -Ufreebsd11 -Dfreebsd11=freebsd11 -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2 -I/usr/local/lib/perl5/5.26/mach/CORE -o .libs/snmptrapd .libs/snmptrapd.o -Wl,-R/usr/local/lib/perl5/5.26/mach/CORE  ./.libs/libnetsnmptrapd.so /wrkdirs/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.7.3/agent/.libs/libnetsnmpmibs.so -L/usr/lib -L/lib -L/usr/local/lib -L/usr/local/lib/perl5/5.26/mach/CORE ../agent/.libs/libnetsnmpmibs.so /wrkdirs/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.7.3/agent/.libs/libnetsnmpagent.so ../agent/.libs/libnetsnmpagent.so /wrkdirs/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.7.3/snmplib/.libs/libnetsnmp.so ../snmplib/.libs/libnetsnmp.so -L/usr/local/lib/mysql/ -lmariadb -lz -liconv -lperl -lpthread -lcrypt -lutil -lelf -lpkg -lssp_nonshared -lm -lkvm -ldevstat -lssl -lcrypto -pthread  -Wl,-rpath -Wl,/usr/local/lib
/usr/bin/ld: warning: libssl.so.9, needed by /usr/local/lib/mysql//libmariadb.so, may conflict with libssl.so.8
/usr/bin/ld: warning: libcrypto.so.9, needed by /usr/local/lib/mysql//libmariadb.so, may conflict with libcrypto.so.8
./.libs/libnetsnmptrapd.so: undefined reference to `load_defaults'
./.libs/libnetsnmptrapd.so: undefined reference to `my_init'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make[2]: stopped in /wrkdirs/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.7.3/apps
*** Error code 1

Stop.
make[1]: stopped in /wrkdirs/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.7.3
*** Error code 1

Stop.
Comment 2 Bernard Spil freebsd_committer 2018-10-27 21:26:13 UTC
> /usr/bin/ld: warning: libcrypto.so.9, needed by /usr/local/lib/mysql//libmariadb.so, may conflict with libcrypto.so.8

That points to net-snmp linking both base and ports OpenSSL libraries. What's your `DEFAULT_VERSIONS` set to? More specifically the `ssl=` part.

Looks like you have DEFAULT_VERSIONS=ssl=openssl and net-snmp tries to link OpenSSL from base.
Comment 3 Tommy P 2019-04-01 10:18:04 UTC
I apologize for the late reply since applying the mentioned patched allow the build to complete successfully.  Yes, I used:

DEFAULT_VERSIONS+=apache=2.4 bdb=6 mysql=10.1m perl5=5.26 pgsql=10 php=7.2 php:web=7.2 php_web=7.2 php-web=7.2 python=3.6 python2=2.7 python3=3.6 ruby=2.5 samba=4.7 ssl=openssl tcltk=8.7

at the time of that build.
Comment 4 Tommy P 2019-05-17 00:42:21 UTC
Created attachment 204411 [details]
extra patch for MariaDB 10

Patch of Makefile to use attached patched:

--- Makefile.ori        2019-05-16 16:36:09.592852000 -0700
+++ Makefile    2019-05-16 16:29:29.975687000 -0700
@@ -134,6 +134,7 @@
 USES+=         mysql
 CONFIGURE_ARGS+=--with-mysql
 CONFIGURE_ENV+=        MYSQLCONFIG=${LOCALBASE}/bin/mysql_config
+EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-mariadb10
 .endif

 .if ${PORT_OPTIONS:MAX_DISABLE_TRAP}
Comment 5 Ryan Steinmetz freebsd_committer freebsd_triage 2020-09-12 12:59:45 UTC
Handled as part of the 5.9 update