Re: git: 44fb9f2701c7 - main - sys/efi_map.h: This is a kernel-only file

From: Warner Losh <imp_at_bsdimp.com>
Date: Mon, 17 Nov 2025 05:16:58 UTC
On Sun, Nov 16, 2025 at 9:14 PM A FreeBSD User <freebsd@walstatt-de.de>
wrote:

> Am Tage des Herren Mon, 17 Nov 2025 00:18:29 GMT
> Warner Losh <imp@FreeBSD.org> schrieb:
>
> > The branch main has been updated by imp:
> >
> > URL:
> https://cgit.FreeBSD.org/src/commit/?id=44fb9f2701c71ce6bba75810fc6b7e735ecd5868
> >
> > commit 44fb9f2701c71ce6bba75810fc6b7e735ecd5868
> > Author:     Warner Losh <imp@FreeBSD.org>
> > AuthorDate: 2025-11-16 23:58:37 +0000
> > Commit:     Warner Losh <imp@FreeBSD.org>
> > CommitDate: 2025-11-17 00:16:26 +0000
> >
> >     sys/efi_map.h: This is a kernel-only file
> >
> >     Slap a #ifdef _KERNEL around it all since it's useless to userland.
> >
> >     Fixes:          43b8edb32051
> >     Sponsored by:   Netflix
> > ---
> >  sys/sys/efi_map.h | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/sys/sys/efi_map.h b/sys/sys/efi_map.h
> > index 8b458cd08b00..d2206056b1f8 100644
> > --- a/sys/sys/efi_map.h
> > +++ b/sys/sys/efi_map.h
> > @@ -7,6 +7,8 @@
> >  #ifndef _SYS_EFI_MAP_H_
> >  #define _SYS_EFI_MAP_H_
> >
> > +#ifdef _KERNEL
> > +
> >  #include <sys/efi.h>
> >  #include <machine/metadata.h>
> >
> > @@ -21,4 +23,6 @@ void efi_map_add_entries(struct efi_map_header
> *efihdr);
> >  void efi_map_exclude_entries(struct efi_map_header *efihdr);
> >  void efi_map_print_entries(struct efi_map_header *efihdr);
> >
> > +#endif
> > +
> >  #endif /* !_SYS_EFI_MAP_H_ */
> >
>
> Hello,
>
> tried a buildworld just now and it fails, something seems missing:
>
> [...]
> ===> stand/libsa (all)
> mkdir -p xlocale arpa ssp;  for i in a.out.h assert.h elf.h limits.h
> nlist.h setjmp.h stddef.h
> stdbool.h string.h strings.h time.h uuid.h; do  ln -sf /usr/src/include/$i
> $i;  done;  ln -sf
> /usr/src/sys/sys/errno.h errno.h;  ln -sf /usr/src/sys/sys/stdarg.h
> stdarg.h;  ln -sf
> /usr/src/sys/sys/stdint.h stdint.h;  ln -sf /usr/src/include/arpa/inet.h
> arpa/inet.h;  ln -sf
> /usr/src/include/arpa/tftp.h arpa/tftp.h;  ln -sf
> /usr/src/include/ssp/ssp.h ssp/ssp.h;  for i in _time.h _strings.h
> _string.h; do  [ -f xlocale/$i ] || :>
> xlocale/$i;  done;  for i in ctype.h fcntl.h signal.h stdio.h stdlib.h
> unistd.h; do  ln -sf
> /usr/src/stand/libsa/stand.h $i;  done cc -target
> x86_64-unknown-freebsd16.0
> --sysroot=/usr/obj/usr/src/amd64.amd64/tmp
> -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin  -O2
> -pipe -fno-common   -nostdinc    -I/usr/obj/usr/src/amd64.amd64/stand/libsa
> -I/usr/src/stand/libsa -D_STANDALONE -I/usr/src/sys
> -Ddouble=jagged-little-pill
> -Dfloat=floaty-mcfloatface -ffunction-sections -fdata-sections
> -DLOADER_GELI_SUPPORT
> -I/usr/src/stand/libsa/geli -DLOADER_DISK_SUPPORT -ffreestanding -mno-mmx
> -mno-sse -mno-avx
> -mno-avx2 -msoft-float -fPIC -mno-red-zone -mno-relax -I. -DLOADER_VERIEXEC
> -I/usr/src/lib/libsecureboot/h -DLOADER_VERIEXEC_VECTX -Iinclude
> -I/usr/src/contrib/bearssl/inc -Wno-deprecated-non-prototype
> -I/usr/src/contrib/bearssl/src
> -I/usr/src/lib/libsecureboot/h -DHAVE_BR_X509_TIME_CHECK -DNO_STDIO
> -I/usr/src/contrib/bearssl/tools -I. -DTRUST_ANCHOR_STR=ta_PEM
> -DVE_SHA256_SUPPORT
> -DVE_SHA384_SUPPORT  -DVE_RSA_SUPPORT -DVE_PCR_SUPPORT
> -I/usr/src/stand/efi/include
> -I/usr/src/lib/libsecureboot/efi/include
> -I/usr/src/stand/efi/include/amd64 -DNDEBUG -MD
> -MF.depend.efi_variables.o -MTefi_variables.o -std=gnu17
> -Wno-format-zero-length
> -Wsystem-headers -Wno-pointer-sign -Wdate-time -Wno-empty-body
> -Wno-string-plus-int
> -Wno-unused-const-variable -Wno-error=unused-but-set-parameter
> -Wno-error=cast-function-type-mismatch -Wno-tautological-compare
> -Wno-unused-value
> -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion
> -Wno-unused-local-typedef
> -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum
> -Wno-knr-promoted-parameter
> -Wno-parentheses  -Oz -Qunused-arguments     -c
> /usr/src/lib/libsecureboot/efi/efi_variables.c
> -o efi_variables.o In file included from
> /usr/src/lib/libsecureboot/efi/efi_variables.c:31:
> /usr/src/stand/efi/include/efi.h:47:10: fatal error: 'Uefi.h' file not
> found 47 | #include
> <Uefi.h>
> [...]


I've done 20 buildworlds today. And on what architecture? What do you have
in your src.conf since I'm not seeing this and I didn't think we built
libsecureboot by default. I certainly didn't fix it and didn't expect it to
include efi.h from stand. I'm skeptical about why since that file is
tailored to the boot loader only.

Warner