Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 550766 - [clang-3.6/gcc-4.9] x11-drivers/xf86-video-intel-2.99.917 compile error: undeclared fstat (C99)
Summary: [clang-3.6/gcc-4.9] x11-drivers/xf86-video-intel-2.99.917 compile error: unde...
Status: RESOLVED DUPLICATE of bug 550784
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-29 19:01 UTC by Olaf Leidinger
Modified: 2015-06-10 20:49 UTC (History)
0 users

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


Attachments
patch to add includes needed for fstat (fstat.patch,470 bytes, patch)
2015-05-29 19:02 UTC, Olaf Leidinger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olaf Leidinger 2015-05-29 19:01:06 UTC
I'm trying to build my whole system with clang. The latest compile failure is on this package, however, GCC-4.9 doesn't compile it either:

Compilation fails on both compilers due to "implicit declaration of function 'fstat'" -- and I'm not the only one, as I found this paste:

http://pastebin.com/KkMy6QVf

Adding the missing includes to $WORKDIR/xf86-video-intel-2.99.917/src/sna/sna_driver.c via the attached patch makes it compile fine, for me.

Reproducible: Always




emerge --info
Portage 2.2.20 (python 2.7.9-final-0, default/linux/amd64/13.0/no-multilib, gcc-4.9.2, glibc-2.20-r2, 3.19.3-3-ARCH x86_64)
=================================================================
System uname: Linux-3.19.3-3-ARCH-x86_64-Genuine_Intel-R-_CPU_U7300_@_1.30GHz-with-gentoo-2.2
KiB Mem:     2018760 total,    175192 free
KiB Swap:    4193620 total,   4087648 free
Timestamp of repository gentoo: Fri, 29 May 2015 17:00:01 +0000
sh bash 4.3_p39
ld GNU ld (Gentoo 2.25 p1.2) 2.25
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.3_p39::gentoo
dev-lang/perl:            5.20.2-r1::gentoo
dev-lang/python:          2.7.9-r2::gentoo, 3.3.5-r1::gentoo
dev-util/cmake:           3.2.2::gentoo
dev-util/pkgconfig:       0.28-r3::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.16.3::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.12.6::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25-r1::gentoo
sys-devel/gcc:            4.8.4::gentoo, 4.9.2::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.0::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

gnome
    location: /var/lib/layman/gnome
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -pipe -march=core2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -pipe -march=core2"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS=" --quiet-build=y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4 -l3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="X acl amd64 berkdb bluetooth bzip2 cairo cli cracklib crypt cups cxx dbus djvu dri egl fortran gdbm gles2 gpg gtk iconv icu idn ipv6 jit jpeg lzo mmx mmxext modules ncurses networkmanager nls nptl openmp pam pch pcre policykit pulseaudio qt5 readline session sse sse2 ssl systemd tcpd theora unicode v4l wayland zlib" ABI_X86="64" 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" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 sse4_1 ssse3" 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 ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en fr fi" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="intel" 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, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Olaf Leidinger 2015-05-29 19:02:57 UTC
Created attachment 404294 [details, diff]
patch to add includes needed for fstat

This patch adds the includes, which are needed for the fstat function (according to it's man page).
Comment 2 Mike Gilbert gentoo-dev 2015-05-30 00:17:31 UTC
Attach a build log.
Comment 3 Mike Gilbert gentoo-dev 2015-05-30 07:22:29 UTC

*** This bug has been marked as a duplicate of bug 550784 ***
Comment 4 tman 2015-06-10 20:49:21 UTC
patch dont work:


or=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -fvisibility=hidden -I/usr/include/xorg -I/usr/include/X11/dri -I/usr/include/libdrm -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/libdrm -I/usr/include/libdrm -I/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/xvmc -I/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src -I/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/render_program -march=corei7 -O2 -pipe -c /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_video.c  -fPIC -DPIC -o .libs/intel_video.o
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_driver.c: In function ‘I830HandleUEvents’:
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_driver.c:745:14: error: storage size of ‘s’ isn’t known
  struct stat s;
              ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_driver.c:753:2: error: implicit declaration of function ‘fstat’ [-Werror=implicit-function-declaration]
  if (fstat(intel->drmSubFD, &s)) {
  ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_driver.c:753:2: warning: nested extern declaration of ‘fstat’ [-Wnested-externs]
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_driver.c:745:14: warning: unused variable ‘s’ [-Wunused-variable]
  struct stat s;
              ^
cc1: some warnings being treated as errors
Makefile:528: recipe for target 'intel_driver.lo' failed
make[3]: *** [intel_driver.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_video.c:103:2: warning: initialization discards ‘const’ qualifier from pointer target type
  {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"},
  ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_video.c:104:2: warning: initialization discards ‘const’ qualifier from pointer target type
  {XvSettable | XvGettable, -128, 127, "XV_BRIGHTNESS"},
  ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_video.c:105:2: warning: initialization discards ‘const’ qualifier from pointer target type
  {XvSettable | XvGettable, 0, 255, "XV_CONTRAST"},
  ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_video.c:106:2: warning: initialization discards ‘const’ qualifier from pointer target type
  {XvSettable | XvGettable, 0, 1023, "XV_SATURATION"},
  ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_video.c:107:2: warning: initialization discards ‘const’ qualifier from pointer target type
  {XvSettable | XvGettable, -1, 1, "XV_PIPE"}
  ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_video.c:112:2: warning: initialization discards ‘const’ qualifier from pointer target type
  {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA0"},
  ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_video.c:113:2: warning: initialization discards ‘const’ qualifier from pointer target type
  {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA1"},
  ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_video.c:114:2: warning: initialization discards ‘const’ qualifier from pointer target type
  {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA2"},
  ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_video.c:115:2: warning: initialization discards ‘const’ qualifier from pointer target type
  {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA3"},
  ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_video.c:116:2: warning: initialization discards ‘const’ qualifier from pointer target type
  {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA4"},
  ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/uxa/intel_video.c:117:2: warning: initialization discards ‘const’ qualifier from pointer target type
  {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA5"}
  ^
make[3]: Leaving directory '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917_build/src/uxa'
Makefile:598: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917_build/src'
Makefile:468: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917_build'
Makefile:399: recipe for target 'all' failed
make: *** [all] Error 2
 * ERROR: x11-drivers/xf86-video-intel-2.99.917::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=x11-drivers/xf86-video-intel-2.99.917::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-drivers/xf86-video-intel-2.99.917::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917_build'
 * S: '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917'
 * !!! User patches were applied to this build!

>>> Failed to emerge x11-drivers/xf86-video-intel-2.99.917, Log file:

>>>  '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/temp/build.log'

 * Messages for package x11-drivers/xf86-video-intel-2.99.917:

 * ERROR: x11-drivers/xf86-video-intel-2.99.917::gentoo failed (