Skip to contentSkip to conversation

problems compiling xen on a crusoe

DISCUSSION A Streetcar Named 2 participants 8 messages Nov 14, 2004 – Nov 15, 2004

lore
Share & tools
lore
#0 lore raw

Hi.

I'm trying to compile Xen 2.0 on a crusoe-powered notebook, but make world seems to fail when making xen, even before building tools or the kernel. This is on a transmeta crusoe 5800 CPU, running Gentoo.

Any idea what might be wrong? I have no idea what the error message below means.

# make world
make clean
[snip]
 __  __            ____    ___
 \ \/ /___ _ __   |___ \  / _ \
  \  // _ \ '_ \    __) || | | |
  /  \  __/ | | |  / __/ | |_| |
 /_/\_\___|_| |_| |_____(_)___/

make[3]: Leaving directory `/root/xen/t/xen-2.0/xen'
make -C common
make[3]: Entering directory `/root/xen/t/xen-2.0/xen/common' gcc -nostdinc -fno-builtin -fno-common -fno-strict-aliasing -iwithprefix include -Wall -Werror -pipe -I/root/xen/t/xen-2.0/xen/include -Wno-pointer-arith -Wredundant-decls -O3 -fomit-frame-pointer -msoft-float -m32 -march=i686 -DNDEBUG -c ac_timer.c -o ac_timer.o
gcc -nostdinc -fno-builtin -fno-common -fno-strict-aliasing -iwithprefix include -Wall -Werror -pipe -I/root/xen/t/xen-2.0/xen/include -Wno-pointer-arith -Wredundant-decls -O3 -fomit-frame-pointer -msoft-float -m32 -march=i686 -DNDEBUG -c dom0_ops.c -o dom0_ops.o
dom0_ops.c: In function `do_dom0_op':
/root/xen/t/xen-2.0/xen/include/asm/mm.h:160: error: can't find a register in class BREG' while reloading asm' /root/xen/t/xen-2.0/xen/include/asm/mm.h:160: error: can't find a register in class BREG' while reloading asm'
make[3]: *** [dom0_ops.o] Error 1
make[3]: Leaving directory `/root/xen/t/xen-2.0/xen/common' make[2]: *** [/root/xen/t/xen-2.0/xen/xen] Error 2
make[2]: Leaving directory `/root/xen/t/xen-2.0/xen' make[1]: *** [xen] Error 2
make[1]: Leaving directory `/root/xen/t/xen-2.0'
make: *** [world] Error 2

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#1 lore raw

What GCC version are you using (gcc --version)?

-- Keir

Quoted 45 lines

Hi.

I'm trying to compile Xen 2.0 on a crusoe-powered notebook, but make world seems to fail when making xen, even before building tools or the kernel. This is on a transmeta crusoe 5800 CPU, running Gentoo.

Any idea what might be wrong? I have no idea what the error message below means.

# make world
make clean
[snip]
 __  __            ____    ___
 \ \/ /___ _ __   |___ \  / _ \
  \  // _ \ '_ \    __) || | | |
  /  \  __/ | | |  / __/ | |_| |
 /_/\_\___|_| |_| |_____(_)___/

make[3]: Leaving directory `/root/xen/t/xen-2.0/xen' make -C common
make[3]: Entering directory `/root/xen/t/xen-2.0/xen/common' gcc -nostdinc -fno-builtin -fno-common -fno-strict-aliasing

(quoted diff) +0 -3
-iwithprefix include -Wall -Werror -pipe
-I/root/xen/t/xen-2.0/xen/include -Wno-pointer-arith -Wredundant-decls
-O3 -fomit-frame-pointer -msoft-float -m32 -march=i686 -DNDEBUG -c

ac_timer.c -o ac_timer.o
gcc -nostdinc -fno-builtin -fno-common -fno-strict-aliasing

(quoted diff) +0 -3
-iwithprefix include -Wall -Werror -pipe
-I/root/xen/t/xen-2.0/xen/include -Wno-pointer-arith -Wredundant-decls
-O3 -fomit-frame-pointer -msoft-float -m32 -march=i686 -DNDEBUG -c

dom0_ops.c -o dom0_ops.o
dom0_ops.c: In function `do_dom0_op':
/root/xen/t/xen-2.0/xen/include/asm/mm.h:160: error: can't find a register in class BREG' while reloading asm' /root/xen/t/xen-2.0/xen/include/asm/mm.h:160: error: can't find a register in class BREG' while reloading asm'
make[3]: *** [dom0_ops.o] Error 1
make[3]: Leaving directory /root/xen/t/xen-2.0/xen/common' make[2]: *** [/root/xen/t/xen-2.0/xen/xen] Error 2 make[2]: Leaving directory /root/xen/t/xen-2.0/xen' make[1]: *** [xen] Error 2
make[1]: Leaving directory `/root/xen/t/xen-2.0'
make: *** [world] Error 2

Quoted 9 lines

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xen-devel

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#2 lore raw

gcc (GCC) 3.3.4 20040623 (Gentoo Hardened Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)

Quoted 52 lines · Keir Fraser

What GCC version are you using (gcc --version)?

-- Keir

Quoted 45 lines

Hi.

I'm trying to compile Xen 2.0 on a crusoe-powered notebook, but make world seems to fail when making xen, even before building tools or the kernel. This is on a transmeta crusoe 5800 CPU, running Gentoo.

Any idea what might be wrong? I have no idea what the error message below means.

# make world
make clean
[snip]
 __  __            ____    ___
 \ \/ /___ _ __   |___ \  / _ \
  \  // _ \ '_ \    __) || | | |
  /  \  __/ | | |  / __/ | |_| |
 /_/\_\___|_| |_| |_____(_)___/

make[3]: Leaving directory `/root/xen/t/xen-2.0/xen' make -C common
make[3]: Entering directory `/root/xen/t/xen-2.0/xen/common' gcc -nostdinc -fno-builtin -fno-common -fno-strict-aliasing

(quoted diff) +0 -3
-iwithprefix include -Wall -Werror -pipe
-I/root/xen/t/xen-2.0/xen/include -Wno-pointer-arith -Wredundant-decls
-O3 -fomit-frame-pointer -msoft-float -m32 -march=i686 -DNDEBUG -c

ac_timer.c -o ac_timer.o
gcc -nostdinc -fno-builtin -fno-common -fno-strict-aliasing

(quoted diff) +0 -3
-iwithprefix include -Wall -Werror -pipe
-I/root/xen/t/xen-2.0/xen/include -Wno-pointer-arith -Wredundant-decls
-O3 -fomit-frame-pointer -msoft-float -m32 -march=i686 -DNDEBUG -c

dom0_ops.c -o dom0_ops.o
dom0_ops.c: In function `do_dom0_op':
/root/xen/t/xen-2.0/xen/include/asm/mm.h:160: error: can't find a register in class BREG' while reloading asm' /root/xen/t/xen-2.0/xen/include/asm/mm.h:160: error: can't find a register in class BREG' while reloading asm'
make[3]: *** [dom0_ops.o] Error 1
make[3]: Leaving directory /root/xen/t/xen-2.0/xen/common' make[2]: *** [/root/xen/t/xen-2.0/xen/xen] Error 2 make[2]: Leaving directory /root/xen/t/xen-2.0/xen' make[1]: *** [xen] Error 2
make[1]: Leaving directory `/root/xen/t/xen-2.0'
make: *** [world] Error 2

Quoted 11 lines
Quoted 9 lines

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xen-devel

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#3 lore raw

Please try adding '-nopie' to the 'CFLAGS := ...' in xen/arch/x86/Rules.mk:
CFLAGS := -nopie -nostdinc -fno-builtin -fno-common -fno-strict-aliasing

If that doesn't help then also try adding '-fno-stack-protector' and '-f-nostack-protector-all'.

Let me know if this works out and I'll add the required options to the the repository (may not be because non-PIE/SSP GCCs may barf on the above command-line options).

-- Keir

Quoted 68 lines

gcc (GCC) 3.3.4 20040623 (Gentoo Hardened Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)

Quoted 63 lines · Keir Fraser

What GCC version are you using (gcc --version)?

-- Keir

Quoted 54 lines

Hi.

I'm trying to compile Xen 2.0 on a crusoe-powered notebook, but make world seems to fail when making xen, even before building tools or the kernel. This is on a transmeta crusoe 5800 CPU, running Gentoo.

Any idea what might be wrong? I have no idea what the error message below means.

# make world
make clean
[snip]
 __  __            ____    ___
 \ \/ /___ _ __   |___ \  / _ \
  \  // _ \ '_ \    __) || | | |
  /  \  __/ | | |  / __/ | |_| |
 /_/\_\___|_| |_| |_____(_)___/

make[3]: Leaving directory `/root/xen/t/xen-2.0/xen' make -C common
make[3]: Entering directory `/root/xen/t/xen-2.0/xen/common' gcc -nostdinc -fno-builtin -fno-common -fno-strict-aliasing

(quoted diff) +0 -3
-iwithprefix include -Wall -Werror -pipe
-I/root/xen/t/xen-2.0/xen/include -Wno-pointer-arith -Wredundant-decls
-O3 -fomit-frame-pointer -msoft-float -m32 -march=i686 -DNDEBUG -c

ac_timer.c -o ac_timer.o
gcc -nostdinc -fno-builtin -fno-common -fno-strict-aliasing

(quoted diff) +0 -3
-iwithprefix include -Wall -Werror -pipe
-I/root/xen/t/xen-2.0/xen/include -Wno-pointer-arith -Wredundant-decls
-O3 -fomit-frame-pointer -msoft-float -m32 -march=i686 -DNDEBUG -c

dom0_ops.c -o dom0_ops.o
dom0_ops.c: In function `do_dom0_op':
/root/xen/t/xen-2.0/xen/include/asm/mm.h:160: error: can't find a register in class BREG' while reloading asm' /root/xen/t/xen-2.0/xen/include/asm/mm.h:160: error: can't find a register in class BREG' while reloading asm'
make[3]: *** [dom0_ops.o] Error 1
make[3]: Leaving directory /root/xen/t/xen-2.0/xen/common' make[2]: *** [/root/xen/t/xen-2.0/xen/xen] Error 2 make[2]: Leaving directory /root/xen/t/xen-2.0/xen' make[1]: *** [xen] Error 2
make[1]: Leaving directory `/root/xen/t/xen-2.0'
make: *** [world] Error 2

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xen-devel

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#4 lore raw

-nopie fixed the originally reported error, but I subsequently got other errors that said something like "undefined reference to __guard'" and "undefined reference to __stack_smash_handler'". Adding -fno-stack-protector seems to have solved these as well, and I'm now compiling the kernels for the crusoe.

Thanks!

Quoted 5 lines · Keir Fraser

Please try adding '-nopie' to the 'CFLAGS := ...' in xen/arch/x86/Rules.mk:
CFLAGS := -nopie -nostdinc -fno-builtin -fno-common -fno-strict-aliasing

Quoted 82 lines

If that doesn't help then also try adding '-fno-stack-protector' and '-f-nostack-protector-all'.

Let me know if this works out and I'll add the required options to the the repository (may not be because non-PIE/SSP GCCs may barf on the above command-line options).

-- Keir

Quoted 68 lines

gcc (GCC) 3.3.4 20040623 (Gentoo Hardened Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)

Quoted 63 lines · Keir Fraser

What GCC version are you using (gcc --version)?

-- Keir

Quoted 54 lines

Hi.

I'm trying to compile Xen 2.0 on a crusoe-powered notebook, but make world seems to fail when making xen, even before building tools or the kernel. This is on a transmeta crusoe 5800 CPU, running Gentoo.

Any idea what might be wrong? I have no idea what the error message below means.

# make world
make clean
[snip]
 __  __            ____    ___
 \ \/ /___ _ __   |___ \  / _ \
  \  // _ \ '_ \    __) || | | |
  /  \  __/ | | |  / __/ | |_| |
 /_/\_\___|_| |_| |_____(_)___/

make[3]: Leaving directory `/root/xen/t/xen-2.0/xen' make -C common
make[3]: Entering directory `/root/xen/t/xen-2.0/xen/common' gcc -nostdinc -fno-builtin -fno-common -fno-strict-aliasing

(quoted diff) +0 -3
-iwithprefix include -Wall -Werror -pipe
-I/root/xen/t/xen-2.0/xen/include -Wno-pointer-arith -Wredundant-decls
-O3 -fomit-frame-pointer -msoft-float -m32 -march=i686 -DNDEBUG -c

ac_timer.c -o ac_timer.o
gcc -nostdinc -fno-builtin -fno-common -fno-strict-aliasing

(quoted diff) +0 -3
-iwithprefix include -Wall -Werror -pipe
-I/root/xen/t/xen-2.0/xen/include -Wno-pointer-arith -Wredundant-decls
-O3 -fomit-frame-pointer -msoft-float -m32 -march=i686 -DNDEBUG -c

dom0_ops.c -o dom0_ops.o
dom0_ops.c: In function `do_dom0_op':
/root/xen/t/xen-2.0/xen/include/asm/mm.h:160: error: can't find a register in class BREG' while reloading asm' /root/xen/t/xen-2.0/xen/include/asm/mm.h:160: error: can't find a register in class BREG' while reloading asm'
make[3]: *** [dom0_ops.o] Error 1
make[3]: Leaving directory /root/xen/t/xen-2.0/xen/common' make[2]: *** [/root/xen/t/xen-2.0/xen/xen] Error 2 make[2]: Leaving directory /root/xen/t/xen-2.0/xen' make[1]: *** [xen] Error 2
make[1]: Leaving directory `/root/xen/t/xen-2.0'
make: *** [world] Error 2

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xen-devel

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#5 lore raw
Quoted 7 lines

-nopie fixed the originally reported error, but I subsequently got other errors that said something like "undefined reference to __guard'" and "undefined reference to __stack_smash_handler'". Adding -fno-stack-protector seems to have solved these as well, and I'm now compiling the kernels for the crusoe.

Thanks!

I've checked in a patch to the unstable tree that will allow to build with PIE/SSP-enabled GCC.

-- Keir

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#6 lore raw
Quoted 8 lines · Keir Fraser
Quoted 6 lines

-nopie fixed the originally reported error, but I subsequently got other errors that said something like "undefined reference to __guard'" and "undefined reference to __stack_smash_handler'". Adding -fno-stack-protector seems to have solved these as well, and I'm now compiling the kernels for the crusoe.

I've checked in a patch to the unstable tree that will allow to build with PIE/SSP-enabled GCC.

Perhaps I spoke too soon. Both Xen and the kernels compiled without error, but rebooting into Xen doesn't seem to work. Grub seems to try to load the Xen kernel, then the machine spontaneously reboots. This seems to be the case even if I try to disable lots of stuff (below, but the same thing happens even without noht.*)

At this point, my grub.conf has this:

title Xen 2.0 / XenLinux 2.6.9-xen0-crusoe
kernel (hd0,4)/boot/xen.gz dom0_mem=131072 console=vga noht noacpi noapic nosmp noreboot ignorebiostables
module (hd0,4)/boot/vmlinuz-2.6.9-xen0-crusoe root=/dev/hda8

Is there any way to see more info on what's happening after grub tries to load xen.gz? Perhaps I should try to recompile xen with -nopie and -fno-stack-protector-all?

... Okay, this is weird. -nopie -fno-stack-protector-all seems to fail as if stack protection was not turned off at all. So i recompiled Xen with -nopie -fno-stack-protector -fno-stack-protector-all (which produced a different binary from just the previous one without -fno-stack-protector-all), but the same problem persists with the machine rebooting spontaneously.

Any ideas?

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#7 lore raw
Quoted 8 lines

Perhaps I spoke too soon. Both Xen and the kernels compiled without error, but rebooting into Xen doesn't seem to work. Grub seems to try to load the Xen kernel, then the machine spontaneously reboots. This seems to be the case even if I try to disable lots of stuff (below, but the same thing happens even without noht.*)

At this point, my grub.conf has this:

Quoted 8 lines

title Xen 2.0 / XenLinux 2.6.9-xen0-crusoe
kernel (hd0,4)/boot/xen.gz dom0_mem=131072 console=vga noht noacpi noapic nosmp noreboot ignorebiostables
module (hd0,4)/boot/vmlinuz-2.6.9-xen0-crusoe root=/dev/hda8

Is there any way to see more info on what's happening after grub tries to load xen.gz? Perhaps I should try to recompile xen with -nopie and -fno-stack-protector-all?

Well, can you make your Xen image (xen-syms) available for me to download? I'll take a look at it, since it must be crashing out very early indeed.

If you want to find the point at which the image is crashing, you can try the following:

Try adding 'for(;;);' as the first piece of code in cmain() in xen/common/kernel.c. The idea is to move an infinite loop around until the kernel hangs rather then rebooting -- you can use this to determine which line of code is causing you to crash.

If you still crash with the infinite for-loop in place, you'll need to add:
1: jmp 1b

...to various places in xen/arch/boot/x86_32.S (various places after the label '__start'). I'd start by placing it immediately before 'call cmain' as one distinct possibility is that the calling convention for asm -> C is different for your compiler. If that still crashes then you can start moving the loop higher up in the assembly code.

-- Keir

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8