Kevin
2006-May-06 05:13 UTC
[Xen-users] can''t find a register in class `BREG'' while reloading `asm''
Hi List- I''m brand new to xen but an old hand with Linux. With a fresh, clean, Gentoo installation on this box, I''m attempting to install xen using the gentoo-standard: emerge xen but the process is failing with an error that''s very similar to one reported by another user (A Streetcar Named: see http://lists.xensource.com/archives/html/xen-devel/2004-11/msg00593.html) in the xen-devel list back in 2004 which is why I''m posting here and not to the gentoo lists. I think they would answer by saying, "...upstream...," so I''m starting upstream. The error is: <snip> gcc -O2 -fomit-frame-pointer -DNDEBUG -m32 -march=i686 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -nostdinc -fno-builtin -fno-common -fno-strict-aliasing -iwithprefix include -Werror -Wno-pointer-arith -pipe -I/var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/include -I/var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/include/asm-x86/mach-generic -I/var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/include/asm-x86/mach-default -msoft-float -g -D__XEN__ -c multicall.c -o multicall.o memory.c: In function `guest_remove_page'': /var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/include/asm/mm.h:206: error: can''t find a register in class `BREG'' while reloading `asm'' make[2]: *** [memory.o] Error 1 make[2]: *** Waiting for unfinished jobs.... multicall.c: In function `do_multicall'': multicall.c:43: error: can''t find a register in class `BREG'' while reloading `asm'' make[2]: *** [multicall.o] Error 1 grant_table.c: In function `do_grant_table_op'': /var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/include/asm/mm.h:206: error: can''t find a register in class `BREG'' while reloading `asm'' /var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/include/asm/mm.h:206: error: can''t find a register in class `BREG'' while reloading `asm'' /var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/include/asm/mm.h:206: error: can''t find a register in class `BREG'' while reloading `asm'' make[2]: *** [grant_table.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/common'' make[1]: *** [/var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/common/built_in.o] Error 2 make[1]: Leaving directory `/var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/arch/x86'' make: *** [/var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/xen] Error 2 make: Leaving directory `/var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen'' The gentoo USE flags I''ve chosen are as follows: [ebuild N ] app-emulation/xen-3.0.2 -custom-cflags -debug -pae 0 kB I am using a somewhat non-standard gentoo profile: lrwxrwxrwx 1 root root 51 May 4 15:24 /etc/make.profile -> ../usr/portage/profiles/selinux/2005.1/x86/hardened And I do have SELinux successfully installed although I''m running in permissive mode so I don''t think SELinux has anything to do with this. It may be the case, though, that the hardened part of the profile I''ve chosen is a part of the problem. The other thread that cropped up with similar error messages was also a Gentoo hardened box and there was no resolution posted although the fellow''s initial problem (failure to compile) was apparently resolved by the elimination of some (all?) of the hardened flags during compilation: "-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." My gcc version is: gcc (GCC) 3.4.6 (Gentoo Hardened 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9) I started off with 3.4.5 and similar or identical parameters for ssp and pie. The results in that case were the same so I''ve tried two different gcc versions (though both are hardened with pie/ssp) to no avail. I''m not using Pax or Grsecurity or RSBAC and like I said, SELinux is running in permissive mode right now. In the old thread, Keir Fraser wrote: "I''ve checked in a patch to the unstable tree that will allow to build with PIE/SSP-enabled GCC." So my hope is to be able to get xen running with these hardened flags, but I''m wondering if something else needs to change with xen first. I haven''t yet tried compiling under the guidance that Keir gave back in 2004 (and that worked for Streetcar), but I can if it would help. I suspect that like the other guy, this would get xen to compile successfully, but I''d really like to keep the hardened nature intact so I''m asking about that first. Thanks in advance for any ideas. -Kevin PS. If I should post to xen-devel, someone please tell me and I''ll do so. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tuan Van
2006-May-06 18:28 UTC
Re: [Xen-users] can''t find a register in class `BREG'' while reloading `asm''
Kevin wrote:> gcc -O2 -fomit-frame-pointer -DNDEBUG -m32 -march=i686 -Wall > -Wstrict-prototypes -Wdeclaration-after-statement -nostdinc -fno-builtin > -fno-common -fno-strict-aliasing -iwithprefix include -Werror > -Wno-pointer-arith -pipe > -I/var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/include > -I/var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/include/asm-x86/mach-generic > -I/var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/include/asm-x86/mach-default > -msoft-float -g -D__XEN__ -c multicall.c -o multicall.o > memory.c: In function `guest_remove_page'': > /var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/include/asm/mm.h:206: > error: can''t find a register in class `BREG'' while reloading `asm''see http://bugs.gentoo.org/show_bug.cgi?id=130167 HTH _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Kevin
2006-May-06 20:43 UTC
Re: [Xen-users] can''t find a register in class `BREG'' while reloading `asm''
Tuan Van wrote:> Kevin wrote: >> gcc -O2 -fomit-frame-pointer -DNDEBUG -m32 -march=i686 -Wall >> -Wstrict-prototypes -Wdeclaration-after-statement -nostdinc -fno-builtin >> -fno-common -fno-strict-aliasing -iwithprefix include -Werror >> -Wno-pointer-arith -pipe >> -I/var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/include >> -I/var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/include/asm-x86/mach-generic >> >> -I/var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/include/asm-x86/mach-default >> >> -msoft-float -g -D__XEN__ -c multicall.c -o multicall.o >> memory.c: In function `guest_remove_page'': >> /var/tmp/portage/xen-3.0.2/work/xen-3.0.2/xen/include/asm/mm.h:206: >> error: can''t find a register in class `BREG'' while reloading `asm'' > > > see http://bugs.gentoo.org/show_bug.cgi?id=130167 >Thanks for the pointer, Tuan. I wasn''t aware of it and I should have checked the gentoo & xen bugzillas before posting here. My apologies for not doing so. I have now checked both gentoo and xen bugzillas and I don''t see anything on BREG or register or pie or ssp or hardened in the xen bugzilla. The patch mentioned in the gentoo bug report is, however, merely an implementation of the advice that Keir Fraser gave to A Streetcar back in 11/2004, and it does indeed allow me to compile xen-3.0.2 (which I suspected would be true, but it doesn''t get me what I''d really like which is xen code compiled with PIE/SSP for enhanced security). Keir Fraser wrote in 11/2004: "I''ve checked in a patch to the unstable tree that will allow to build with PIE/SSP-enabled GCC." May I ask: what''s happened with this? Was a patch applied? If so, does something else need to be patched? Or was the patch subsequently removed? Or do the xen-devs prefer against patching xen this way? Are there negative implications to building xen with PIE/SSP-enabled GCC? (or for that matter, not doing so?). Although I''m no guru on hardened gentoo or PIE/SSP, I had the overall impression that they were considered by many (all?) to be a good thing for enhancing security. Is that not the case with xen? TIA for any replies. -Kevin _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users