Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 540644 - dev-libs/DirectFB-1.7.6[egl]: egl_system.c:150:82: error: ‘nativewindow’ undeclared (first use in this function)
Summary: dev-libs/DirectFB-1.7.6[egl]: egl_system.c:150:82: error: ‘nativewindow’ unde...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal with 5 votes (vote)
Assignee: Gentoo Graphics Project
Whiteboard: Pending removal: 2018-07-17
Keywords: PMASKED
: 542402 (view as bug list)
Depends on:
Blocks: 609496
  Show dependency tree
Reported: 2015-02-19 11:30 UTC by Kobboi
Modified: 2018-07-28 12:08 UTC (History)
12 users (show)

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

build.log (build.log,325.36 KB, text/plain)
2015-02-19 11:31 UTC, Kobboi
build log (dev-libs:DirectFB-1.7.6:20150224-041809.log,241.16 KB, text/x-log)
2015-02-24 13:09 UTC, David Klann
emerge --info (emerge-info,6.04 KB, text/plain)
2015-02-24 13:09 UTC, David Klann
info.txt (info.txt,6.27 KB, text/plain)
2015-11-15 16:33 UTC, Toralf Förster
dev-libs:DirectFB-1.7.6:20151115-160902.log (dev-libs:DirectFB-1.7.6:20151115-160902.log,292.82 KB, text/plain)
2015-11-15 16:33 UTC, Toralf Förster
emerge-history.txt (emerge-history.txt,414.97 KB, text/plain)
2015-11-15 16:33 UTC, Toralf Förster
environment (environment,107.41 KB, text/plain)
2015-11-15 16:33 UTC, Toralf Förster

Note You need to log in before you can comment on or make changes to this bug.
Description Kobboi 2015-02-19 11:30:51 UTC
egl_system.c: In function ‘InitEGL’:
egl_surface_pool.c: In function ‘eglAllocateBuffer’:
egl_system.c:150:82: error: ‘nativewindow’ undeclared (first use in this function)
      egl->eglSurface = eglCreateWindowSurface( egl->eglDisplay, egl->eglConfig, &nativewindow, NULL );

Reproducible: Always
Comment 1 Kobboi 2015-02-19 11:31:14 UTC
Created attachment 396940 [details]
Comment 2 Kobboi 2015-02-19 11:31:36 UTC
$ emerge --info
Portage 2.2.17 (python 2.7.9-final-0, default/linux/amd64/13.0/desktop/gnome/systemd, gcc-4.9.2, glibc-2.20-r2, 3.18.7 x86_64)
System uname: Linux-3.18.7-x86_64-Intel-R-_Core-TM-_i7-4770_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    32843056 total,   2111704 free
KiB Swap:   67108860 total,  67107516 free
Timestamp of repository gentoo: Thu, 19 Feb 2015 00:00:01 +0000
sh bash 4.3_p33-r1
ld GNU ld (Gentoo 2.25 p1.0) 2.25
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.3_p33-r1::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.9-r2::gentoo, 3.3.5-r1::gentoo, 3.4.2::gentoo
dev-util/cmake:           3.1.0::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.13.9::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.12.6::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25::gentoo
sys-devel/gcc:            4.9.2::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           3.82-r4::gentoo
sys-kernel/linux-headers: 3.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo

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

    location: /home/christophe/Overlay
    masters: gentoo
    priority: 0

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

    location: /var/lib/layman/rion
    sync-type: laymansync
    masters: gentoo
    priority: 50

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

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

ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-O2 -march=native -pipe -fomit-frame-pointer"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=native -pipe -fomit-frame-pointer"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nostrip parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth bzip2 cairo cdda cdr cli colord cracklib crypt cups cxx dbus directfb dri dts dvd dvdr eds egl emboss encode evo exif fam ffmpeg firefox flac fortran gdbm gif glamor gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk iconv introspection ipv6 jpeg lcms ldap libnotify libsecret mad mmx mng modemmanager modules mp3 mp4 mpeg mtp multilib nautilus ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt3support qt4 readline samba sdl session socialweb spell sse sse2 sse4 ssl ssse3 startup-notification svg systemd tcpd tiff tracker truetype udev udisks unicode upnp upower usb vdpau vorbis wayland wxwidgets x264 xcb xml xv xvid 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 sse sse2" 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" 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" 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="radeonsi radeon" 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"
Comment 3 David Klann 2015-02-24 13:07:52 UTC
Experiencing the same thing here. Same archictecture. Build log and emerge --info attached.

I'm happy to help troubleshoot this.

  ~David Klann
Comment 4 David Klann 2015-02-24 13:09:27 UTC
Created attachment 397394 [details]
build log
Comment 5 David Klann 2015-02-24 13:09:49 UTC
Created attachment 397396 [details]
emerge --info
Comment 6 SpanKY gentoo-dev 2015-03-07 19:59:55 UTC
*** Bug 542402 has been marked as a duplicate of this bug. ***
Comment 7 Toralf Förster gentoo-dev 2015-11-15 16:33:10 UTC
Created attachment 417024 [details]


  This is an unstable amd64 chroot image (named amd64-desktop-unstable_20151106-165316) at a hardened host acting as a tinderbox.


  Portage 2.2.24 (python 2.7.10-final-0, default/linux/amd64/13.0/desktop, gcc-4.9.3, glibc-2.22-r1, 4.1.7-hardened-r1 x86_64)
Comment 8 Toralf Förster gentoo-dev 2015-11-15 16:33:13 UTC
Created attachment 417026 [details]
Comment 9 Toralf Förster gentoo-dev 2015-11-15 16:33:16 UTC
Created attachment 417028 [details]
Comment 10 Toralf Förster gentoo-dev 2015-11-15 16:33:18 UTC
Created attachment 417030 [details]
Comment 11 Petross404(Petros S) 2016-10-22 09:53:47 UTC
No resolution till now?

I have the exact same problem described here.
Comment 12 James Baldassari 2016-11-27 04:27:42 UTC
I just ran into the same problem (nativewindow undeclared) and was able to find a resolution.  For anyone who isn't interested in how I found the solution here's the TLDR version: just add the -egl USE flag when building the DirectFB package.  For example, you can add the following to /etc/portage/package.use/DirectFB:

dev-libs/DirectFB -egl

Here's how I found the fix.  First of all, I thought that this particular error was odd because it was a compilation error (as opposed to something like a linker error), and we really shouldn't see this sort of error in a stable package.  I've done quite a bit of C and C++ development in the past, so I figured I'd just take a look at the source code to see if this variable really was undeclared.  From the emerge error message I found the offending source file here:


The error said that line 150 was the problem:

egl->eglSurface = eglCreateWindowSurface( egl->eglDisplay, egl->eglConfig, &nativewindow, NULL );

Looking at where nativewindow was declared, the problem was obvious:

     static EGL_DISPMANX_WINDOW_T nativewindow;
     DISPMANX_ELEMENT_HANDLE_T dispman_element;
     DISPMANX_DISPLAY_HANDLE_T dispman_display;
     DISPMANX_UPDATE_HANDLE_T dispman_update;
     VC_RECT_T dst_rect;
     VC_RECT_T src_rect;



If RASPBERRY_PI is not defined then it's simply not possible for this code to compile.  I would call this a bug.  The nativewindow variable should be declared outside of that #ifdef.  Anyway, the next thing I did was look for a USE flag or something else that would cause RASPBERRY_PI to be declared.  I didn't find anything.  Next, I searched the whole working directory for RASPBERRY_PI to see if I could figure out another way to get it to be declared, and I came across this in the ebuild:

sed -i \
    -e '/#define RASPBERRY_PI/d' \
    systems/egl/egl_system.c || die #497124

So the ebuild is specifically _removing_ the RASPBERRY_PI declaration!  Thankfully there was a helpful "die" argument which I assumed was a Gentoo bug number.  That took me here:

Apparently egl (or logic specific to the Raspberry Pi?) was causing problems, so the ebuild maintainers attempted to disable it by removing the RASPBERRY_PI definition.  According to that bug:

"...the egl logic is specific to the Raspberry Pi..." 

I'm not running a Raspberry Pi, so I just set "-egl" in the USE flags for the DirectFB package, and that fixed the problem.  I think there are larger issues here that should be resolved, but at least there is a simple work-around for now.  Hope this helps someone else.
Comment 13 Alec Ari 2016-12-06 23:22:48 UTC
I can confirm that disabling the egl USE flag for DirectFB 1.7.6 fixes this problem.
Comment 14 Thomas Beutin 2016-12-28 16:19:20 UTC
(In reply to Alec Ari from comment #13)
> I can confirm that disabling the egl USE flag for DirectFB 1.7.6 fixes this
> problem.

it helps here too.
Comment 15 Petross404(Petros S) 2017-01-22 21:34:49 UTC
Should the egl USE Flag be temporarily removed or masked, till a proper solution is found?
Comment 16 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-07-28 12:08:54 UTC
Package removed.