Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 264770 - net-proxy/squid-2.7.6-r1 fails with recent sys-kernel/linux-headers when linux/capability.h is included
Summary: net-proxy/squid-2.7.6-r1 fails with recent sys-kernel/linux-headers when linu...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Network Proxy Developers (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-03 15:22 UTC by martin holzer
Modified: 2009-06-16 19:34 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description martin holzer 2009-04-03 15:22:58 UTC
i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=\"/etc/squid/squid.conf\" -I. -I../include -I. -I. -I../include -I../include    -m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -march=pentium3 -O3 -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -MT unlinkd.o -MD -MP -MF .deps/unlinkd.Tpo -c -o unlinkd.o unlinkd.c
In file included from /usr/include/sys/capability.h:35,
                 from tools.c:50:
/usr/include/linux/capability.h:73: error: expected specifier-qualifier-list before '__le32'
make[3]: *** [tools.o] Error 1
make[3]: *** Waiting for unfinished jobs....
mv -f .deps/unlinkd.Tpo .deps/unlinkd.Po
make[3]: Leaving directory `/var/tmp/portage/net-proxy/squid-2.7.6-r1/work/squid-2.7.STABLE6/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/net-proxy/squid-2.7.6-r1/work/squid-2.7.STABLE6/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/var/tmp/portage/net-proxy/squid-2.7.6-r1/work/squid-2.7.STABLE6/src'
make: *** [all-recursive] Error 1
 *
 * ERROR: net-proxy/squid-2.7.6-r1 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 3502:  Called die
 * The specific snippet of code:
 *       emake || die "emake failed"
 *  The die message:
 *   emake failed
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/net-proxy/squid-2.7.6-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-proxy/squid-2.7.6-r1/temp/environment'.


Reproducible: Always
Comment 1 martin holzer 2009-04-03 15:23:21 UTC
# emerge --info
Portage 2.1.6.7 (default/linux/x86/2008.0, gcc-4.1.2, glibc-2.8_p20080602-r1, 2.6.27-gentoo-r7 i686)
=================================================================
System uname: Linux-2.6.27-gentoo-r7-i686-Pentium_III_-Coppermine-with-glibc2.0
Timestamp of tree: Fri, 03 Apr 2009 01:45:01 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7-r1, 2.1.7
dev-lang/python:     2.4.4-r13, 2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O3 -pipe -ffast-math -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch userpriv"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
LINGUAS="en"
MAKEOPTS="-j2"
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.gentoo.org/gentoo-portage"
USE="aalib acl apache2 bash-completion berkdb bzip2 calendar cgi cli cracklib crypt cscope ctype cups curl dga diskio dri dvd exif fam fortran ftp gd gdbm gif gnutls gpm iconv imap innodb ipv6 isdnlog java javacomm javamail jikes jpeg ldap logrotate maildir mbox midi milter mpeg mudflap mysql nagios-dns nagios-ntp nagios-ping nagios-ssh ncurses nls nptl nptlonly openmp pam pcre perl php pic png postgresql pppd python readline reflection samba sasl session sharedmem snmp sockets spell spl sqlite ssl sysfs tcltk tcpd tiff truetype unicode x86 xext xml xmlrpc xorg xsl xslt zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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" USERLAND="GNU" VIDEO_CARDS="i810 v4l"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-04-04 17:23:38 UTC
I just test-compiled this package successfully on my machine. Could you please test if this package compiles on your machine with less aggressive CFLAGS? I suggest you replace "-O3" with "-O2" and remove "-ffast-math".
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-04-05 20:36:16 UTC
(In reply to comment #2)
> I just test-compiled this package successfully on my machine. Could you please
> test if this package compiles on your machine with less aggressive CFLAGS? I
> suggest you replace "-O3" with "-O2" and remove "-ffast-math".

Please reopen this bug when compiling with "-O2" and without "-ffast-math" still doesn't work.
Comment 4 martin holzer 2009-04-06 07:30:30 UTC
^^
Comment 5 martin holzer 2009-04-07 13:13:03 UTC
it's not -ffast-math,
it's O3 

so how about filtering out the flag

or review the patch, that this breaks up ?
Comment 6 Alin Năstac (RETIRED) gentoo-dev 2009-04-09 00:30:48 UTC
Well, the header file that has a problem with -O3 is /usr/include/linux/capability.h and this file belongs to sys-kernel/linux-headers.
Therefore I'll reassign this bug to toolchain team.

@reporter: please specify your versions of sys-libs/libcap and sys-kernel/linux-headers.
Comment 7 SpanKY gentoo-dev 2009-04-09 09:48:23 UTC
that doesnt sound correct at all, nor does it validate:
echo '#include <linux/capability.h>' | gcc -x c - -c -o /dev/null -O3

if we look at the header:
$ sed -n 71,74p /usr/include/linux/capability.h

struct vfs_cap_data {
        __le32 magic_etc;            /* Little endian */
        struct {

and __le32 is defined properly because the header includes linux/types.h which sets up the typedef for that

my guess is squid is doing something stupid ... go into the build dir and run the command that is erroring ... if it still fails, replace "-c" with "-E -dD" and post the resulting file as an attachment
Comment 8 Alin Năstac (RETIRED) gentoo-dev 2009-04-10 20:55:43 UTC
It works for me, closing as WORKSFORME. 
Probably your system is borked by -ffast-math, I dunno.
Comment 9 Andras Tantos 2009-05-21 04:18:13 UTC
This does repro for me. Here's a snippet from tools.cc:

#ifdef _SQUID_LINUX_
#if HAVE_SYS_CAPABILITY_H
#undef _POSIX_SOURCE
/* Ugly glue to get around linux header madness colliding with glibc */
#define _LINUX_TYPES_H
#define _LINUX_FS_H
typedef uint32_t __u32;
#include <sys/capability.h>
#endif
#endif

As you can see, it defines _LINUX_TYPES_H which prevents linux/capability.h from properly including linux/types.h, thus the compiler error. It also defines __u32 to make sure that capability.h compiles, but forgers to define __le32.

I'm not sure who and why added this cludge and if it is tools.cc, linux/capability.h or linux/types.h that changed, but this is definitely a problem now.
Comment 10 Hector Martin 2009-05-27 22:00:29 UTC
I can reproduce this too. Different error message and some warnings (probably due to GCC 4.3):

depbase=`echo tools.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
        x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=\"/etc/squid/squid.conf\" -I. -I../include -I. -I. -I../include -I../include -I../lib/libTrie/include   -I/usr/include/libxml2  -Wall -Wpointer-arith -Wwrite-strings -fhuge-objects -D_REENTRANT -m64 -march=core2 -O2 -pipe -MT tools.o -MD -MP -MF $depbase.Tpo -c -o tools.o tools.cc &&\
        mv -f $depbase.Tpo $depbase.Po
cc1plus: warning: switch ‘-fhuge-objects’ is no longer supported
cc1plus: warning: switch ‘-fhuge-objects’ is no longer supported
In file included from /usr/include/sys/capability.h:26,
                 from tools.cc:51:
/usr/include/linux/capability.h:73: error: ‘__le32’ does not name a type
/usr/include/linux/capability.h:75: error: ‘__le32’ does not name a type
/usr/include/linux/capability.h:76: error: ‘__le32’ does not name a type
make[3]: *** [tools.o] Error 1

emerge --info:
Portage 2.2_rc33 (default/linux/amd64/2008.0/desktop, gcc-4.3.2, glibc-2.8_p20080602-r1, 2.6.28-gentoo-r1 x86_64)
=================================================================
System uname: Linux-2.6.28-gentoo-r1-x86_64-Intel-R-_Core-TM-2_Duo_CPU_P8600_@_2.40GHz-with-gentoo-1.12.11.1
Timestamp of tree: Wed, 27 May 2009 17:45:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [enabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7-r1, 2.1.7
dev-lang/python:     2.5.4-r2, 2.6.1-r1
dev-python/pycrypto: 2.0.1-r8
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.6.2-r1
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distcc distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ ftp://212.219.56.135/sites/www.ibiblio.org/gentoo/ http://gentoo.mneisen.org/ http://212.219.56.135/sites/www.ibiblio.org/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="en es"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--timeout=180"
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="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnowex 7zip X a52 aac aalib acl acpi addbookmarks additions akode alias alsa amarok amd64 amd64codecs apache2 arts artswrappersuid asf aspell atm audiofile autoreplace avahi avi bash-completion berkdb bitmap-fonts bittorrent-external blender-game bluetooth bonjour branding bzip2 bzlib cairo calendar cdda cddb cdparanoia cdr cgi chm cjk clamav cli connectionstatus contactnotes cracklib crypt css ctype cups curl cvs daap dba dbus dillo divx4linux dlloader doc dri dts dv dvb dvd dvdr dvdread eds embedded emboss encode evo examples exif fam fasttrack fbcon fbcondecor ffmpeg firefox flac flash font-server foomaticdb fortran ftp gd gdbm gif glitz gnutella gnutls gpm gps gs gsm gstreamer gtk gtk2 h323 hal hash highlight history httpd iconv id3tag ieee1394 imagemagick imap inifile inkjar innodb insecure-savers ipod ipv6 irc isdnlog ithreads jabber jack jadetex java javascript jingle joystick jpeg jpeg2k kde kpathsea kqemu ladspa laptop libcaca libnotify libsamplerate libv4l2 lirc lisamplerate live lm_sensors logrotate mad maildir matroska mbox mbrola mdnsresponder-compat messenger midi mikmod mjpeg mmx mmxext mng mod modplug moviepack moviesounds mozbranding mozcalendar mozdevelop mozilla mozsvg mozxmlterm mp3 mp4 mpeg mpeg4 mplayer msn mudflap multilib musicbrainz mysql mysqli mythtv ncurses netmeeting network nls nodrm nowlistening nptl nptlonly nsplugin nvidia offensive ogg oggvorbis openexr opengl openmp pam pcre pdf perl plasma plotutils png posix ppds pppd protutils python qt qt3 qt3support qt4 quicktime rar readline reflection rt2500pci rtc rtsp samba scanner sdk sdl session shout skins slang sndfile soap sockets sox speex spell spl sql sqlite srt sse sse2 sse3 ssl ssse3 startup-notification statistics stream subtitles subversion svg swat sysfs taglib tcltk tcpd test-programs texteffect tga theora threads tiff tk transmitter truetype truetype-fonts twolame type1-fonts udev unicode usb utempter utf8 v4l v4l2 vdpau vim-syntax visualization vlm vorbis webkit webpresence wifi wininst wmf wxwindows x264 xcb xcomposite xforms xine xinerama xml xmlreader xmlrpc xmlwriter xorg xosd xprint xscreensaver xsl xulrunner xv xvid yahoo yv12 zeroconf zip zlib zvbi" ALSA_CARDS="usb-audio virmidi loopback hda-intel" 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 auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CAMERAS="canon" ELIBC="glibc" INITNG_PLUGINS="also bash_launcher chdir chroot conflict cpout critical ctrlaltdel daemon_clean debug_commands envparser find fmon fstat history idleprobe initctl interactive iparser last limit lockfile logfile netdev netprobe ngc4 ngcs nge pause provide reload renice rlparser simple_launcher stcmd stdout suid syncron syslog sysreq unneeded usplash" INPUT_DEVICES="evdev keyboard mouse wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en es" LIRC_DEVICES="serial devinput" USERLAND="GNU" VIDEO_CARDS="fbdev nv nvidia vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 11 SpanKY gentoo-dev 2009-05-27 22:32:54 UTC
people screwing around with types before including linux/ headers get the pieces

wrt sys/capability.h, make sure you're using latest libcap
Comment 12 Alin Năstac (RETIRED) gentoo-dev 2009-06-16 19:33:17 UTC
Turns out tools.c contains a ugly hack.
Comment 13 Alin Năstac (RETIRED) gentoo-dev 2009-06-16 19:34:02 UTC
Fixed in squid-2.7.6-r1 (w/o rev bump).