amd64 build fails within ESXi guest

2011-01-24 Thread Eric Crist
I'm trying to build HEAD within an ESXi guest system, and the build errors 
while building the boot code.  I've attached the tail end of the log.  The host 
is a Dell Vostro 230 with CPU: Intel(R) Core(TM)2 Quad CPUQ8400  @ 2.66GHz 
(2659.61-MHz K8-class CPU) and the guest is allocated 256MB of RAM.  This is 
ESXi 4.1.0.

=== sys/boot/i386/libi386 (all)
cc -fPIC  -DLOADER_NFS_SUPPORT -DCOMPORT=0x3f8 -DCOMSPEED=9600 
-DSMBIOS_SERIAL_NUMBERS -DLOADER_GPT_SUPPORT -DTERM_EMU 
-Dalloca=__builtin_alloca -I/usr/src/sys/boot/i386/libi386/../../common 
-I/usr/src/sys/boot/i386/libi386/../btx/lib  
-I/usr/src/sys/boot/i386/libi386/../../../contrib/dev/acpica/include  
-I/usr/src/sys/boot/i386/libi386/../../.. -I. 
-I/usr/src/sys/boot/i386/libi386/../../../../lib/libstand/ -ffreestanding 
-mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 
-msoft-float -m32 -march=i386 -std=gnu99   -c 
/usr/src/sys/boot/i386/libi386/biosacpi.c
cc -fPIC  -DLOADER_NFS_SUPPORT -DCOMPORT=0x3f8 -DCOMSPEED=9600 
-DSMBIOS_SERIAL_NUMBERS -DLOADER_GPT_SUPPORT -DTERM_EMU 
-Dalloca=__builtin_alloca -I/usr/src/sys/boot/i386/libi386/../../common 
-I/usr/src/sys/boot/i386/libi386/../btx/lib  
-I/usr/src/sys/boot/i386/libi386/../../../contrib/dev/acpica/include  
-I/usr/src/sys/boot/i386/libi386/../../.. -I. 
-I/usr/src/sys/boot/i386/libi386/../../../../lib/libstand/ -ffreestanding 
-mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 
-msoft-float -m32 -march=i386 -std=gnu99   -c 
/usr/src/sys/boot/i386/libi386/bioscd.c
cc -fPIC  -DLOADER_NFS_SUPPORT -DCOMPORT=0x3f8 -DCOMSPEED=9600 
-DSMBIOS_SERIAL_NUMBERS -DLOADER_GPT_SUPPORT -DTERM_EMU 
-Dalloca=__builtin_alloca -I/usr/src/sys/boot/i386/libi386/../../common 
-I/usr/src/sys/boot/i386/libi386/../btx/lib  
-I/usr/src/sys/boot/i386/libi386/../../../contrib/dev/acpica/include  
-I/usr/src/sys/boot/i386/libi386/../../.. -I. 
-I/usr/src/sys/boot/i386/libi386/../../../../lib/libstand/ -ffreestanding 
-mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 
-msoft-float -m32 -march=i386 -std=gnu99   -c 
/usr/src/sys/boot/i386/libi386/biosdisk.c
cc -fPIC  -DLOADER_NFS_SUPPORT -DCOMPORT=0x3f8 -DCOMSPEED=9600 
-DSMBIOS_SERIAL_NUMBERS -DLOADER_GPT_SUPPORT -DTERM_EMU 
-Dalloca=__builtin_alloca -I/usr/src/sys/boot/i386/libi386/../../common 
-I/usr/src/sys/boot/i386/libi386/../btx/lib  
-I/usr/src/sys/boot/i386/libi386/../../../contrib/dev/acpica/include  
-I/usr/src/sys/boot/i386/libi386/../../.. -I. 
-I/usr/src/sys/boot/i386/libi386/../../../../lib/libstand/ -ffreestanding 
-mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 
-msoft-float -m32 -march=i386 -std=gnu99   -c 
/usr/src/sys/boot/i386/libi386/biosmem.c
cc -fPIC  -DLOADER_NFS_SUPPORT -DCOMPORT=0x3f8 -DCOMSPEED=9600 
-DSMBIOS_SERIAL_NUMBERS -DLOADER_GPT_SUPPORT -DTERM_EMU 
-Dalloca=__builtin_alloca -I/usr/src/sys/boot/i386/libi386/../../common 
-I/usr/src/sys/boot/i386/libi386/../btx/lib  
-I/usr/src/sys/boot/i386/libi386/../../../contrib/dev/acpica/include  
-I/usr/src/sys/boot/i386/libi386/../../.. -I. 
-I/usr/src/sys/boot/i386/libi386/../../../../lib/libstand/ -ffreestanding 
-mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 
-msoft-float -m32 -march=i386 -std=gnu99   -c 
/usr/src/sys/boot/i386/libi386/biospnp.c
cc -fPIC  -DLOADER_NFS_SUPPORT -DCOMPORT=0x3f8 -DCOMSPEED=9600 
-DSMBIOS_SERIAL_NUMBERS -DLOADER_GPT_SUPPORT -DTERM_EMU 
-Dalloca=__builtin_alloca -I/usr/src/sys/boot/i386/libi386/../../common 
-I/usr/src/sys/boot/i386/libi386/../btx/lib  
-I/usr/src/sys/boot/i386/libi386/../../../contrib/dev/acpica/include  
-I/usr/src/sys/boot/i386/libi386/../../.. -I. 
-I/usr/src/sys/boot/i386/libi386/../../../../lib/libstand/ -ffreestanding 
-mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 
-msoft-float -m32 -march=i386 -std=gnu99   -c 
/usr/src/sys/boot/i386/libi386/biospci.c
cc -fPIC  -DLOADER_NFS_SUPPORT -DCOMPORT=0x3f8 -DCOMSPEED=9600 
-DSMBIOS_SERIAL_NUMBERS -DLOADER_GPT_SUPPORT -DTERM_EMU 
-Dalloca=__builtin_alloca -I/usr/src/sys/boot/i386/libi386/../../common 
-I/usr/src/sys/boot/i386/libi386/../btx/lib  
-I/usr/src/sys/boot/i386/libi386/../../../contrib/dev/acpica/include  
-I/usr/src/sys/boot/i386/libi386/../../.. -I. 
-I/usr/src/sys/boot/i386/libi386/../../../../lib/libstand/ -ffreestanding 
-mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 
-msoft-float -m32 -march=i386 -std=gnu99   -c 
/usr/src/sys/boot/i386/libi386/biossmap.c
cc -fPIC  -DLOADER_NFS_SUPPORT -DCOMPORT=0x3f8 -DCOMSPEED=9600 
-DSMBIOS_SERIAL_NUMBERS -DLOADER_GPT_SUPPORT -DTERM_EMU 
-Dalloca=__builtin_alloca -I/usr/src/sys/boot/i386/libi386/../../common 
-I/usr/src/sys/boot/i386/libi386/../btx/lib  
-I/usr/src/sys/boot/i386/libi386/../../../contrib/dev/acpica/include  
-I/usr/src/sys/boot/i386/libi386/../../.. -I. 
-I/usr/src/sys/boot/i386/libi386/../../../../lib/libstand/ 

Re: amd64 build fails within ESXi guest

2011-01-24 Thread Matthew Fleming
On Mon, Jan 24, 2011 at 8:25 AM, Eric Crist ecr...@secure-computing.net wrote:
 I'm trying to build HEAD within an ESXi guest system, and the build errors 
 while building the boot code.  I've attached the tail end of the log.  The 
 host is a Dell Vostro 230 with CPU: Intel(R) Core(TM)2 Quad CPU    Q8400  @ 
 2.66GHz (2659.61-MHz K8-class CPU) and the guest is allocated 256MB of RAM.  
 This is ESXi 4.1.0.


Locally we've been building the amd64 kernel with a few different
flags and ran into this in our kernel build.

Try this definition of do_cpuid instead:


static __inline void
do_cpuid(u_int ax, u_int *p)
{
#if 0
/*
 * Isilon: get a compile error on a new hwpmc file:

/data/sb/BR_HAB_BSDMERGE_STABLE7/src/sys/modules/hwpmc/../../dev/hwpmc/hwpmc_core.c:
In function 'pmc_core_initialize':
./machine/cpufunc.h:111: error: can't find a register in class 'BREG'
while reloading 'asm'
./machine/cpufunc.h:111: error: 'asm' operand has impossible constraints

This presumably has to do with -fPIC.  See
http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well
for this workaround.
 */
__asm __volatile(cpuid
 : =a (p[0]), =b (p[1]), =c (p[2]), =d (p[3])
 :  0 (ax));
#else
__asm __volatile(push %%ebx   \n\t /* save %ebx */
 cpuid\n\t
 movl %%ebx, %1   \n\t /* save what cpuid just put in 
%ebx */
 pop %%ebx\n\t /* restore the old %ebx */
 : =a (p[0]), =m (p[1]), =c (p[2]), =d (p[3])
 : a(ax)
 : cc);
#endif
}

Note that using =r for the constraint on p[1] isn't sufficient as once
in a while the compiler has chosen %ebx, which then leads to garbage
in the register after the pop.

Thanks,
matthew
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org