Bug 233073 - sysutils/uefi-edk2-bhyve Fails to build
Summary: sysutils/uefi-edk2-bhyve Fails to build
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Rebecca Cran
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-08 12:53 UTC by Rob Belics
Modified: 2021-05-03 05:30 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (araujo)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Belics 2018-11-08 12:53:42 UTC
11.2-RELEASE-p4

"/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/Build/gcc" -x c -E -P -DVFRCOMPILE --include /usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/Build/BhyveX64/RELEASE_GCC48/X64/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe/DEBUG/BdsDxeStrDefs.h -I/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr -I/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr -I/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint -I/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/IntelFrameworkModulePkg/Universal/BdsDxe -I/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/Build/BhyveX64/RELEASE_GCC48/X64/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe/DEBUG -I/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/MdePkg -I/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/MdePkg/Include -I/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/MdePkg/Include/X64 -I/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/MdeModulePkg -I/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/MdeModulePkg/Include -I/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/IntelFrameworkPkg -I/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/IntelFrameworkPkg/Include -I/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/IntelFrameworkModulePkg -I/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/IntelFrameworkModulePkg/Include /usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManagerVfr.Vfr > /usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/Build/BhyveX64/RELEASE_GCC48/X64/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe/OUTPUT/DeviceManagerVfr.i
"VfrCompile" -l -n --string-db /usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/Build/BhyveX64/RELEASE_GCC48/X64/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe/OUTPUT/BdsDxeStrDefs.hpk --output-directory /usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/Build/BhyveX64/RELEASE_GCC48/X64/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe/DEBUG/DeviceMngr /usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/Build/BhyveX64/RELEASE_GCC48/X64/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe/OUTPUT/DeviceManagerVfr.i
Cannot open "/usr/local/lib/gcc6/libstdc++.so.6"
make[2]: *** [GNUmakefile:945: /usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/Build/BhyveX64/RELEASE_GCC48/X64/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe/DEBUG/DeviceMngr/DeviceManagerVfr.c] Error 1
make[2]: Leaving directory '/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/Build/BhyveX64/RELEASE_GCC48/X64/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe'


build.py...
 : error 7000: Failed to execute command
	/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/Build/make tbuild [/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/Build/BhyveX64/RELEASE_GCC48/X64/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe]


build.py...
 : error F002: Failed to build module
	/usr/ports/sysutils/uefi-edk2-bhyve/work/uefi-edk2-0.2/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf [X64, GCC48, RELEASE]

- Failed -
Build end time: 06:45:56, Nov.08 2018
Build total time: 00:00:29

*** Error code 1

Stop.
make[1]: stopped in /usr/ports/sysutils/uefi-edk2-bhyve
*** Error code 1

Stop.
make: stopped in /usr/ports/sysutils/uefi-edk2-bhyve

===>>> make build failed for sysutils/uefi-edk2-bhyve
===>>> Aborting update
Comment 1 Rob Belics 2018-11-08 12:55:05 UTC
Build also fails for uefi-edk2-bhyve-csm
Comment 2 Rebecca Cran freebsd_committer 2019-03-28 21:15:08 UTC
I've also seen this occur, on a system with multiple gcc versions installed: for some reason the wrong one gets used when building BaseTools, then when those binaries are run they can't find libstdc++ for some reason.

The update to the port that's being worked on at the moment will fix that by statically linking the BaseTools binaries.
Comment 3 Walter Schwarzenfeld freebsd_triage 2019-08-14 08:59:33 UTC
Maintainer feedback, please!
Comment 5 Rene Ladan freebsd_committer 2020-11-03 20:53:31 UTC
Maintainer reset.
Comment 6 Rebecca Cran freebsd_committer 2021-02-18 03:09:24 UTC
I'm hoping this will have been fixed with the new update I just committed to sysutils/uefi-edk2-bhyve. 

I know this ticket is super old now, but would you like to verify? If not, I can check on FreeBSD 11.4 myself.
Comment 7 Matthias Pfaller 2021-02-18 10:34:41 UTC
(In reply to Rebecca Cran from comment #6)
This now fails (for me) on FreeBSD 12.2-RELEASE-p3. I'm building using synth.

regards, Matthias

make[1]: Entering directory '/construction/xports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/RELEASE_GCC5/X64/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint'
"gcc" -MMD -MF /construction/xports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/RELEASE_GCC5/X64/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint/OUTPUT/DriverEntryPoint.obj.deps -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common -ffunction-sections -fdata-sections -DSTRING_ARRAY_NAME=UefiDriverEntryPointStrings -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address -flto -DUSING_LTO -Os -Wno-unused-but-set-variable -Wno-unused-const-variable -DMDEPKG_NDEBUG -mno-mmx -mno-sse -D DISABLE_NEW_DEPRECATED_INTERFACES -D ENABLE_MD5_DEPRECATED_INTERFACES -c -o /construction/xports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/RELEASE_GCC5/X64/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint/OUTPUT/./DriverEntryPoint.obj -I/construction/xports/sysutils/uefi-edk2-bhyve/work/edk2-2e1e8c35f3178df95d79da81ac6deec242da74c2/MdePkg/Library/UefiDriverEntryPoint -I/construction/xports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/RELEASE_GCC5/X64/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint/DEBUG -I/construction/xports/sysutils/uefi-edk2-bhyve/work/edk2-2e1e8c35f3178df95d79da81ac6deec242da74c2/MdePkg -I/construction/xports/sysutils/uefi-edk2-bhyve/work/edk2-2e1e8c35f3178df95d79da81ac6deec242da74c2/MdePkg/Include -I/construction/xports/sysutils/uefi-edk2-bhyve/work/edk2-2e1e8c35f3178df95d79da81ac6deec242da74c2/MdePkg/Test/UnitTest/Include -I/construction/xports/sysutils/uefi-edk2-bhyve/work/edk2-2e1e8c35f3178df95d79da81ac6deec242da74c2/MdePkg/Include/X64 /construction/xports/sysutils/uefi-edk2-bhyve/work/edk2-2e1e8c35f3178df95d79da81ac6deec242da74c2/MdePkg/Library/UefiDriverEntryPoint/DriverEntryPoint.c
rm -f /construction/xports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/RELEASE_GCC5/X64/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint/OUTPUT/UefiDriverEntryPoint.lib
"gcc-ar" cr /construction/xports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/RELEASE_GCC5/X64/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint/OUTPUT/UefiDriverEntryPoint.lib  @/construction/xports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/RELEASE_GCC5/X64/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint/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[1]: *** [GNUmakefile:305: /construction/xports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/RELEASE_GCC5/X64/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint/OUTPUT/UefiDriverEntryPoint.lib] Error 64
make[1]: Leaving directory '/construction/xports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/RELEASE_GCC5/X64/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint'


build.py...
 : error 7000: Failed to execute command
        make tbuild [/construction/xports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/RELEASE_GCC5/X64/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint]


build.py...
 : error 7000: Failed to execute command
        make tbuild [/construction/xports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/RELEASE_GCC5/X64/MdePkg/Library/DxeHobLib/DxeHobLib]


build.py...
 : error 7000: Failed to execute command
        make tbuild [/construction/xports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/RELEASE_GCC5/X64/MdePkg/Library/DxeServicesLib/DxeServicesLib]


build.py...
 : error 7000: Failed to execute command
        make tbuild [/construction/xports/sysutils/uefi-edk2-bhyve/work/Build/BhyveX64/RELEASE_GCC5/X64/MdeModulePkg/Library/FileExplorerLib/FileExplorerLib]


build.py...
 : error F002: Failed to build module
        /construction/xports/sysutils/uefi-edk2-bhyve/work/edk2-2e1e8c35f3178df95d79da81ac6deec242da74c2/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf [X64, GCC5, RELEASE]

- Failed -
Build end time: 10:27:21, Feb.18 2021
Build total time: 00:00:13

*** Error code 1

Stop.
make: stopped in /xports/sysutils/uefi-edk2-bhyve



--------------------------------------------------
--  Termination
--------------------------------------------------
Finished: Thursday, 18 FEB 2021 at 10:27:21 UTC
Duration: 00:00:59
Comment 8 Ivan Rozhuk 2021-02-18 10:48:35 UTC
(In reply to Matthias Pfaller from comment #7)

ar: unrecognized option `--plugin'
should not happen.
Probably BINARY_ALIAS not work properly or your gcc-ar does not support this option.

I have gcc9 and gcc10 installed @ FreeBSD 13, builds ok from ports.
Comment 9 Matthias Pfaller 2021-02-18 11:50:36 UTC
(In reply to rozhuk.im from comment #8)
synth will use not use the installed toolchain. The build is (as far as I understand) done with the toolchain specified by the port or the default toolchain.
Comment 10 Matthias Pfaller 2021-02-25 12:17:05 UTC
For me this builds with the following patch:
--- Makefile~   2021-02-25 13:00:30.890068000 +0100
+++ Makefile    2021-02-25 13:02:15.076119000 +0100
@@ -18,7 +18,8 @@
 ONLY_FOR_ARCHS_REASON= bhyve firmware has only been ported to X64
 
 BUILD_DEPENDS= nasm:devel/nasm \
-               bash:shells/bash
+               bash:shells/bash \
+               ar:devel/binutils
 
 USES=          gmake \
                python:3.7+,build
@@ -35,7 +36,7 @@
 
 BINARY_ALIAS=  make=${LOCALBASE}/bin/gmake \
                gcc=${LOCALBASE}/bin/gcc${GCC_DEFAULT} \
-               gcc-ar=${LOCALBASE}/bin/gcc-ar${GCC_DEFAULT} \
+               gcc-ar=${LOCALBASE}/bin/ar \
                g++=${LOCALBASE}/bin/g++${GCC_DEFAULT} \
                python3=${PYTHON_CMD} python=${PYTHON_CMD}

synth will use gcc10 (GCC_DEFAULT). gcc-ar will be an alias for gcc-ar10. gcc-ar10 uses /usr/bin/ar. After aliasing gcc-ar to /usr/local/bin/ar the build is working. Is this a gcc10 bug and should get fixed there? gcc10 depends on binutils anyway.
Comment 11 Rebecca Cran freebsd_committer 2021-05-03 03:31:57 UTC
Sorry I haven't looked at this issue for a while.
I tried building sysutils/uefi-edk2-bhyve with synth on FreeBSD 12 today and it built without errors. 

I'll continue trying to replicate the problem.
Comment 12 Matthias Pfaller 2021-05-03 05:30:09 UTC
(In reply to Rebecca Cran from comment #11)
When switching to FreeBSD 13 I had to rebuild everything and due to port's switch to git I discarded the local patch.
At least on 13.0 the build did succeed now.