Created attachment 212694 [details] build log of virtualbox-ose (until DynamicConfig.kmk on early stage of build) After I upgraded virtualbox-ose to 5.3.34_1 (ports r528258) built by poudriere (I attached the build log until DynamicConfig.kmk was build), it failed with the following error messages. === begin error messages % virtualbox VirtualBox: Error -610 in supR3HardenedMainInitRuntime! VirtualBox: dlopen("/usr/local/lib/virtualbox/VBoxRT.so",) failed: /usr/lib/libstdc++.so.6: version CXXABI_1.3.9 required by /usr/local/lib/virtualbox/VBoxRT.so not found VirtualBox: Tip! It may help to reinstall VirtualBox. === end error messages IMHO, /usr/local/lib/virtualbox/VBoXRT.so dlopen(3)ed by virtualbox should be linked with /usr/local/lib/gcc9/libstdc++.so.6 installed by lang/gcc9 which is used to build virtualbox-ose. However, rtld(1) chooses /usr/lib/libstdc++.so.6 to link due to the following configuration by ldconfig(8). === begin the output of ldconfig -r for libstdc++.so.6 % ldconfig -r | grep libstdc\+\+ 105:-lstdc++.6 => /usr/lib/libstdc++.so.6 1189:-lstdc++.6 => /usr/local/lib/gcc7/libstdc++.so.6 1201:-lstdc++.6 => /usr/local/lib/gcc8/libstdc++.so.6 1207:-lstdc++.6 => /usr/local/lib/gcc9/libstdc++.so.6 === end the output of ldconfig -r for libstdc++.so.6 I tried using LD_LIBRARY_PATH, but it had no effect. I would appreciate if someone gives any suggestion.
Actually the last change to GCC brought a number of issues. Right now port is unbuildable in presence of GCC 4.8: kBuild: Linking VBoxDDR0 filesplitter: Out of 165 files: 165 rewritten, 0 unchanged. (/tmp/ports/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/out/freebsd.amd64/release/obj/VirtualBox/include) kmk_builtin_append "/tmp/ports/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/out/freebsd.amd64/release/obj/VirtualBox/include/COMWrappers" kBuild: Linking VBoxDDRC kBuild: Generating /tmp/ports/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/out/freebsd.amd64/release/obj/Runtime/oiddb.h.ts ld-elf.so.1: /usr/local/lib/gcc48/libstdc++.so.6: version GLIBCXX_3.4.21 required by /tmp/ports/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.2.34/out/freebsd.amd64/release/obj/oiddb2c/oiddb2c not found I.e. it does pull GCC 9.3, but if GCC 4.8 is also present it's used also for linking. As I'm running 12-STABLE I have no /usr/lib/libstdc++.so.6 (and probably you shouldn't have it too). Please post your `uname -a`, system upgrade path used if any and if you are using source build whether you cleaned up local system by `make -C /usr/src delete-old`.
The required -rpath from bsd.gcc.mk isn't making it into the build properly.
I'm testing a patch to resolve this.
A commit references this bug: Author: bdrewery Date: Tue Mar 31 17:41:05 UTC 2020 New revision: 529993 URL: https://svnweb.freebsd.org/changeset/ports/529993 Log: - Fix runtime for gcc rpath. [1] This is a regression of something that was working in the past. Please keep the _GCC_RUNTIME handling even if removing USE_GCC as it may come back again in the future and be forgotten. - Fix build on 11.3 with ports ssl. [2] PR: 245048 [1] PR: 243315 [2] Submitted by: John Hein <jcfyecrayz at liamekaens.com> [2] Changes: head/emulators/virtualbox-ose/Makefile head/emulators/virtualbox-ose/files/patch-src_VBox_RDP-client-1.8.4-Makefile.kmk
A commit references this bug: Author: bdrewery Date: Tue Mar 31 17:46:10 UTC 2020 New revision: 529997 URL: https://svnweb.freebsd.org/changeset/ports/529997 Log: MFH: r529993 - Fix runtime for gcc rpath. [1] This is a regression of something that was working in the past. Please keep the _GCC_RUNTIME handling even if removing USE_GCC as it may come back again in the future and be forgotten. - Fix build on 11.3 with ports ssl. [2] PR: 245048 [1] PR: 243315 [2] Submitted by: John Hein <jcfyecrayz at liamekaens.com> [2] Approved by: portmgr (implicit) Changes: _U branches/2020Q1/ branches/2020Q1/emulators/virtualbox-ose/Makefile branches/2020Q1/emulators/virtualbox-ose/files/patch-src_VBox_RDP-client-1.8.4-Makefile.kmk
I'm sorry that it's too late to say thank you. And also, I'm afraid to say that gcc 4.8 didn't cause the error. As Mr. Volodymyr Kostyrko pointed out, FreeBSD (include my 11-stable:r359231 box) doesn't have /usr/lib/libstdc++.so.6. That might be installed into my box by accident. After removing that library, virtualbox works correctly. Anyway, it was great pleasure to hear that the bug caused by gcc 4.8 was fixed. Best regards,
Just a note: This problem did happen on 12.1-STABLE for me even without gcc4.8 installed, due to the presence of port misc/compat9x. The changes by bdrewery did NOT fix the build for me. Removing misc/compat9x fixed the build.