How does bootinfo64.c find read_eflags() and write_eflags() on amd64?

Richard Yao ryao at gentoo.org
Mon Jul 2 09:42:56 UTC 2012


/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:

# env CFLAGS="-march=core2 -mtune=core2 -O2 -pipe -O2
-fno-strict-aliasing -D__FreeBSD__=9 -D__FBSDID\(x\)= -nostdinc
-I/var/tmp/portage/sys-boot/boot0-9.0/work/include_proper"
MACHINE_CPUARCH=amd64 MACHINE_ARCH=amd64
MAKESYSPATH=/usr/share/mk/freebsd pmake
Warning: Object directory not changed from original
/var/tmp/portage/sys-boot/boot0-9.0/work/sys/boot/i386/loader
cc -march=core2 -mtune=core2 -O2 -pipe -O2 -fno-strict-aliasing
-D__FreeBSD__=9 -D__FBSDID\(x\)= -nostdinc
-I/var/tmp/portage/sys-boot/boot0-9.0/work/include_proper
-DLOADER_NFS_SUPPORT -DBOOT_FORTH
-I/var/tmp/portage/sys-boot/boot0-9.0/work/sys/boot/i386/loader/../../ficl
-I/var/tmp/portage/sys-boot/boot0-9.0/work/sys/boot/i386/loader/../../ficl/i386
-DLOADER_GZIP_SUPPORT -DLOADER_GPT_SUPPORT
-I/var/tmp/portage/sys-boot/boot0-9.0/work/sys/boot/i386/loader/../../common
-I. -Wall
-I/var/tmp/portage/sys-boot/boot0-9.0/work/sys/boot/i386/loader/..
-I/var/tmp/portage/sys-boot/boot0-9.0/work/sys/boot/i386/loader/../btx/lib
-ffreestanding -mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow
-mno-sse -mno-sse2 -mno-sse3 -msoft-float -m32 -march=i386 -std=gnu99
-static -Wl,-Ttext,0x0 -nostdlib -Wl,-m,elf_i386 -o loader.sym
/var/tmp/portage/sys-boot/boot0-9.0/work/sys/boot/i386/loader/../btx/lib/crt0.o
main.o conf.o vers.o boot.o commands.o console.o devopen.o disk.o
interp.o interp_backslash.o interp_parse.o ls.o misc.o module.o panic.o
load_elf32.o load_elf32_obj.o reloc_elf32.o load_elf64.o
load_elf64_obj.o reloc_elf64.o bcache.o isapnp.o pnp.o interp_forth.o
/var/tmp/portage/sys-boot/boot0-9.0/work/sys/boot/i386/loader/../../ficl/libficl.a

/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?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20120702/c02eb265/signature.pgp


More information about the freebsd-hackers mailing list