xen-tools fail to build, see error below. - I tried with various versions: 4.0.1, 4.0.0, 3.4.3 - I tried disabling all USE flags - I tried gcc 4.4.5 and 4.5.1 - I tried with MAKEOPTS="-j1" - I did not set the -mno-tls-direct-seg-refs CFLAG, as the docs say it is not necessary on x86_64 ----------------------- cc1: warnings being treated as errors In file included from tapdisk.h:62:0, from blk_linux.c:4: ../lib/blktaplib.h:199:0: error: "WRITE" redefined /usr/include/linux/fs.h:150:0: note: this is the location of the previous definition make[4]: *** [blk_linux.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[4]: Leaving directory `/var/tmp/portage/app-emulation/xen-tools-4.0.1/work/xen-4.0.1/tools/blktap/drivers' make[3]: *** [subdir-all-drivers] Error 2 make[3]: Leaving directory `/var/tmp/portage/app-emulation/xen-tools-4.0.1/work/xen-4.0.1/tools/blktap' make[2]: *** [subdirs-all] Error 2 make[2]: Leaving directory `/var/tmp/portage/app-emulation/xen-tools-4.0.1/work/xen-4.0.1/tools/blktap' make[1]: *** [subdir-all-blktap] Error 2 make[1]: Leaving directory `/var/tmp/portage/app-emulation/xen-tools-4.0.1/work/xen-4.0.1/tools' make: *** [subdirs-all] Error 2 make: Leaving directory `/var/tmp/portage/app-emulation/xen-tools-4.0.1/work/xen-4.0.1/tools' emake failed * ERROR: app-emulation/xen-tools-4.0.1 failed: * compile failed * * Call stack: * ebuild.sh, line 56: Called src_compile * environment, line 4851: Called die * The specific snippet of code: * emake -C tools ${myopt} || die "compile failed"; * * If you need support, post the output of 'emerge --info =app-emulation/xen-tools-4.0.1', * the complete build log and the output of 'emerge -pqv =app-emulation/xen-tools-4.0.1'. * The complete build log is located at '/var/tmp/portage/app-emulation/xen-tools-4.0.1/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/app-emulation/xen-tools-4.0.1/temp/environment'. * S: '/var/tmp/portage/app-emulation/xen-tools-4.0.1/work/xen-4.0.1' ----------------------- Reproducible: Always Steps to Reproduce: emerge --info =app-emulation/xen-tools-4.0.1 Portage 2.1.9.25 (default/linux/amd64/10.0/desktop, gcc-4.5.1, glibc-2.12.1-r3, 2.6.36-gentoo-r3 x86_64) ================================================================= System Settings ================================================================= System uname: Linux-2.6.36-gentoo-r3-x86_64-Intel-R-_Core-TM-_i7_CPU_960_@_3.20GHz-with-gentoo-2.0.1 Timestamp of tree: Sun, 05 Dec 2010 21:15:01 +0000 ccache version 3.1.3 [disabled] app-shells/bash: 4.1_p9 dev-java/java-config: 2.1.11-r2 dev-lang/python: 2.6.6-r1, 2.7.1, 3.1.3 dev-util/ccache: 3.1.3 dev-util/cmake: 2.8.1-r2 sys-apps/baselayout: 2.0.1-r1 sys-apps/openrc: 0.6.7 sys-apps/sandbox: 2.4 sys-devel/autoconf: 2.13, 2.68 sys-devel/automake: 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1 sys-devel/binutils: 2.20.1-r1 sys-devel/gcc: 4.4.5, 4.5.1-r1 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82 virtual/os-headers: 2.6.36.1 (sys-kernel/linux-headers) ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=core2 -msse4 -mcx16 -msahf -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/openvpn/easy-rsa" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.2/ext-active/ /etc/php/cgi-php5.2/ext-active/ /etc/php/cli-php5.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=core2 -msse4 -mcx16 -msahf -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests binpkg-logs buildpkg distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" GENTOO_MIRRORS="ftp://mirror.netcologne.de/gentoo/ http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="de fr en" MAKEOPTS="-j5" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/var/lib/layman/mds /usr/local/portage" SYNC="rsync://rsync.de.gentoo.org/gentoo-portage" USE="X a52 aac acl acpi aiglx alsa amd64 arts avi bash-completion berkdb bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus dri dri2 dts dv dvb dvd dvdr dvdread emboss encode exif fam fame ffmpeg firefox flac foomaticdb fortran gdbm gif gpm gtk gtk2 hal iconv imlib ipv6 jingle jpeg kde lcms libnotify mad matroska mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses networkmanager nls nptl nptlonly ocamlopt ogg opengl openmp pam pango pcre pdf perl png policykit ppds pppd python qt qt3support qt4 readline sdl session spell sse sse2 ssl subversion svg sysfs tcpd telepathy theora tiff truetype unicode usb userlocales v4l2 vlm vorbis vpx win64codecs x264 xcb xinerama xml xorg xulrunner xv xvid zlib" ALSA_CARDS="hda-intel usb-audio" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="fuji ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de fr en" PHP_TARGETS="php5-2" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
The problem seems to be that the current linux headers (2.6.36.1) also set WRITE. Workaround: A downgrade to linux-headers-2.6.34 "fixed" the problem, and xen-tools could be successfully emerged.
A better fix would be a patch which renamed the WRITE definition in the proper header and C files so there was not a conflict (or didn't define it if already defined and "compatible"). One might hope that developers of tools would not select define names which could potentially conflict with system definitions(!). It would appear that predefined CFLAGS are IGNORED by the xen-tools configure (i.e. one gets -march=i686 even if make.conf specified -march=Prescott, one gets -fomit-frame-pointer even though some people may not want it, etc.). The definition for WRITE seems to end up being the same value (1) but because the linux header definition tracks back from fs.h to blk_types.h where the key value of "__REQ_WRITE" is defined an an enum it is impossible for the preprocessor to know the "real" value and know that the "redefinition" may produce the same value. It also appears that "-fdiagnostics-show-option" is ignored by gcc for preprocessor errors making it impossible to add a "-fno-error=redefine" type of flag to ignore the redefinition (even if the emerge/configure honored predefined CFLAGS from the shell or in make.conf). This package (esp. the configure/Makefile [1]) is a mess -- how does one file an upstream bug report and request that it be cleaned up? 1. If you look at the gcc compile lines one can note that most of the flags passed to gcc are included 4+ times on the command line.
> Workaround: A downgrade to linux-headers-2.6.34 "fixed" the problem, and > xen-tools could be successfully emerged. So is this still the best reasonable solution? Are there any real repercussions to downgrading the headers to 2.6.34 from 2.6.36.1 on a hardened-2.6.36-r9 amd64 system?
Created attachment 265303 [details, diff] Patch for xen-tools 3.4.2 Here ist a patch which worked for me.
Created attachment 265305 [details, diff] Patch for xen-tools 4.0.1 Tested, but i am working with 3.4.2
*** Bug 358129 has been marked as a duplicate of this bug. ***
(In reply to comment #6) > *** Bug 358129 has been marked as a duplicate of this bug. *** Well, the two have some elements in common. I got xen-tools to compile by editing the system header file and commented out the conflicting write definition. This bug is xen-tools. The one I made was for xen. xen-tools is confused by a header file. xen pulled up quite differently. It was lost by confusion in the gcc compiler options, supposedly originating from the ebuild. It pulled up unable to reconcile a compiler option it was fed without the option -shared being present. I'd suggest this warrants more raw testing in a controlled environment.
*** Bug 354043 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of bug 347664 ***