Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Jul 2012 05:40:52 -0400
From:      Richard Yao <ryao@gentoo.org>
To:        "hackers@FreeBSD.org" <hackers@FreeBSD.org>
Subject:   How does bootinfo64.c find read_eflags() and write_eflags() on amd64?
Message-ID:  <4FF16CA4.2040700@gentoo.org>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
/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?


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJP8WynAAoJECDuEZm+6ExkCcMP/0uZ5mr5JQV29cf0PYsDcf3j
uLjfgeeKNNlGQnc+N+wmKtuWXZuoqAY6HkXtk4dZcY3FsIynkbA7WE7edWedGcUY
mZ8BMN3rcJYx6FJSTnp4tz+X9to4xrchomiRA/7evO306myAmRz0eM629ozX6cMY
s7q1soM3q01BZDRKUfOU6DT/sg6O3xfaQtVhy6jUpjSqaq1kFcqbVwi2mq5N6GhD
fn9V50r0Kfqje5bLTEiaReBPUt2uxMoUBv5TI4hp23J4FfWuuJuCbLzKrVv17wVq
GyKgU8wHkuWnBnUqj0di44ZsnQeS7tetzFHM1xBpZ/ymPhQ62fvfJAMlenlhthX0
yhq4ILf7x0TXJuH9avWEZXMnvmV+J/yXfZyJ6nNEBreWsVBscBbOOqLr1gnVEDTT
IBrI/2JjqsTA86AQoZ7g2WCF3k2ZqFJCZVcgpCGtzTD+rQhXk6mDKtHl3JWwndNH
gurUZtdo1A02pZB7FGQJ3x9l2KzeP8dkvpxK9RHCmemzKCTSPRkLWT02l5v8EV8B
6El5UpGyn3PUa6YJDhYqqwkPeYDmD2XTAQAF+tRjKEzaRJOYdmc2IL16uRJtrn88
SiP3+V2CK4aAQWog+5x9+NO+Tz+RJU7fbMot7QAR9ax8MHsPVvwNpoM9Y3iqcBK/
Y1B2pQpdDcbjARJHJIKO
=kpkQ
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FF16CA4.2040700>