Bug 254078

Summary: new sysutils/uefi-edk2-bhyve will not compile
Product: Ports & Packages Reporter: doctor
Component: Individual Port(s)Assignee: Rebecca Cran <bcran>
Status: Open ---    
Severity: Affects Some People CC: bcran, dym, mpysw
Priority: --- Flags: linimon: maintainer-feedback? (bcran)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
compilation of port none

Description doctor 2021-03-07 00:51:31 UTC
Created attachment 223037 [details]
compilation of port

Compiliation will not recognise a C++ Library
Comment 1 Rebecca Cran freebsd_committer 2021-03-07 20:00:44 UTC
So the thing that ends up causing the build to fail is the following:

ld-elf.so.1: /usr/local/lib/compat/libstdc++.so.6: version CXXABI_1.3.8 required by /usr/ports/sysutils/uefi-edk2-bhyve/work/edk2-2e1e8c35f3178df95d79da81ac6deec242da74c2/BaseTools/Source/C/bin/VfrCompile not found

From my experience this is normally caused by an unusual toolchain configuration being installed, for example gcc48. From discussions on the mailing list I understand it's not caused by that this time, but it's possible options in /etc/make.conf are causing problems.
Comment 2 doctor 2021-03-08 07:18:22 UTC
In one system

there is no /etc/make.conf so defaults.
Comment 3 doctor 2021-03-08 07:29:55 UTC
Looks like the libstbc++.so is the issue.

Just a simple rename does the trick
Comment 4 Rebecca Cran freebsd_committer 2021-03-14 04:47:34 UTC
I think I might have found the issue.

If you don't mind doing some testing, could you do the following:
On the following line (line 83) in sysutils/uefi-edk2-bhyve/Makefile

(cd ${WRKDIR} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -C edk2-${GH_TAGNAME}/BaseTools -j ${MAKE_JOBS_NUMBER} ${_MAKE_JOBS})

Add the following at the end of the line but before the closing parenthesis:

EXTRA_LDFLAGS=-static

The line should look like:

(cd ${WRKDIR} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -C edk2-${GH_TAGNAME}/BaseTools -j ${MAKE_JOBS_NUMBER} ${_MAKE_JOBS} EXTRA_LDFLAGS=-static)
Comment 5 doctor 2021-05-21 11:17:17 UTC
How do I make this as solved?
Comment 6 Rebecca Cran freebsd_committer 2021-05-22 17:09:34 UTC
I'll add the static flag and close this ticket.
Comment 7 doctor 2021-06-18 07:03:57 UTC
Still not compiling for some reason
Comment 8 doctor 2021-06-18 14:12:59 UTC
Now I get 

te__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address -flto -DUSING_LTO -Os -mno-mmx -mno-sse -D DISABLE_NEW_DEPRECATED_INTERFACES -D ENABLE_MD5_DEPRECATED_INTERFACES -c -o /usr/ports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/DEBUG_GCC5/X64/MdePkg/Library/BasePeCoffLib/BasePeCoffLib/OUTPUT/./PeCoffLoaderEx.obj -I/usr/ports/sysutils/uefi-edk2-bhyve/work/edk2-edk2-stable202102/MdePkg/Library/BasePeCoffLib -I/usr/ports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/DEBUG_GCC5/X64/MdePkg/Library/BasePeCoffLib/BasePeCoffLib/DEBUG -I/usr/ports/sysutils/uefi-edk2-bhyve/work/edk2-edk2-stable202102/MdePkg -I/usr/ports/sysutils/uefi-edk2-bhyve/work/edk2-edk2-stable202102/MdePkg/Include -I/usr/ports/sysutils/uefi-edk2-bhyve/work/edk2-edk2-stable202102/MdePkg/Test/UnitTest/Include -I/usr/ports/sysutils/uefi-edk2-bhyve/work/edk2-edk2-stable202102/MdePkg/Include/X64 /usr/ports/sysutils/uefi-edk2-bhyve/work/edk2-edk2-stable202102/MdePkg/Library/BasePeCoffLib/PeCoffLoaderEx.c
rm -f /usr/ports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/DEBUG_GCC5/X64/MdePkg/Library/BasePeCoffLib/BasePeCoffLib/OUTPUT/BasePeCoffLib.lib
"gcc-ar" cr /usr/ports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/DEBUG_GCC5/X64/MdePkg/Library/BasePeCoffLib/BasePeCoffLib/OUTPUT/BasePeCoffLib.lib  @/usr/ports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/DEBUG_GCC5/X64/MdePkg/Library/BasePeCoffLib/BasePeCoffLib/OUTPUT/object_files.lst
ar: unrecognized option `--plugin'
usage:  ar -d [-Tjsvz] archive file ...
        ar -m [-Tjsvz] archive file ...
        ar -m [-Tabijsvz] position archive file ...
        ar -p [-Tv] archive [file ...]
        ar -q [-TcDjsUvz] archive file ...
        ar -r [-TcDjsUuvz] archive file ...
        ar -r [-TabcDijsUuvz] position archive file ...
        ar -s [-jz] archive
        ar -t [-Tv] archive [file ...]
        ar -x [-CTouv] archive [file ...]
        ar -V
make[2]: *** [GNUmakefile:311: /usr/ports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/DEBUG_GCC5/X64/MdePkg/Library/BasePeCoffLib/BasePeCoffLib/OUTPUT/BasePeCoffLib.lib] Error 64
make[2]: Leaving directory '/usr/ports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/DEBUG_GCC5/X64/MdePkg/Library/BasePeCoffLib/BasePeCoffLib'


build.py...
 : error 7000: Failed to execute command
        make tbuild [/usr/ports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/DEBUG_GCC5/X64/MdePkg/Library/BasePeCoffLib/BasePeCoffLib]


build.py...
 : error 7000: Failed to execute command
        make tbuild [/usr/ports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/DEBUG_GCC5/X64/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib]


build.py...
 : error F002: Failed to build module
        /usr/ports/sysutils/uefi-edk2-bhyve/work/edk2-edk2-stable202102/MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf [X64, GCC5, DEBUG]