VirtualBox 7 Compilation Issues on FreeBSD 15

After upgrading my machine from version 14 to 15, I encountered issues with VirtualBox. When I install the pre-compiled binary package, it works without any problems, but I can't use the bridge mode on the host machine. I suspect that this might be due to a kernel issue or a version mismatch between the binary and the kernel.

Therefore, I attempted to compile virtualbox-ose-70 from the source. However, I ran into some strange problems. I decided to make minimal changes to the Makefile in hopes of fixing the issues, but it didn't work, and the results remain the same.

I will attach the changes I made and the results for further reference.

Code:
Makefile
  39   │ HAS_CONFIGURE=      yes
  40   │ CONFIGURE_ARGS=     --disable-java --passive-mesa --disable-docs
  41   │ #CONFIGURE_ARGS+=   --with-gcc="${CC}" --with-g++="${CXX}"
  42   │ #CONFIGURE_ARGS+=   --with-gcc="clang" --with-g++="clang++" -fuse-ld=lld
  43   │ #LDFLAGS+= -fuse-ld=lld
  44   │ CONFIGURE_ARGS+= --with-gcc="clang" --with-g++="clang++"
  45   │ CXXFLAGS+= -fuse-ld=lld
  46   │ LDFLAGS+= -fuse-ld=lld

make LDFLAGS="-fuse-ld=lld"

Code:
===> Building for virtualbox-ose-70-7.0.26_1
cd /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26 && /bin/sh -c '. /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/env.sh &&  /usr/bin/env QT_SELECT=qt5 QMAKEMODULES="/usr/ports/emulators/virtualbox-ose-70/w
ork/VirtualBox-7.0.26/mkspecs/modules:/usr/local/lib/qt5/mkspecs/modules" OPENSSLBASE=/usr/local OPENSSLDIR=/usr/local/openssl OPENSSLINC=/usr/local/include OPENSSLLIB=/usr/local/lib OPENSSLRPATH=/usr/local/lib SDL_CONFIG=/usr/local/bin
/sdl-config XDG_DATA_HOME=/usr/ports/emulators/virtualbox-ose-70/work  XDG_CONFIG_HOME=/usr/ports/emulators/virtualbox-ose-70/work  XDG_CACHE_HOME=/usr/ports/emulators/virtualbox-ose-70/work/.cache  HOME=/usr/ports/emulators/virtualbox-
ose-70/work PATH=/usr/ports/emulators/virtualbox-ose-70/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin PKG_CONFIG_LIBDIR=/usr/ports/emulators/virtualbox-ose-70/work/.pkgconfig:/usr/local/libdata/pkgconf
ig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES ADDR2LINE="/usr/local/bin/addr2line" AR="/usr/local/bin/ar" AS="/usr/local/bin/as" CPPFILT="/usr/local/bin/c++filt" GP
ROF="/usr/local/bin/gprof" LD="/usr/local/bin/ld" NM="/usr/local/bin/nm" OBJCOPY="/usr/local/bin/objcopy" OBJDUMP="/usr/local/bin/objdump" RANLIB="/usr/local/bin/ranlib" READELF="/usr/local/bin/readelf" SIZE="/usr/local/bin/size" STRING
S="/usr/local/bin/strings" PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS="-DLIBICONV_PLUG"  LDFLAGS="-fuse-ld=lld" LIBS=""  CXX="c
++" CXXFLAGS="-O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing   -fuse-ld=lld -DLIBICONV_PLUG " BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"
BSD_INSTALL_DATA="install -m 0644" BSD_INSTALL_MAN="install -m 444" VBOX_LIBPATH_X11=/usr/local VBOX_FREEBSD_SRC=/usr/src/sys /usr/local/bin/kmk BUILD_TYPE=debug -j1'
/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/kBuild/footer-pass2-installs.kmk:67: warning: overriding recipe for target '/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/bin/src/vbox
drv/include/iprt/crc.h'
/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/kBuild/footer-pass2-installs.kmk:67: warning: ignoring old recipe for target '/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/bin/src/vb
oxdrv/include/iprt/crc.h'
/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/kBuild/footer-pass2-installs.kmk:67: warning: overriding recipe for target '/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/dist/bin/src
/vboxdrv/include/iprt/crc.h'
/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/kBuild/footer-pass2-installs.kmk:67: warning: ignoring old recipe for target '/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/dist/bin/s
rc/vboxdrv/include/iprt/crc.h'
/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/kBuild/footer-pass2-installs.kmk:67: warning: overriding recipe for target '/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/bin/src/vbox
drv/include/iprt/net.h'
/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/kBuild/footer-pass2-installs.kmk:67: warning: ignoring old recipe for target '/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/bin/src/vb
oxdrv/include/iprt/net.h'
/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/kBuild/footer-pass2-installs.kmk:67: warning: overriding recipe for target '/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/dist/bin/src
/vboxdrv/include/iprt/net.h'
/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/kBuild/footer-pass2-installs.kmk:67: warning: ignoring old recipe for target '/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/dist/bin/s
rc/vboxdrv/include/iprt/net.h'
kBuild: Pass - Build Programs
kBuild: Pass - Libraries
kBuild: Pass - DLLs
kBuild: Linking VMMR0
/usr/bin/ld.bfd: BFD 2.17.50 [FreeBSD] 2007-07-03 internal error, aborting at /usr/src/gnu/usr.bin/binutils/libbfd/../../../../contrib/binutils/bfd/reloc.c line 445 in unsigned int bfd_get_reloc_size(reloc_howto_type *)

/usr/bin/ld.bfd: Please report this bug.

clang++: error: linker command failed with exit code 1 (use -v to see invocation)
kmk: *** [/usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/kBuild/footer-pass2-compiling-targets.kmk:776: /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0.r0] Error 1
The failing command:
@clang++ -shared  -g                   -nostdlib -Bsymbolic -g -fuse-ld=bfd      -o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0.r0 -Wl,-soname=VMMR0.r0 /usr/ports/emulato
rs/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/dtrace/VBoxVMM-dtrace-object-format.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/CPUMR0.o /usr/port
s/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/CPUMR0A.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/DBGFR0.o /usr/ports/emulators/v
irtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/DBGFR0Bp.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/DBGFR0Tracer.o /usr/ports/emulators/virtual
box-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/GIMR0.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/GIMR0Hv.o /usr/ports/emulators/virtualbox-ose-70/wor
k/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/GMMR0.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/GVMMR0.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.
0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/EMR0.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/HMR0.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.a
md64/debug/obj/VMMR0/VMMR0/HMR0A.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/HMR0UtilA.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/o
bj/VMMR0/VMMR0/HMVMXR0.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/HMSVMR0.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMM
R0/IEMR0.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/IOMR0.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/IOMR0IoPort.o
 /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/IOMR0Mmio.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/PDMR0Device.o /usr/
ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/PDMR0DevHlp.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/PDMR0DevHlpTracing.o /u
sr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/PDMR0Driver.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/PDMR0Queue.o /usr/po
rts/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/PGMR0.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/PGMR0Pool.o /usr/ports/emulator
s/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/PGMR0SharedPage.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/TMR0.o /usr/ports/emulators/virtu
albox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/VMMR0.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMRZ/CPUMRZ.o /usr/ports/emulators/virtualbox-ose-70/wo
rk/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMRZ/CPUMRZA.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMRZ/VMMRZ.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-
7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/APICAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/CPUMAllCpuId.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.2
6/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/CPUMAllRegs.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/CPUMAllMsrs.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/
out/freebsd.amd64/debug/obj/VMMR0/VMMAll/DBGFAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/DBGFAllBp.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/free
bsd.amd64/debug/obj/VMMR0/VMMAll/DBGFAllTracer.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/EMAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.am
d64/debug/obj/VMMR0/VMMAll/GCMAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/GIMAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/ob
j/VMMR0/VMMAll/GIMAllHv.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/GIMAllKvm.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0
/VMMAll/HMAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/HMSVMAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/HMV
MXAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/IEMAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/IEMAllInstruc
tionsInterpretOnly.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/IEMAllAImpl.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VM
MAll/IEMAllAImplC.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/IEMAllCImpl.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMM
All/IEMAllCImplSvmInstr.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/IEMAllCImplVmxInstr.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug
/obj/VMMR0/VMMAll/IOMAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/IOMAllMmioNew.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/
VMMR0/VMMAll/MMAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/NEMAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/
PDMAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/PDMAllCritSect.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/PDMA
llCritSectRw.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/PDMAllCritSectBoth.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/V
MMAll/PDMAllIommu.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/PDMAllQueue.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMM
All/PDMAllTask.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/PGMAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/PGMA
llHandler.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/PGMAllPhys.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/PGMAl
lPool.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/SELMAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/TMAll.o /usr
/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/TMAllCpu.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/TMAllReal.o /usr/ports/
emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/TMAllVirtual.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/TRPMAll.o /usr/ports/emula
tors/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/VMAll.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/VMMAll.o /usr/ports/emulators/virtualb
ox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/VMMAllA.o /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMAll/PDMAllNetShaper.o /usr/ports/emulators/virtualbox
-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/obj/VMMR0/VMMR0/VMMR0JmpA-amd64.o     /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/lib/ServicesR0.a   /usr/ports/emulators/virtualbox-ose-70
/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/lib/RuntimeR0.a   /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/freebsd.amd64/debug/lib/DisasmR0.a   /usr/ports/emulators/virtualbox-ose-70/work/VirtualBox-7.0.26/out/f
reebsd.amd64/debug/lib/VBox-SoftFloatR0.a 
*** Error code 2

Stop.
make[1]: stopped making "/usr/ports/emulators/virtualbox-ose-70/work/.stage_done.virtualbox-ose._usr_local" in /usr/ports/emulators/virtualbox-ose-70
*** Error code 1

Stop.
make: stopped making "all" in /usr/ports/emulators/virtualbox-ose-70
 
Has no one seen this post in the past day? Has this never happened to you? Did I make a mistake? Did I ask my question in the wrong place? Or was my question wrong and had a simple and clear answer that I just didn’t know? Or I don’t know? At least one person could tell me whether my question was right or wrong. Well, I faced this problem and thought maybe at least one person could guide me, even though I even sought help from AI, but I couldn't solve it.
 
Hi t4z3v4r3d i am new to FreeBSD (Windows user/loser for 26 years.) I do not use ports yet but i tried to do some research for you. Atleast one answer is better than no answer.

I see -fuse-ld=bfd in your output. Shouldn't we see errors regarding LLD?

Have you tried -fuse-ld=/path/to/lld or reinstalling lld?
 
johnjohn
Thank you for your response. I tried, but this method was not successful either. I'm not sure where I am making a mistake; could it be due to changes in the main version of the system? I do remember having the same issue in version 14, but I can't recall how I resolved it.
 
Hi t4z3v4r3d I got the path data wrong. My apologies for this error. I will post the correct information but offer a different solution.

according to the Wiki:
"lld has no built-in search paths (/lib, /usr/lib). search paths must be explicitly specified, with -L/lib -L/usr/lib"

"when the linker is used to convert an arbitrary binary file into an ELF object (via -r -b binary) lld must have the output target specified explicitly with -m." https://wiki.freebsd.org/LLD

so the correct path specification appears to be a -L (Library Directory) flag:
-L/usr/local/lib -lmylib -Wl,-rpath,/usr/local/lib

example of runtime path for a specific library:
-L/usr/local/lib -lSoftFloatR0.a -Wl,-rpath,/usr/local/lib

for future reference, LDFLAGS+= -Wl,--as-needed could make a difference with certain ports.

However, https://www.freshports.org/emulators/virtualbox-ose-70/ comments reveal that others have also had problems building ose-7 but claim to have successful builds by adding USE_BINUTILS=yes to the Makefile.

according to the freshports page, "virtualbox-ose-70 explicitly depends on binutils (-fuse-ld=bfd in Config.kmk)."

I haven't looked at ose-7 because i actually hate VirtualBox 7. I've uninstalled it on Windows and reverted to 6.1.50. I do not remember a reason why i hate it but i do remember being pretty mad about something and i yanked it from my system.

Anyway, try specifying binutils in the make file and see if it resolves the issue. let us know ...
 
Unfortunately, I don't know why this code is not compiling. The option you mentioned is also in the main configuration. Hmm... I think I should go to the VirtualBox forum and report it, apparently
Thanks ;)
 
well that would be a good idea if FreeBSD is at Stable release but it is really a courtesy to download and install development versions. version 15 stable will not be released until November/December if i remember correctly. I think that reporting it as a VirtualBox or FreeBSD issue is a bit premature. I canno even tell you if this is a problem in 14.2 stable. I haven't tried to build and compile it. For all we know, it could be an LLVM problem. I recommend waiting until 15 Stable is released. I'm sure that any VirtualBox problems will be fixed quickly. VirtualBox is very popular software. I've used it since version 4 and i've never had a problem with it. I hope that you understand why i suggest waiting to report build failures. I do not want my intentions to be misunderstood. I just think that it is premature. I recommend double-checking installations such as ld, LLVM and even update the ports tree. If all else fails, then perhaps any problems will be repaired before Stable release...

I hope that you have a nice day :)
 
/usr/bin/ld.bfd: Please report this bug.
I am also using 14.2-RELEASE-p3. ld.bfd and ld.gold are located in /usr/local/bin, while ld.lld is located in /usr/bin. I have gcc14 and binutils-2.44,1 installed. Have you checked /usr/bin to see if this is where ld.bfd is located?
 

Attachments

  • ulb.jpg
    ulb.jpg
    30.1 KB · Views: 220
  • ub.jpg
    ub.jpg
    21.3 KB · Views: 191
I am currently recompiling the entire system from scratch. Right now, I am reinstalling the compilers from the beginning. The issue might have been with the installation from the source. Thank you for the responses


ls /usr/local/bin | grep ld.g
ld.gold
ls /usr/bin/ | grep ld.
colldef
ld.bfd
ld.lld
ldd
ldd32
lldb
lldb-server
lldb-tblgen


And ... Nothing ;)
 
Last edited:
Back
Top