Created attachment 214239 [details] add -lcrypto nTopNG fails to build on 12.1-STABLE without linking -lcrypto
Hi, I'm unable to reproduce the issue. In poudriere the port compiles fine on all supported FreeBSD releases and recent head. Could you provide a build log of a failing build? Are you using base OpenSSL or an SSL library provided by the ports system?
Created attachment 214245 [details] build output without -lcrypto build failed again without -lcrypto using the base system OpenSSL on 12.1-STABLE
(In reply to yds from comment #2) To understand what is going on I need a FULL build log, from start to end of the process. From what you have posted I notice a difference with my own log. On my system the build system seems to correctly find the required options (-lcrypto included) and correctly compile ntopng. Before modifying a port which is building fine in poudriere and in the build cluster I need to understand exactly why it is failing. It could be a specific problem in your installation. You have not replied my question, do you have any ports provided SSL library installed? If you did in the past, simply removing it is not enough to make sure it is not influencing new builds anymore.
Created attachment 214277 [details] full build log I have never installed any OpenSSL from ports on the 12.1-STABLE boxes where this failure happens. FWIW, nTopNG 3.8 built fine, this became an issue with the upgrade to 4.0 if you look at `files/patch-configure.seed` where I'm adding `-lcrypto` -- it's already part of a FreeBSD specific hint to find the base system OpenSSL libs: ``` + dnl Workaround for FreeBSD + elif test -f "/usr/lib/libssl.so"; then + AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl]) + SSL_INC="-I/usr/include" + SSL_LIB="-L/usr/lib -lssl" else ``` if you look at the start of the `pkg-config --exists libssl` block of code on line 168 of configure.seed, `-lcrypto` is specified there: ``` pkg-config --exists libssl if test "$?" -ne 1; then AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl]) SSL_INC="`pkg-config --cflags libssl` -I/usr/include/openssl" SSL_LIB="`pkg-config --libs libssl` -lssl -lcrypto" else ``` I do not see any ill effect from explicitly linking to both `-lssl -lcrypto` same as `pkg-config` does on line 172. it does cure the build failure on 5 of my 12.1-STABLE boxes where I tried this with and without `-lcrypto`
Now I see and you got me convinced about the need for the change. Please note that my inquiry was no negation of the correctness of your patch. As a committer I'm the one responsible for what I commit, so I asked for explanations to get a full understanding of the situation, and you provided just that. I'll commit the change after some more testing.
A commit references this bug: Author: madpilot Date: Sat May 9 15:44:00 UTC 2020 New revision: 534782 URL: https://svnweb.freebsd.org/changeset/ports/534782 Log: Fix build with openssl on 12.1-STABLE. PR: 246289 Submitted by: yds@Necessitu.de MFH: 2020Q2 Changes: head/net/ntopng/files/patch-configure.seed
Fix flag usage.
A commit references this bug: Author: madpilot Date: Sun May 10 16:49:36 UTC 2020 New revision: 534855 URL: https://svnweb.freebsd.org/changeset/ports/534855 Log: MFH: r534782 Fix build with openssl on 12.1-STABLE. PR: 246289 Submitted by: yds@Necessitu.de Approved by: ports-secteam (joneum) Changes: _U branches/2020Q2/ branches/2020Q2/net/ntopng/files/patch-configure.seed
Committed and merged. Patch also submitted upstream.