Bug 211074 - sysutils/uefi-edk2-bhyve: support building with gcc5 or later
Summary: sysutils/uefi-edk2-bhyve: support building with gcc5 or later
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Rebecca Cran
URL:
Keywords: feature, needs-qa, patch
Depends on:
Blocks:
 
Reported: 2016-07-13 08:51 UTC by Jan Beich
Modified: 2021-02-19 15:01 UTC (History)
8 users (show)

See Also:
rozhuk.im: merge-quarterly?


Attachments
v1 (1.84 KB, patch)
2016-07-13 08:51 UTC, Jan Beich
no flags Details | Diff
patch (2.28 KB, patch)
2020-06-10 00:00 UTC, Ivan Rozhuk
no flags Details | Diff
patch (2.76 KB, patch)
2021-02-14 19:11 UTC, Ivan Rozhuk
no flags Details | Diff
patch (2.66 KB, patch)
2021-02-15 11:53 UTC, Ivan Rozhuk
rozhuk.im: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2016-07-13 08:51:31 UTC
Created attachment 172457 [details]
v1

Respect GCC version preference in make.conf e.g., DEFAULT_VERSIONS=gcc=5 . I've only checked poudriere build with the following configuratins.

- 10.3R amd64, gcc48, uefi-edk2-bhyve + uefi-edk2-bhyve-csm: OK
- 10.3R amd64, gcc5, uefi-edk2-bhyve + uefi-edk2-bhyve-csm: OK
Comment 1 Fabian Freyer 2016-07-14 13:05:32 UTC
related to bug #211079, USE_GCC adds a RUN_DEPEND
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2016-07-14 13:41:50 UTC
Reporter is committer, assign accordingly
Comment 3 Jan Beich freebsd_committer freebsd_triage 2016-09-18 21:43:01 UTC
Resign - still no approval. Not sure why the patch here is blocked by bug 211079 but Clang remains out of scope i.e., after -Werror stuff it fails as

  $ BaseTools/Source/C/bin/GenFw -o Build/BhyveX64/RELEASE_GCC48/X64/BhyvePkg/BhyveAcpiTables/BhyveAcpiTables/OUTPUT/./Facp.acpi -c Build/BhyveX64/RELEASE_GCC48/X64/BhyvePkg/BhyveAcpiTables/BhyveAcpiTables/OUTPUT/./Facp.dll
  GenFw: ERROR 3000: Invalid
    Build/BhyveX64/RELEASE_GCC48/X64/BhyvePkg/BhyveAcpiTables/BhyveAcpiTables/OUTPUT/./Facp.dll unsupported ELF EM_X86_64 relocation 0x18.
  GenFw: ERROR 3000: Invalid
    Build/BhyveX64/RELEASE_GCC48/X64/BhyvePkg/BhyveAcpiTables/BhyveAcpiTables/OUTPUT/./Facp.dll unsupported ELF EM_X86_64 relocation 0x18.
Comment 4 Walter Schwarzenfeld freebsd_triage 2018-01-17 07:24:44 UTC
Is this still relevant?
Comment 5 Alan Somers freebsd_committer freebsd_triage 2018-02-08 15:49:08 UTC
It's more relevant than ever, now that gcc48 is deprecated.
Comment 6 Alan Somers freebsd_committer freebsd_triage 2018-02-08 15:51:34 UTC
It looks like upstream has fixed at least some of the problems with Clang.

https://github.com/tianocore/edk2/commit/d3bb711834acd3eda35a07d0be7911bc3dbb9e6f
Comment 7 Rebecca Cran freebsd_committer freebsd_triage 2018-12-24 07:11:06 UTC
The "ERROR 3000" message is due to the build trying to use the system ld linker.
Installing binutils from ports and setting up symlinks such that /usr/local/bin/ld is used lets the build complete.
Comment 8 Rebecca Cran freebsd_committer freebsd_triage 2018-12-24 07:13:52 UTC
Alan: one problem is that bhyve is stuck on the pretty ancient UDK2014 or UDK2014.SP1 branch (I can't recall which). Once I get my current work on UEFI support in the loader and installer out the way I plan to work on updating BhyvePkg to work with UDK2018.
Comment 9 Ivan Rozhuk 2020-06-10 00:00:31 UTC
Created attachment 215412 [details]
patch

This fix build with gcc9.
Try to fix clang but it require more time to dig into build system.
Comment 10 Rebecca Cran freebsd_committer freebsd_triage 2020-06-10 00:54:36 UTC
Thanks. I'm actually in the process of updating the port to use the latest edk2-stable202005 code: the last hurdle is fixing CSM support.

When that's done, there should be no more problems with using newer versions of GCC, though CLANG will still need work.
Comment 11 Rebecca Cran freebsd_committer freebsd_triage 2020-06-10 00:55:13 UTC
Take this ticket, since I'm working on updating the port.
Comment 12 Gerald Pfeifer freebsd_committer freebsd_triage 2020-06-14 20:16:05 UTC
(In reply to Rebecca Cran from comment #11)
> Take this ticket, since I'm working on updating the port.

Thank you, Rebecca!
Comment 13 Ivan Rozhuk 2020-12-22 22:48:47 UTC
I check, port with my patch build - ok.

Lets merge it and close this ticket.
Comment 14 Ivan Rozhuk 2021-02-14 19:11:10 UTC
Created attachment 222443 [details]
patch
Comment 15 Gerald Pfeifer freebsd_committer freebsd_triage 2021-02-14 19:41:21 UTC
(In reply to rozhuk.im from comment #14)

I'm not an expert in this port nor area, but even I can see some nice
improvements such as the loop to create syslinks.

Just to make sure, are all the AS="${AS}" etc. in MAKE_ARGS really
required?

And changing USE_GCC=4.8:build to USE_GCC=yes means that GCC becomes
a run time dependency, when it previous was not. I believe you'll want
USE_GCC=yes:build .

(This port is listing ports@FreeBSD.org as maintainer, so removing the
ask on Fabian.)
Comment 16 Rebecca Cran freebsd_committer freebsd_triage 2021-02-14 20:52:01 UTC
I still have a patch at https://reviews.freebsd.org/D27230 I'm hoping to commit some time (once the PCIe passthrough regression is resolved).
Comment 17 Ivan Rozhuk 2021-02-15 11:53:01 UTC
Created attachment 222462 [details]
patch
Comment 18 Rebecca Cran freebsd_committer freebsd_triage 2021-02-18 03:11:38 UTC
I've just committed an update to the port that allows it to build using any modern version of gcc.

See https://svnweb.freebsd.org/ports?view=revision&revision=565866 for details.
Comment 19 Ivan Rozhuk 2021-02-18 10:42:01 UTC
Build ok on 13.