When a user running gentoo-hardened tries to compile xen, it fails, complaining about running out of registers. Either it should be fixed, or it should detect hardened toolchains and die with a "you bonehead" error message (depending on whether hardened xen is a good idea anyway). My first try was with USE=pae; turning this USE flag off had no effect. 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 -DCONFIG_X86_PAE=1 -g -D__XEN__ -c lib.c -o lib.o 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 tweet ~ # emerge --info Portage 2.1_pre7-r5 (hardened/x86/2.6, gcc-3.4.6, glibc-2.3.6-r3, 2.6.16-ck1 i686) ================================================================= System uname: 2.6.16-ck1 i686 AMD Athlon(tm) MP 1700+ Gentoo Base System version 1.12.0_pre17 ccache version 2.4 [enabled] dev-lang/python: 2.3.5-r2, 2.4.2-r1 sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.16.1-r2 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r3 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=athlon-xp -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=athlon-xp -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks fixpackages metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://gentoo.osuosl.org/" MAKEOPTS="-j4" PKGDIR="/usr/portage//packages/x86/" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage/" PORTDIR_OVERLAY="/usr/local/portage /usr/local/portage-overlay/perl-catalyst /usr/local/portage-overlay/ocfs2 /usr/local/portage-overlay/tipc" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="3dnow 3dnowext 7zip X a52 aac acpi adns aio alsa amarok amr ao apache2 arts async atlas bash-completion berkdb blender-game bzip2 caps cdda cddb cdio cdparanoia cdr cdrom ck-server clamav clamd corba cpudetection cracklib crypt css dga divx4linux dlloader doc dri dv dvb dvd dvdread effects esd ethereal exscalibar fbcon fbdev ffmpeg fftw flac flash gd gdbm gif glut gnome gtk hardened ifp ipod ipv6 ithreads jack java jpeg kerberos libgda live lzo mad matroska mikmod mmx mmxext mng modperl mozdevelop mozilla moznoirc mozsvg mp3 mp4 mplayer mpm-worker musicbrainz ncurses netjack network nfsv4 nptl nsplugin nvidia opengl pae pam perl pic plugin png pnp postgres ppds readline real sdl slang smp sndfile speex spell sqlite sse ssl subtitles svg tcltk tcpd test theora threads tiff truetype unicode usb userlocales uuid vorbis win32codecs x264 x86 xine xinerama xml xml2 xmms xvid zlib elibc_glibc input_devices_keyboard input_devices_mouse kernel_linux userland_GNU video_cards_nv" Unset: ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS
See also http://bugs.gentoo.org/show_bug.cgi?id=129491 xen* is low priority right now.
xen seems to use __XEN__ in place of __KERNEL__ Try this. http://tinderbox.x86.dev.gentoo.org/portage/local/patches/app-emulation/xen/xen-3.0.2-nopiessp.patch
Created attachment 84788 [details, diff] Abort compiliation for hardened toolchains. (In reply to comment #1) > See also http://bugs.gentoo.org/show_bug.cgi?id=129491 > > xen* is low priority right now. In that case, as a temporary bandaid, can we just make the error explicit, and tell the user how to fix it? Here's a patch to do the same check dev-lisp/sbcl does. Maybe something in the CFLAGS would be preferred? I'm happy to test things and submit patches, but I don't have much experience with hardened toolchain issues, so I wouldn't know where to start, sorry.
Mark see comment #2. It allows xen to build. No need to abort..
(In reply to comment #4) > Mark see comment #2. It allows xen to build. No need to abort.. Yeah, that's what I get for taking too long to type up my reply. Sorry. Your patch worked! Mark
chrb, see comment #2 please
Patch added, thanks.