Xen 3.0.0 fails to compile on one of my boxes. It works on another one (at least, without USE=debug, see bug #117751) so it must be something in my configuration. I executed: # USE=-debug -pvu emerge xen Tail of the output: gcc -DDEBUG -D_ACPI_ -DTEXTADDR=0x000D0000 -I. -I../../../tools/libxc -Wall -fno-builtin -O2 -msoft-float -m32 -march=i686 -c util.c cpp -P -DDEBUG -D_ACPI_ -DTEXTADDR=0x000D0000 vmxassist.ld > vmxassist.tmp ld -o vmxassist -m elf_i386 -nostdlib --fatal-warnings -N -T vmxassist.tmp head.o trap.o vm86.o setup.o util.o vm86.o: In function `address': vm86.c:(.text+0x1c): undefined reference to `__guard' vm86.c:(.text+0x56): undefined reference to `__stack_smash_handler' vm86.o: In function `trace': vm86.c:(.text+0xe9): undefined reference to `__guard' vm86.c:(.text+0x13b): undefined reference to `__guard' vm86.c:(.text+0x157): undefined reference to `__stack_smash_handler' vm86.o: In function `getreg': vm86.c:(.text+0x26f): undefined reference to `__guard' vm86.o: In function `.L14': vm86.c:(.text+0x2b8): undefined reference to `__stack_smash_handler' vm86.o: In function `setreg': vm86.c:(.text+0x32f): undefined reference to `__guard' vm86.o: In function `.L27': vm86.c:(.text+0x378): undefined reference to `__stack_smash_handler' vm86.o: In function `operand': vm86.c:(.text+0x3c9): undefined reference to `__guard' vm86.o: In function `.L71': vm86.c:(.text+0x49e): undefined reference to `__guard' vm86.c:(.text+0x4cb): undefined reference to `__stack_smash_handler' vm86.o: In function `.L78': vm86.c:(.text+0x505): undefined reference to `__guard' vm86.o: In function `.L50': vm86.c:(.text+0x56f): undefined reference to `__guard' vm86.o: In function `.L117': vm86.c:(.text+0x687): undefined reference to `__guard' vm86.o: In function `lidt': vm86.c:(.text+0x789): undefined reference to `__guard' vm86.c:(.text+0x801): undefined reference to `__guard' vm86.c:(.text+0x822): undefined reference to `__stack_smash_handler' vm86.o: In function `lgdt': vm86.c:(.text+0x859): undefined reference to `__guard' vm86.c:(.text+0x8d1): undefined reference to `__guard' vm86.c:(.text+0x8f2): undefined reference to `__stack_smash_handler' vm86.o: In function `lmsw': vm86.c:(.text+0x929): undefined reference to `__guard' vm86.c:(.text+0x9ba): undefined reference to `__stack_smash_handler' vm86.o: In function `movcr': vm86.c:(.text+0x9f9): undefined reference to `__guard' vm86.c:(.text+0xa48): undefined reference to `__guard' vm86.c:(.text+0xa66): undefined reference to `__stack_smash_handler' vm86.o: In function `load_seg': vm86.c:(.text+0xbe9): undefined reference to `__guard' vm86.c:(.text+0xc31): undefined reference to `__stack_smash_handler' vm86.o: In function `protected_mode': vm86.c:(.text+0xda9): undefined reference to `__guard' vm86.c:(.text+0xf48): undefined reference to `__guard' vm86.c:(.text+0xf72): undefined reference to `__stack_smash_handler' vm86.o: In function `real_mode': vm86.c:(.text+0x10a8): undefined reference to `__guard' vm86.c:(.text+0x1150): undefined reference to `__guard' vm86.c:(.text+0x116c): undefined reference to `__stack_smash_handler' vm86.o: In function `set_mode': vm86.c:(.text+0x11e9): undefined reference to `__guard' vm86.c:(.text+0x1240): undefined reference to `__guard' vm86.c:(.text+0x125c): undefined reference to `__stack_smash_handler' vm86.o: In function `jmpl': vm86.c:(.text+0x1349): undefined reference to `__guard' vm86.c:(.text+0x1381): undefined reference to `__guard' vm86.c:(.text+0x139d): undefined reference to `__stack_smash_handler' vm86.o: In function `retl': vm86.c:(.text+0x153d): undefined reference to `__guard' vm86.c:(.text+0x15da): undefined reference to `__guard' vm86.c:(.text+0x15f6): undefined reference to `__stack_smash_handler' vm86.o: In function `interrupt': vm86.c:(.text+0x169b): undefined reference to `__guard' vm86.c:(.text+0x17a6): undefined reference to `__stack_smash_handler' vm86.o: In function `opcode': vm86.c:(.text+0x17d9): undefined reference to `__guard' vm86.o: In function `.L309': vm86.c:(.text+0x1857): undefined reference to `__guard' vm86.c:(.text+0x1875): undefined reference to `__stack_smash_handler' vm86.o: In function `emulate': vm86.c:(.text+0x1eeb): undefined reference to `__guard' vm86.c:(.text+0x1f26): undefined reference to `__guard' vm86.c:(.text+0x1f42): undefined reference to `__stack_smash_handler' vm86.o: In function `trap': vm86.c:(.text+0x1fa9): undefined reference to `__guard' vm86.c:(.text+0x1fd9): undefined reference to `__guard' vm86.c:(.text+0x1ff5): undefined reference to `__stack_smash_handler' setup.o: In function `banner': setup.c:(.text+0x16): undefined reference to `__guard' setup.c:(.text+0x11d): undefined reference to `__stack_smash_handler' setup.o: In function `setup_gdt': setup.c:(.text+0x14b): undefined reference to `__guard' setup.c:(.text+0x226): undefined reference to `__stack_smash_handler' setup.o: In function `set_intr_gate': setup.c:(.text+0x259): undefined reference to `__guard' setup.c:(.text+0x2b8): undefined reference to `__stack_smash_handler' setup.o: In function `setup_idt': setup.c:(.text+0x2e8): undefined reference to `__guard' setup.c:(.text+0x31e): undefined reference to `__guard' setup.c:(.text+0x33a): undefined reference to `__stack_smash_handler' setup.o: In function `setup_pic': setup.c:(.text+0x36d): undefined reference to `__guard' setup.c:(.text+0x3cd): undefined reference to `__stack_smash_handler' setup.o: In function `enter_real_mode': setup.c:(.text+0x3f8): undefined reference to `__guard' setup.c:(.text+0x4bc): undefined reference to `__guard' setup.c:(.text+0x4d8): undefined reference to `__stack_smash_handler' setup.o: In function `setup_ctx': setup.c:(.text+0x54b): undefined reference to `__guard' setup.c:(.text+0x6e5): undefined reference to `__stack_smash_handler' setup.o: In function `start_bios': setup.c:(.text+0x714): undefined reference to `__guard' setup.c:(.text+0x76a): undefined reference to `__guard' setup.c:(.text+0x786): undefined reference to `__stack_smash_handler' setup.o: In function `main': setup.c:(.text+0x7dc): undefined reference to `__guard' setup.c:(.text+0x831): undefined reference to `__stack_smash_handler' util.o: In function `dump_regs': util.c:(.text+0x18): undefined reference to `__guard' util.c:(.text+0x145): undefined reference to `__guard' util.c:(.text+0x161): undefined reference to `__stack_smash_handler' util.o: In function `hexdump': util.c:(.text+0x199): undefined reference to `__guard' util.c:(.text+0x2cb): undefined reference to `__guard' util.c:(.text+0x2e7): undefined reference to `__stack_smash_handler' util.o: In function `print_e820_map': util.c:(.text+0x319): undefined reference to `__guard' util.c:(.text+0x3c5): undefined reference to `__guard' util.c:(.text+0x3e1): undefined reference to `__stack_smash_handler' util.o: In function `dump_dtr': util.c:(.text+0x45b): undefined reference to `__guard' util.c:(.text+0x49d): undefined reference to `__guard' util.c:(.text+0x4b9): undefined reference to `__stack_smash_handler' util.o: In function `dump_vmx_context': util.c:(.text+0x4e9): undefined reference to `__guard' util.c:(.text+0xa69): undefined reference to `__stack_smash_handler' util.o: In function `printf': util.c:(.text+0xa99): undefined reference to `__guard' util.c:(.text+0xad8): undefined reference to `__stack_smash_handler' util.o: In function `vprintf': util.c:(.text+0xb09): undefined reference to `__guard' util.c:(.text+0xb48): undefined reference to `__stack_smash_handler' util.o: In function `panic': util.c:(.text+0xb79): undefined reference to `__guard' util.c:(.text+0xbc7): undefined reference to `__stack_smash_handler' util.o: In function `strlen': util.c:(.text+0xbf8): undefined reference to `__guard' util.c:(.text+0xc35): undefined reference to `__stack_smash_handler' util.o: In function `putchar': util.c:(.text+0xc5b): undefined reference to `__guard' util.c:(.text+0xc81): undefined reference to `__stack_smash_handler' util.o: In function `_doprint': util.c:(.text+0xca9): undefined reference to `__guard' util.c:(.text+0xcfe): undefined reference to `__guard' util.c:(.text+0xd1a): undefined reference to `__stack_smash_handler' util.o: In function `printnum': util.c:(.text+0xf6e): undefined reference to `__guard' util.c:(.text+0xfb6): undefined reference to `__stack_smash_handler' util.o: In function `memset': util.c:(.text+0x100c): undefined reference to `__guard' util.c:(.text+0x103f): undefined reference to `__stack_smash_handler' util.o: In function `memcpy': util.c:(.text+0x106c): undefined reference to `__guard' util.c:(.text+0x10b3): undefined reference to `__stack_smash_handler' make[2]: *** [vmxassist.bin] Error 1 make[2]: Leaving directory `/bigdisk/vartmp/portage/xen-3.0.0-r2/work/xen-3.0-testing-20051206/tools/firmware/vmxassist' make[1]: *** [all] Error 2 make[1]: Leaving directory `/bigdisk/vartmp/portage/xen-3.0.0-r2/work/xen-3.0-testing-20051206/tools/firmware' make: *** [all] Error 2 make: Leaving directory `/bigdisk/vartmp/portage/xen-3.0.0-r2/work/xen-3.0-testing-20051206/tools' !!! ERROR: app-emulation/xen-3.0.0-r2 failed. !!! Function src_compile, Line 68, Exitcode 2 !!! compiling tools failed !!! If you need support, post the topmost build error, NOT this status message.
# emerge info Portage 2.0.53 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r2, 2.6.14-gentoo-r2 i686) ================================================================= System uname: 2.6.14-gentoo-r2 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz Gentoo Base System version 1.12.0_pre13 dev-lang/python: 2.3.5-r2, 2.4.2 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.20 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i386-pc-linux-gnu" CFLAGS="-march=pentium4 -O2 -pipe" CHOST="i386-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/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=pentium4 -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://gentoo.intergenia.de http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://gentoo.mirror.intouch.nl/gentoo/" LINGUAS="en nl es" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 X acpi alsa apache2 apm arts audiofile avi bash-completion berkdb bitmap-fonts bzip2 canvas cdparanoia cdr cpudetection crypt cups curl debug directfb divx4linux dri dv dvd dvdr dvdread eds emboss encode exif expat fam ffmpeg flac foomaticdb fortran gdbm gif gmp gphoto2 gpm gstreamer gtk gtk2 hal hardened idn ieee1394 imagemagick imlib ipv6 java jpeg junit kde kdeenablefinal lcms libg++ libwww mad mikmod mmx mmxext mng motif mozdevelop mozilla mozsvg mp3 mpeg mplayer ncurses nls nvidia ogg oggvorbis openal opengl oss pam pcre pdflib perl png python qt quicktime readline real sdl spell sse sse2 ssl tcpd test tiff truetype truetype-fonts type1-fonts udev usb v4l vcd vorbis win32codecs wmf xine xinerama xml2 xmms xprint xv xvid xvmc zlib linguas_en linguas_nl linguas_es userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, PORTDIR_OVERLAY
(In reply to comment #0) > I executed: > > # USE=-debug -pvu emerge xen Ofcourse after that I did: USE=-debug -u emerge xen So I was not just pretending :)
stack_smash_handler? Are you using a hardened profile or gcc? What are your /etc/profile and gcc-config settings?
(In reply to comment #3) > stack_smash_handler? Are you using a hardened profile or gcc? What are your > /etc/profile and gcc-config settings? My /etc/profile is a standard one: # /etc/profile: login shell setup # # That this file is used by any Bourne-shell derivative to setup the # environment for login shells. # # Load environment settings from profile.env, which is created by # env-update from the files in /etc/env.d if [ -e /etc/profile.env ] ; then . /etc/profile.env fi # 077 would be more secure, but 022 is generally quite realistic umask 022 # Set up PATH depending on whether we're root or a normal user. # There's no real reason to exclude sbin paths from the normal user, # but it can make tab-completion easier when they aren't in the # user's PATH to pollute the executable namespace. # # It is intentional in the following line to use || instead of -o. # This way the evaluation can be short-circuited and calling whoami is # avoided. if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}" else PATH="/usr/local/bin:/usr/bin:/bin:${PATH}" fi export PATH unset ROOTPATH # Extract the value of EDITOR [ -z "$EDITOR" ] && EDITOR="`. /etc/rc.conf 2>/dev/null; echo $EDITOR`" [ -z "$EDITOR" ] && EDITOR="/bin/nano" export EDITOR if [ -n "${BASH_VERSION}" ] ; then # Newer bash ebuilds include /etc/bash/bashrc which will setup PS1 # including color. We leave out color here because not all # terminals support it. if [ -f /etc/bash/bashrc ] ; then # Bash login shells run only /etc/profile # Bash non-login shells run only /etc/bash/bashrc # Since we want to run /etc/bash/bashrc regardless, we source it # from here. It is unfortunate that there is no way to do # this *after* the user's .bash_profile runs (without putting # it in the user's dot-files), but it shouldn't make any # difference. . /etc/bash/bashrc else PS1='\u@\h \w \$ ' fi else # Setup a bland default prompt. Since this prompt should be useable # on color and non-color terminals, as well as shells that don't # understand sequences such as \h, don't put anything special in it. PS1="`whoami`@`uname -n | cut -f1 -d.` \$ " fi for sh in /etc/profile.d/*.sh ; do if [ -r "$sh" ] ; then . "$sh" fi done unset sh My /etc/make.conf is as follows: # /etc/make.conf # Flags for C and C++ compilation CHOST="i386-pc-linux-gnu" CFLAGS="-march=pentium4 -O2 -pipe" CXXFLAGS="${CFLAGS}" MAKEOPTS="-j2" # Emerge USE options USE="X acpi alsa audiofile avi bash-completion bzip2 canvas cdparanoia cdr cpudetection crypt cups debug directfb divx4linux dri dv dvd dvdr dvdread encode ffmpeg flac foomaticdb -gnome gstreamer gtk gtk2 hal hardened ieee1394 java jpeg kde kdeenablefinal mmx mmxext mozdevelop mozilla mozsvg mplayer nls nvidia ogg openal opengl qt quicktime real sse sse2 ssl test truetype usb v4l vcd vorbis win32codecs wmf xine xinerama xprint xv xvid xvmc" # Languages/locales LINGUAS="en nl es" # Gentoo download mirrors GENTOO_MIRRORS="http://gentoo.intergenia.de http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://gentoo.mirror.intouch.nl/gentoo/" # Execute unit tests, if available #FEATURES="maketest" Would that be enough?
Sorry I meant /etc/make.profile - where does it point? And what does `gcc-config -l` say your default gcc is?
(In reply to comment #5) > Sorry I meant /etc/make.profile - where does it point? And what does > `gcc-config -l` say your default gcc is? # ls -l /etc/make.profile lrwxrwxrwx 1 root root 48 Dec 5 15:57 /etc/make.profile -> ../usr/portage/profiles/default-linux/x86/2005.1 # gcc-config -l [1] i386-pc-linux-gnu-3.3.6 * [2] i386-pc-linux-gnu-3.3.6-hardenednopie [3] i386-pc-linux-gnu-3.3.6-hardenednopiessp [4] i386-pc-linux-gnu-3.3.6-hardenednossp [5] i386-pc-linux-gnu-3.3.6-vanilla [6] i386-pc-linux-gnu-3.4.4 [7] i386-pc-linux-gnu-3.4.4-hardenednopie [8] i386-pc-linux-gnu-3.4.4-hardenednopiessp [9] i386-pc-linux-gnu-3.4.4-hardenednossp [10] i386-pc-linux-gnu-3.4.4-vanilla
This goes away if you compile using a non-hardened compiler. However, beware that ccache doesn't spot this, so disable or flush the cache after changing compiler
No need to do an entirely non-hardened compiler, just need to chose the -hardenednossp version of the current one while compiling xen.
Does xen currently compile for hardened systems? If not, what needs to be done to the ebuild to make it work (automatically select the correct gcc profile or whatever)? If this is just a gcc-config configuration issue and not something that can be fixed in the xen ebuild, could someone please confirm that and close the bug? Thanks.
xen-3.0.2 contains: ./xen/arch/x86/Rules.mk:CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector) ./xen/arch/x86/Rules.mk:CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector-all) ./tools/firmware/hvmloader/Makefile:CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector) ./tools/firmware/hvmloader/Makefile:CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector-all) ./tools/firmware/vmxassist/Makefile:CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector) ./tools/firmware/vmxassist/Makefile:CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector-all) This removes the -fstack-protector{-all} flag from CFLAGS. I've compiled both xen and xen-tools with -fstack-protector in CFLAGS and got no errors.