Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 257265

Summary: emerging app-emulation/xen-3.3.0 fails with GCC 4.3.3 due to -Werror
Product: Gentoo Linux Reporter: 404 Error <404errorqc>
Component: Current packagesAssignee: Gentoo Xen Devs <xen>
Severity: normal CC: mvolaski, truedfx
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 260867, 259417    
Attachments: build.conf
new ebuild for adding patches to xen
this patch address this bug in particular
this addresses another related error that will surface after the first error is fixed

Description 404 Error 2009-02-01 18:39:28 UTC
When emerging xen 3.3.0, the build process fails and ends with :

make[3]: Entering directory `/var/tmp/portage/app-emulation/xen-3.3.0/work/xen-3.3.0/xen/tools'
gcc -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -Wdeclaration-after-statement -o symbols symbols.c
cc1: warnings being treated as errors
symbols.c: In function 'read_symbol':
symbols.c:84: error: ignoring return value of 'fgets', declared with attribute warn_unused_result
make[3]: *** [symbols] Error 1
make[3]: Leaving directory `/var/tmp/portage/app-emulation/xen-3.3.0/work/xen-3.3.0/xen/tools'
make[2]: *** [default] Error 2
make[2]: Leaving directory `/var/tmp/portage/app-emulation/xen-3.3.0/work/xen-3.3.0/xen/tools'
make[1]: *** [/var/tmp/portage/app-emulation/xen-3.3.0/work/xen-3.3.0/xen/xen] Error 2
make[1]: Leaving directory `/var/tmp/portage/app-emulation/xen-3.3.0/work/xen-3.3.0/xen'
make: *** [build] Error 2
make: Leaving directory `/var/tmp/portage/app-emulation/xen-3.3.0/work/xen-3.3.0/xen'
 * ERROR: app-emulation/xen-3.3.0 failed.
 * Call stack:
 *     , line   49:  Called src_compile
 *             environment, line 2559:  Called die
 * The specific snippet of code:
 *       emake CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" -C xen ${myopt} || die "compile failed"
 *  The die message:
 *   compile failed

Reproducible: Always

Steps to Reproduce:
1. upgrade gcc to 4.3.3
2. add the xen overlay with layman
3. emerge xen (3.3.0)

Actual Results:  
Compilation fails due to a warning treated as an error (see code below).

Expected Results:  
No compilation failure.

symbol.c :

[snip snip snip]
static int read_symbol(FILE *in, struct sym_entry *s)
        char str[500];
        char *sym, stype;
        int rc;

        rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, str);
        if (rc != 3) {
                if (rc != EOF) {
                        /* skip line */
                        fgets(str, 500, in);  /* Line 84 : GCC stops here */
                return -1;
[snip snip snip]
Comment 1 404 Error 2009-02-01 18:50:21 UTC
Created attachment 180589 [details]
Comment 2 404 Error 2009-02-01 18:50:41 UTC
Created attachment 180590 [details]
Comment 3 404 Error 2009-02-01 19:16:50 UTC
Portage (default/linux/amd64/2008.0/desktop, gcc-4.3.3, glibc-2.9_p20081201-r1, 2.6.27-xen-r7 x86_64)
System uname: Linux-2.6.27-xen-r7-x86_64-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-glibc2.2.5
Timestamp of tree: Sat, 31 Jan 2009 13:15:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p48
dev-java/java-config: 1.3.7-r1, 2.1.7
dev-lang/python:     2.5.4-r2
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.2-r1
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.2
sys-apps/sandbox:    1.3.3
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-march=core2 -O2 -pipe"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/4.1/env /usr/kde/4.1/share/config /usr/kde/4.1/shutdown /usr/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=core2 -O2 -pipe"
FEATURES="distlocks fixpackages metadata-transfer parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
LINGUAS="en fr"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTDIR_OVERLAY="/usr/local/portage/layman/xen /usr/local/portage/layman/nx /usr/local/portage/layman/vmware"
USE="X a52 aac acl acpi alsa amd64 apache2 berkdb bluetooth branding bzip2 cairo cdda cddb cdio cdr chardet cli cracklib crypt cups dbus dirac dri dts dvd dvdr dvdread dvi eds emboss encode esd evo fam ffmpeg firefox flac fortran ftp gdbm gif giff glib gnome gpm gstreamer gtk gtk2 hal hvm iconv isdnlog jack java jpeg jpeg2k kdeprefix kerberos ldap libnotify mad midi mikmod mmx mp2 mp3 mpeg mudflap multilib nautilus ncurses nls nptl nptlonly nswrapper ntpl objc objc++ objc-gc odbc ogg openal opengl openmp oss pam pcre pdf perl png postgres ppds pppd python qt3 qt3support qt4 quicktime readline reflection samba sdl session spell spl sse sse2 sse3 ssl ssse3 startup-notification svg sysfs tcl tcpd theora tiff tk truetype unicode usb vorbis x264 xml xorg xulrunner xv xvid 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 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en fr" USERLAND="GNU" VIDEO_CARDS="vesa fglrx"
Comment 4 Maurice Volaski 2009-02-12 00:35:59 UTC
Created attachment 181718 [details]
new ebuild for adding patches to xen
Comment 5 Maurice Volaski 2009-02-12 00:36:37 UTC
Created attachment 181719 [details, diff]
this patch address this bug in particular
Comment 6 Maurice Volaski 2009-02-12 00:37:27 UTC
Created attachment 181721 [details, diff]
this addresses another related error that will surface after the first error is fixed
Comment 7 Maurice Volaski 2009-02-12 00:40:46 UTC
I have posted a proposed patch to address this. I haven't actually tested in xen in action to see if this code is correct, although it's fairly minor change.

However, after this has been patched, the error is similar to the one in xen-tools,

So I supplied a patch for that too.
Comment 8 Alejandro Muñiz 2009-04-12 18:00:32 UTC
x86_64-pc-linux-gnu-gcc -D__ASSEMBLY__ -O2 -fomit-frame-pointer -m64 -fno-strict-aliasing -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -DNDEBUG -nostdinc -fno-builtin -fno-common -iwithprefix include -Werror -Wno-pointer-arith -pipe -I/var/tmp/portage/app-emulation/xen-3.3.0-r1/work/xen-3.3.0/xen/include -I/var/tmp/portage/app-emulation/xen-3.3.0-r1/work/xen-3.3.0/xen/include/alude/asm-x86/mach-generic -I/var/tmp/portage/app-emulation/xen-3.3.0-r1/work/xen-3.3.0/xen/include/asm-x86/mach-default -msoft-float -fno-stack-protector -mno-red-zone -fpic -fno-reorder-blocks -fno-asynchroynchronous-unwind-tables -DGCC_HAS_VISIBILITY_ATTRIBUTE -g -D__XEN__ -DXSM_ENABLE -DFLASK_ENABLE -DXSM_MAGIC=0xf97cff8c -DFLASK_DEVELOP -DFLASK_BOOTPARAM -DFLASK_AVC_STATS -c clear_page.S -o clear_page.o
cc1: warnings being treated as errors
policydb.c: In function 'policydb_read':
policydb.c:1519: error: format '%Zu' expects type 'size_t', but argument 3 has type 'unsigned int'
Comment 9 Patrick Lauer gentoo-dev 2009-04-26 13:29:32 UTC
Got a fix from another bug applied, please reopen if you still have issues with 3.3.0 or 3.3.1.