Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 347664 - app-emulation/xen-tools-4.0.0 fails to compile: "../lib/blktaplib.h:199:0: error: "WRITE" redefined"
Summary: app-emulation/xen-tools-4.0.0 fails to compile: "../lib/blktaplib.h:199:0: er...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: Gentoo Xen Devs
URL:
Whiteboard:
Keywords:
: 347843 349455 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-12-03 16:36 UTC by Charlie Gehlin
Modified: 2011-06-14 12:48 UTC (History)
13 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info.lego,13.72 KB, text/plain)
2010-12-03 16:37 UTC, Charlie Gehlin
Details
Redefines READ and WRITE in tools/blktap/lib/blktaplib.h and all consumers to BLKTAP_READ and BLKTAP_WRITE (xen-tools-4.0.1-read-write-redefine.patch,7.30 KB, patch)
2011-06-14 12:45 UTC, Max Hacking
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Charlie Gehlin 2010-12-03 16:36:45 UTC
Maybe I'm missing out on something, but here goes:

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


Reproducible: Always

Steps to Reproduce:
1. ~ # MAKEOPTS="-j1" emerge -1v xen-tools
2.
3.

Actual Results:  
gcc   -fno-strict-overflow -O2 -fomit-frame-pointer -m64 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement  -D__XEN_TOOLS__ -MMD -MF .subdirs-all.d  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  -O2 -fomit-frame-pointer -m64 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement  -D__XEN_TOOLS__ -MMD -MF .subdir-all-blktap.d  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  -O2 -fomit-frame-pointer -m64 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement  -D__XEN_TOOLS__ -MMD -MF .subdirs-all.d  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  -O2 -fomit-frame-pointer -m64 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement  -D__XEN_TOOLS__ -MMD -MF .subdir-all-drivers.d  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  -O2 -fomit-frame-pointer -m64 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement  -D__XEN_TOOLS__ -MMD -MF .blk_linux.o.d  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  -Werror -Wno-unused -I../lib -I../../../tools/libxc -I../../../tools/include -I../../../tools/xenstore -I../../../tools/include -I ../../libaio/src -I ../../memshr -D_GNU_SOURCE -DUSE_GCRYPT -DMEMSHR -c -o blk_linux.o blk_linux.c
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]: Leaving directory `/var/tmp/portage/app-emulation/xen-tools-4.0.0/work/xen-4.0.0/tools/blktap/drivers'
make[3]: *** [subdir-all-drivers] Error 2
make[3]: Leaving directory `/var/tmp/portage/app-emulation/xen-tools-4.0.0/work/xen-4.0.0/tools/blktap'
make[2]: *** [subdirs-all] Error 2
make[2]: Leaving directory `/var/tmp/portage/app-emulation/xen-tools-4.0.0/work/xen-4.0.0/tools/blktap'
make[1]: *** [subdir-all-blktap] Error 2
make[1]: Leaving directory `/var/tmp/portage/app-emulation/xen-tools-4.0.0/work/xen-4.0.0/tools'
make: *** [subdirs-all] Error 2
make: Leaving directory `/var/tmp/portage/app-emulation/xen-tools-4.0.0/work/xen-4.0.0/tools'
emake failed
 * ERROR: app-emulation/xen-tools-4.0.0 failed:
 *   compile failed
 * 
 * Call stack:
 *     ebuild.sh, line  56:  Called src_compile
 *   environment, line 4857:  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.0',
 * the complete build log and the output of 'emerge -pqv =app-emulation/xen-tools-4.0.0'.
 * The complete build log is located at '/var/tmp/portage/app-emulation/xen-tools-4.0.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-emulation/xen-tools-4.0.0/temp/environment'.
 * S: '/var/tmp/portage/app-emulation/xen-tools-4.0.0/work/xen-4.0.0'


Expected Results:  
xen-tools to compile.

'emerge --info' to be attached
Comment 1 Charlie Gehlin 2010-12-03 16:37:28 UTC
Created attachment 256253 [details]
emerge --info
Comment 2 Patrick Lauer gentoo-dev 2010-12-03 18:54:29 UTC
I can reproduce that. Seems to be newer kernel-headers causing this.

Stupid idiotic stupid xen build system with -Wall ...
Comment 3 Patrick Lauer gentoo-dev 2010-12-03 19:03:29 UTC
(In reply to comment #2)
> I can reproduce that. Seems to be newer kernel-headers causing this.
> 
Downgrading to linux-headers 2.6.33 allows it to build. This will need some investigation :(
Comment 4 Leeman Strout 2010-12-04 03:13:14 UTC
This is also the case with app-emulation/xen-tools-4.0.1  And linux-headers-2.6.35 was the newest version that worked.
Comment 5 Attila Jecs 2011-02-05 03:21:28 UTC
i'm having the exact same problem in a fresh ~amd64 setup
Comment 6 Joerg Neikes 2011-02-10 15:28:09 UTC
same here with x86 and amd64.

I temp fixed it with:

vim /usr/include/linux/fs.h
:150
and change
#define WRITE                        RW_MASK
to
/* #define WRITE                        RW_MASK  */


Comment 7 virginian 2011-02-14 22:18:58 UTC
(In reply to comment #6)
> same here with x86 and amd64.
> 
> I temp fixed it with:
> 
> vim /usr/include/linux/fs.h
> :150
> and change
> #define WRITE                        RW_MASK
> to
> /* #define WRITE                        RW_MASK  */
> 

I have the same problem:

Info as follows:

xen1 ~ # emerge --info app-emulation/xen-tools
Portage 2.1.9.39 (default/linux/amd64/10.0/server, gcc-4.4.4, glibc-2.13-r0, 2.6.36-gentoo-r5 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.36-gentoo-r5-x86_64-Intel-R-_Atom-TM-_CPU_D525_@_1.80GHz-with-gentoo-2.0.1
Timestamp of tree: Mon, 14 Feb 2011 16:45:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.6.6-r1, 2.7.1, 3.1.3
dev-util/cmake:      2.8.3-r1
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.7.0
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.68
sys-devel/automake:  1.11.1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.4.4-r2, 4.5.2
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="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.virginmedia.com/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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"
SYNC="rsync://rsync.uk.gentoo.org/gentoo-portage"
USE="X acl amd64 berkdb bzip2 cli cracklib crypt cups cxx dri fortran gdbm gpm iconv ipv6 mmx modules mudflap multilib ncurses nls nptl nptlonly openmp pam pcre pppd python readline session snmp sse sse2 ssl sysfs tcpd truetype unicode xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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" 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="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" 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, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

=================================================================
                        Package Settings
=================================================================

app-emulation/xen-tools-4.0.1 was built with the following:
USE="(multilib) -acm -api -custom-cflags -debug -doc -flask -hvm -ioemu -pygrub -screen"
CFLAGS="-fno-strict-overflow"
CXXFLAGS="-O2 -pipe -fno-strict-overflow"
LDFLAGS=""


I made the change as suggested by Joerg and the compilation worked. What I don't know is what impact 9if any) this will now have on my system. Could anybody explain that to me?
Comment 8 Aelia 2011-02-25 08:34:58 UTC
hopefully there isn't any but as I searched the fs.h file and found out that WRITE is defined as (1 << __REQ_WRITE) it could pose a problem if the Xen code thinks WRITE is really equal to 1 and not something else (and at the same time __REQ_WRITE is different than 0 -- as I couldn't find where this is defined I don't know its value).

Sadly if the source code thinks WRITE == 1 there could be really unpredictable problems, and as it seems to be used in the virtual disk part of the code it could break completely the images.

So it all depends on the code quality, and I don't want to review it completely to see if it is safe ^^

Downgrading the linux-headers should be safe though because the linux policy is to keep the binary interface between kernel and userspace.

BTW bug #354043 is the same as this one for another version of xen-tools.
Comment 9 Joost Ruis 2011-03-16 18:24:42 UTC
*** Bug 347843 has been marked as a duplicate of this bug. ***
Comment 10 Joost Ruis 2011-03-16 18:26:49 UTC
*** Bug 349455 has been marked as a duplicate of this bug. ***
Comment 11 Alexey Shvetsov archtester gentoo-dev 2011-03-26 11:40:55 UTC
Xen 4.1 in tree. Please test with it and reopen if it doesnt work
Comment 12 Jason Ayres 2011-05-15 03:20:15 UTC
Confirmed on new x86 install that this does happen with 3.4.2 and 4.0.1  
Does not happen on 4.1 series, but 4.1 has issues that are stopping production.  Why should we be forced to upgrade due to a bug?
Comment 13 Max Hacking 2011-06-14 12:45:57 UTC
Created attachment 277033 [details, diff]
Redefines READ and WRITE in tools/blktap/lib/blktaplib.h and all consumers to BLKTAP_READ and BLKTAP_WRITE
Comment 14 Max Hacking 2011-06-14 12:48:44 UTC
For those users subscribed to this bug who require a working ebuild for xen-tools-4.0.1 one is now available in my [hacking-gentoo] overlay via layman.

Please be aware that this build has only received VERY light testing however no problems have been reported thus far.