Bug 243486

Summary: When i try rebuild emulators/virtualbox-ose, get error, because i used openssl from ports version 1.1.1d
Product: Ports & Packages Reporter: pilot513
Component: Individual Port(s)Assignee: vbox
Status: Closed DUPLICATE    
Severity: Affects Only Me CC: bdrewery, brnrd, gljennjohn, jcfyecrayz, pilot513, vbox
Priority: --- Flags: pilot513: maintainer-feedback? (vbox)
Version: Latest   
Hardware: Any   
OS: Any   

Description pilot513 2020-01-21 16:39:16 UTC
In my make.conf include:
DEFAULT_VERSIONS+=ssl=openssl
Follow instruction on /usr/ports/UPDATING on 20200101:
  AFFECTS: users of security/openssl and security/openssl111
  AUTHOR: brnrd@FreeBSD.org
  You must rebuild all ports that depend on OpenSSL if you use OpenSSL
  from ports.
I rebuild all ports dependency from security/openssl.
But emulators/virtualbox-ose don't. When i try make it, i get error:

/usr/bin/ld: warning: libssl.so.11, needed by /usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/out/freebsd.amd64/release/bin/VBoxRT.so, may conflict with libssl.so.8
/usr/bin/ld: undefined reference to symbol `OPENSSL_init_ssl@@OPENSSL_1_1_0' (try adding -lssl)
//usr/local/lib/libssl.so.11: could not read symbols: Bad value

My system:
11.3-RELEASE-p3 FreeBSD 11.3-RELEASE-p3 #54 r351809
Comment 1 pilot513 2020-01-24 13:15:13 UTC
Can anyone look this problem ?
Comment 2 John Hein 2020-01-28 09:01:54 UTC
I can reproduce it.  It looks like something adds -L/usr/lib to the linking flags (before -L/usr/local/lib).  This causes the build to try to link with libssl from base which does not have some symbols that openssl 1.1 from ports has.

I don't have a fix at the moment.  I don't know where the -L/usr/lib comes from yet.
Comment 3 Gary Jennejohn 2020-01-28 11:00:27 UTC
(In reply to John Hein from comment #2)
Maybe /usr/ports/Mk/bsd.port.mk? It contains this line: LIB_DIRS?= /lib /usr/lib ${LOCALBASE}/lib
Comment 4 John Hein 2020-01-28 16:28:12 UTC
(In reply to Gary Jennejohn from comment #3)
That only seems to be used in dependency checking (Scripts/*depends.sh), not in the passing of any flags to the build.

For the record, some *FLAGS (which don't include /usr/lib):

======================
# make -V CFLAGS -V CPPFLAGS -V LIBS -V LIBDIRS
make -V CFLAGS -V CPPFLAGS -V LIBS -V LIBDIRS
-O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing 
-DLIBICONV_PLUG


======================

It's probably somewhere in the makefiles in the work area.  But a simple grep doesn't find it:

# grep -l -r L'[[:blank:]]*'/usr/lib /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/ | xargs ls -alrtTd
-rwxr-xr-x  1 nobody  wheel  15948800 Nov 12 20:21:19 2018 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/tools/win.x86/bin/doxygen.exe
-rwxr-xr-x  1 nobody  wheel  22311936 Nov 12 20:21:19 2018 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/tools/win.amd64/bin/doxygen.exe
-rw-r--r--  1 nobody  wheel      9093 Oct 10 18:06:26 2019 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/debian/lintian-override.in
-rw-r--r--  1 nobody  wheel      8953 Oct 10 18:13:58 2019 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/src/VBox/Installer/linux/debian/lintian-override.in
-rw-r--r--  1 nobody  wheel      2966 Oct 10 18:15:09 2019 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/src/libs/libpng-1.2.54/contrib/gregbook/Makefile.sgi
-rw-r--r--  1 nobody  wheel      1401 Oct 10 18:15:10 2019 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/src/libs/libpng-1.2.54/contrib/pngminim/preader/makefile
-rw-r--r--  1 nobody  wheel      4010 Oct 10 18:15:10 2019 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/src/libs/libpng-1.2.54/contrib/gregbook/Makefile.unx
-rw-r--r--  1 nobody  wheel      9721 Oct 10 18:15:12 2019 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/src/libs/libpng-1.2.54/scripts/makefile.cygwin
-rw-r--r--  1 nobody  wheel    748751 Oct 10 18:15:13 2019 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/src/libs/libxml2-2.9.4/ChangeLog
-rw-r--r--  1 nobody  wheel     47139 Oct 10 18:15:14 2019 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/src/libs/libxml2-2.9.4/configure.ac
-rwxr-xr-x  1 nobody  wheel    540980 Oct 10 18:15:14 2019 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/src/libs/libxml2-2.9.4/configure
-rw-r--r--  1 nobody  wheel    131680 Oct 10 18:15:14 2019 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/src/libs/libxml2-2.9.4/NEWS
-rw-r--r--  1 nobody  wheel    298570 Oct 10 18:15:17 2019 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/src/libs/libxml2-2.9.4/doc/xml.html
-rw-r--r--  1 nobody  wheel    156746 Oct 10 18:15:17 2019 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/src/libs/libxml2-2.9.4/doc/news.html
-rw-r--r--  1 nobody  wheel      1968 Jan 28 06:36:24 2020 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/out/freebsd.amd64/release/obj/tstDeviceStructSizeRC/tstDeviceStructSizeRC.dep
-rw-r--r--  1 nobody  wheel      1784 Jan 28 06:36:24 2020 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/out/freebsd.amd64/release/obj/tstVMStructRC/tstVMStructRC.dep
-rw-r--r--  1 nobody  wheel      1828 Jan 28 06:45:27 2020 /wrkdirs/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/out/freebsd.amd64/release/obj/tstAsmStructsRC/tstAsmStructsRC.dep
Comment 5 John Hein 2020-01-28 16:29:20 UTC
I meant to use LDFLAGS on that make -V:

# make -V CFLAGS -V CPPFLAGS -V LIBS -V LIBDIRS -V LDFLAGS
make -V CFLAGS -V CPPFLAGS -V LIBS -V LIBDIRS -V LDFLAGS
-O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing 
-DLIBICONV_PLUG


-lpthread -Wl,-rpath,/usr/loc/lib -fstack-protector-strong
Comment 6 Bryan Drewery freebsd_committer 2020-03-26 22:29:33 UTC
Duping to Bug 243315 which has a patch

*** This bug has been marked as a duplicate of bug 243315 ***