/usr/src/sys/boot/i386/libi386/bootinfo64.c uses read_eflags() and
write_eflags(), which live as inline functions in
/usr/src/sys/i386/include/cpufunc.h.
/usr/src/sys/boot/i386/libi386/bootinfo64.c also includes
/usr/include/machine/cpufunc.h, but that is
/usr/src/sys/amd64/include/cpufunc.h on amd64, which does not contain
either of them.
I do not understand how FreeBSD's build system finds these. I am trying
to build /usr/src/sys/boot on Gentoo Linux, but Gentoo Linux does not
understand this either:
/var/tmp/portage/sys-boot/boot0-9.0/work/sys/boot/i386/loader/../libi386/libi386.a
/usr/lib/libstand.a
/var/tmp/portage/sys-boot/boot0-9.0/work/sys/boot/i386/loader/../libi386/libi386.a(bootinfo64.o):
In function `bi_load64':
bootinfo64.c:(.text+0x45a): undefined reference to `read_eflags'
bootinfo64.c:(.text+0x469): undefined reference to `write_eflags'
bootinfo64.c:(.text+0x46e): undefined reference to `read_eflags'
collect2: ld returned 1 exit status
*** Error code 1
Stop.
pmake: stopped in
/var/tmp/portage/sys-boot/boot0-9.0/work/sys/boot/i386/loader
How does bootinfo64.c obtain these symbols on FreeBSD?