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

Bug 86178

Summary: linux/fs.h fails to compile using g++
Product: Gentoo Linux Reporter: Robin Johnson <robbat2>
Component: [OLD] Core systemAssignee: Tim Yamin (RETIRED) <plasmaroo>
Status: RESOLVED INVALID    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-03-21 13:59:40 UTC
I'm trying to build a C++ application, using the FIBMAP ioctl, as provided by linux/fs.h.

However whenever I try to compile even a tiny sample application using g++, it fails. It compiles perfectly fine with gcc, just not g++.

Sample app:
#include <linux/fs.h>
int main() { return 0; }

Error from 'g++ test.cxx -o test' is:
In file included from /usr/include/linux/fs.h:12,
                 from ../test.c:1:
/usr/include/linux/wait.h: In function `int waitqueue_active(wait_queue_head_t*)':
/usr/include/linux/wait.h:79: error: `list_empty' undeclared (first use this function)
/usr/include/linux/wait.h:79: error: (Each undeclared identifier is reported only once for each function it appears in.)

I did -save-temps on both gcc and g++, and compared the intermediate output, but the only differences were 4 typecasts and two functions getting an extern "C" (the functions are preempt_schedule and printk).

Portage 2.0.51.19 (default-linux/x86/2004.2, gcc-3.4.3, glibc-2.3.4.20050125-r1, 2.6.10-gentoo-r4 i686)
=================================================================
System uname: 2.6.10-gentoo-r4 i686 AMD Athlon(tm) XP 3000+
Gentoo Base System version 1.6.10
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Feb 20 2005, 02:21:17)]
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r6
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=athlon-xp -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=athlon-xp -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage-distfiles"
FEATURES="autoaddcvs autoconfig buildpkg ccache confcache cvs digest distlocks sandbox sfperms userpriv"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j1"
PKGDIR="/usr/portage-packages"
PORTAGE_TMPDIR="/dev/shm"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://yamato/gentoo-portage"
USE="x86 3dnow X Xaw3d aalib acl acpi alsa amd apache2 apm arts avi berkdb bitmap-fonts caps cdr cgi clearpasswd crypt cscope cups curl divx4linux dri dts dvd dvdr emboss encode erandom escreen esd ethereal expat f77 faac faad fam flac flash foomaticdb fortran gcj gd gdbm gif glx gnome gpm gstreamer ieee1394 imagemagick imap imlib innodb ipalias ipv6 jabber jack java javascript jikes jpeg junit kde ldap libwww lm_sensors mad maildir mcal md5sum mikmod mmx motif mozcalendar mozdevelop mozsvg mozxmlterm mp3 mpeg multitarget nas ncurses nls nptl oav objc offensive oggvorbis opengl pam pcap pda pdflib perl pic plotutils png pnp ppds python quicktime rdesktop readline rpc samba scanner sdl slang slp snmp socks5 speex spell sqlite sse ssl tcltk tcpd tetex theora tidy tiff truetype truetype-fonts type1 type1-fonts ungif usb userlocales v4l v4l2 wifi wmf wxwindows xinerama xml xml2 xmms xosd xrandr xscreensaver xv xvid zlib linguas_en"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS
Comment 1 Tim Yamin (RETIRED) gentoo-dev 2005-03-21 15:34:24 UTC
What headers are you using? I just tried this with 2.6.11 headers and it works without any problems.
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-03-21 17:59:55 UTC
I'm using sys-kernel/linux26-headers-2.6.8.1-r2.
As those are the only 2.6 headers in plain ~arch.
linux-headers-2.6.11 is blocked via package.mask.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-03-24 16:07:15 UTC
Ok, I verify that other headers work.
Since I'm putting this application into the tree, I'll just block sys-kernel/linux26-headers-2.6.8.1* in the DEPEND.
Comment 4 Tim Yamin (RETIRED) gentoo-dev 2005-03-28 08:38:51 UTC
linux26-headers is now RIP and I think you've mentioned on gentoo-dev that linux-headers-2.6 works so I'm closing the bug. Please reopen if this issue reappears. Thanks!