amd64 build fails within ESXi guest
mdf356 at gmail.com
Mon Jan 24 17:55:36 UTC 2011
On Mon, Jan 24, 2011 at 8:25 AM, Eric Crist <ecrist at 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)
* Isilon: get a compile error on a new hwpmc file:
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
for this workaround.
: "=a" (p), "=b" (p), "=c" (p), "=d" (p)
: "0" (ax));
__asm __volatile("push %%ebx \n\t" /* save %ebx */
"movl %%ebx, %1 \n\t" /* save what cpuid just put in %ebx */
"pop %%ebx \n\t" /* restore the old %ebx */
: "=a" (p), "=m" (p), "=c" (p), "=d" (p)
Note that using =r for the constraint on p isn't sufficient as once
in a while the compiler has chosen %ebx, which then leads to garbage
in the register after the pop.
More information about the freebsd-current