Bug 284483 - sysutils/grub2-efi: Fails to build with GCC 14: error: implicit declaration of function 'grub_env_set'; did you mean 'grub_memset'? [-Wimplicit-function-declaration]
Summary: sysutils/grub2-efi: Fails to build with GCC 14: error: implicit declaration o...
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: Lorenzo Salvadore
URL: https://pkg-status.freebsd.org/gohan0...
Keywords:
Depends on:
Blocks: 281091
  Show dependency treegraph
 
Reported: 2025-01-31 14:25 UTC by Lorenzo Salvadore
Modified: 2025-02-09 03:41 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lorenzo Salvadore freebsd_committer freebsd_triage 2025-01-31 14:25:42 UTC
The port fails to build with GCC 14, which is about to become GCC_DEFAULT version. This link can help: https://gcc.gnu.org/gcc-14/porting_to.html

grub-core/disk/geli.c: In function 'recover_key':
grub-core/disk/geli.c:449:3: error: implicit declaration of function 'grub_env_set'; did you mean 'grub_memset'? [-Wimplicit-function-declaration]
  449 |   grub_env_set ("gelipassphrase", passphrase);
      |   ^~~~~~~~~~~~
      |   grub_memset
grub-core/disk/geli.c:449:3: warning: nested extern declaration of 'grub_env_set' [-Wnested-externs]
gmake[2]: *** [Makefile:6329: grub-core/disk/libgrubkern_a-geli.o] Error 1
gmake[2]: Leaving directory '/wrkdirs/usr/ports/sysutils/grub2-efi/work/grub-2.02'
gmake[1]: *** [Makefile:11106: all-recursive] Error 1
gmake[1]: Leaving directory '/wrkdirs/usr/ports/sysutils/grub2-efi/work/grub-2.02'
gmake: *** [Makefile:3496: all] Error 2
*** Error code 1
Comment 1 commit-hook freebsd_committer freebsd_triage 2025-02-06 17:07:45 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9bc25ee236c4abd6b2cca81b2c845a9380f0008e

commit 9bc25ee236c4abd6b2cca81b2c845a9380f0008e
Author:     Lorenzo Salvadore <salvadore@FreeBSD.org>
AuthorDate: 2025-02-06 16:37:39 +0000
Commit:     Lorenzo Salvadore <salvadore@FreeBSD.org>
CommitDate: 2025-02-06 17:07:07 +0000

    sysutils/grub2-efi: Fix build with GCC 14

    GCC 14 turns some warnings into errors. Switch them back to warnings.

    PR:             284483

 sysutils/grub2-efi/Makefile | 1 +
 1 file changed, 1 insertion(+)
Comment 2 commit-hook freebsd_committer freebsd_triage 2025-02-09 03:41:51 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=891000e056fa707781d605bf47af2f31262cdbd3

commit 891000e056fa707781d605bf47af2f31262cdbd3
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2025-02-09 03:40:06 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2025-02-09 03:40:06 +0000

    sysutils/grub2-efi: the port had been improved (+)

    - Revert previous naive -fpermissive "fix" and #include
      <grub/env.h> to obtain the grub_env_set() prototype
    - Replace RUN_DEPENDS manipulation with USE_GCC=yes:build
      and hand-rolled `do-install' target with INSTALL_WRKSRC
    - While here, adjust LICENSE and wrap overly long lines

    Fixes:  9bc25ee236c4
    PR:     284483

 sysutils/grub2-efi/Makefile                         | 21 ++++++++-------------
 .../grub2-efi/files/patch-grub-core_disk_geli.c     | 16 ++++++++++++----
 2 files changed, 20 insertions(+), 17 deletions(-)