The systemd ebuilds currently have gnu-efi in DEPEND to install it in SYSROOT, and it sets efi-libdir so meson uses the sysroot for libraries. It does not do the same for headers or the linker, so it tries to include gnu-efi headers from BROOT and uses the native ld program for linking. (There is also an efi-cc option that could be defined, but it defaults to the regular compiler, so it doesn't hurt to omit that one.)
Created attachment 686841 [details, diff] fix.patch
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e31cdca41fa4bdfd525ee197e5d4cd39a20b425 commit 8e31cdca41fa4bdfd525ee197e5d4cd39a20b425 Author: David Michael <fedora.dm0@gmail.com> AuthorDate: 2021-02-15 22:15:44 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2021-02-15 23:23:58 +0000 sys-apps/systemd: point all gnu-efi options at SYSROOT Closes: https://bugs.gentoo.org/770850 Package-Manager: Portage-3.0.13, Repoman-3.0.2 Signed-off-by: David Michael <fedora.dm0@gmail.com> Signed-off-by: Mike Gilbert <floppym@gentoo.org> sys-apps/systemd/systemd-246-r2.ebuild | 4 +++- sys-apps/systemd/systemd-246.6.ebuild | 2 ++ sys-apps/systemd/systemd-247.2-r4.ebuild | 2 ++ sys-apps/systemd/systemd-9999.ebuild | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-)