Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 523876 - games-strategy/warzone2100 fails with =media-libs/glew-1.11.0: screen.cpp:264:22: error: invalid conversion
Summary: games-strategy/warzone2100 fails with =media-libs/glew-1.11.0: screen.cpp:264...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Games
URL: http://developer.wz2100.net/ticket/4218
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-27 13:16 UTC by Lars Wendler (Polynomial-C) (RETIRED)
Modified: 2014-10-29 12:50 UTC (History)
4 users (show)

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


Attachments
build.log (build.log,68.88 KB, text/plain)
2014-09-27 13:16 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-09-27 13:16:37 UTC
Created attachment 385606 [details]
build.log

x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../..  -I/usr/include/libpng16    -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DNDEBUG -DWZ_DATADIR="\"/usr/share/games/warzone2100\"" -DLOCALEDIR="\"/usr/share/locale\"" -I../.. -I../../3rdparty -I../../3rdparty/quesoglc -I/usr/include/GL -I/usr/include/libdrm  -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/qt4/QtNetwork -I/usr/include/qt4 -I/usr/include/qt4/QtScript -I/usr/include/qt4 -I/usr/include/qt4/QtCore   -g -Wno-enum-compare -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wcast-align -Wwrite-strings -Wpointer-arith -Wno-format-security -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/qt4/QtNetwork -I/usr/include/qt4 -I/usr/include/qt4/QtScript -I/usr/include/qt4 -I/usr/include/qt4/QtCore  -march=barcelona -mtune=barcelona -O2 -pipe -fstack-protector -c -o screen.o screen.cpp
screen.cpp: In function ‘void screen_EnableMissingFunctions()’:
screen.cpp:264:22: error: invalid conversion from ‘PFNGLSHADERSOURCEARBPROC {aka void (*)(unsigned int, int, const char**, const int*)}’ to ‘PFNGLSHADERSOURCEPROC {aka void (*)(unsigned int, int, const char* const*, const int*)}’ [-fpermissive]
   __glewShaderSource = __glewShaderSourceARB;
                      ^
Makefile:484: recipe for target 'screen.o' failed
make[2]: *** [screen.o] Error 1
make[2]: Leaving directory '/var/tmp/portage/games-strategy/warzone2100-3.1.1/work/warzone2100-3.1.1/lib/ivis_opengl'
Makefile:559: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/games-strategy/warzone2100-3.1.1/work/warzone2100-3.1.1'
Makefile:478: recipe for target 'all' failed
make: *** [all] Error 2
 * ERROR: games-strategy/warzone2100-3.1.1::gentoo failed (compile phase):
 *   emake failed


# emerge --info warzone2100
Portage 2.2.14_rc1 (python 2.7.8-final-0, default/linux/amd64/13.0/desktop/kde, gcc-4.8.3-asneeded, glibc-2.19-r1, 3.14.19 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.14.19-x86_64-Quad-Core_AMD_Opteron-tm-_Processor_2389-with-gentoo-2.2
KiB Mem:     8242056 total,   1892220 free
KiB Swap:    2097148 total,   1442352 free
Timestamp of tree: Sat, 27 Sep 2014 06:00:01 +0000
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.3_p26
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.8, 3.3.5-r1, 3.4.1
dev-util/cmake:           3.0.2
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.1
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.6, 1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.6.4, 4.8.3
sys-devel/gcc-config:     1.8::poly-c
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
sys-libs/glibc:           2.19-r1::poly-c
Repositories: gentoo kde-sunset poly-c
Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=barcelona -mtune=barcelona -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 /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-3.0 /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/X11/Sessions /etc/X11/app-defaults /etc/X11/xinit /etc/adobe /etc/bonobo-activation /etc/ca-certificates /etc/ca-certificates.conf /etc/dbus-1 /etc/env.d /etc/fonts /etc/fonts/fonts.conf /etc/foomatic /etc/games /etc/gconf /etc/gentoo-release /etc/gimp /etc/gnome-vfs-2.0 /etc/gre.d /etc/gtk-2.0 /etc/hp /etc/hsqldb /etc/htdig /etc/init.d /etc/iproute2 /etc/java-config-2 /etc/lftp /etc/logrotate.d /etc/ntop /etc/opt /etc/pango /etc/profile.d /etc/qt4 /etc/revdep-rebuild /etc/sandbox.d /etc/sasl2 /etc/sensors.d /etc/sgml /etc/sound /etc/ssl /etc/ssmtp /etc/t1lib /etc/terminfo /etc/vbox /etc/xdg /etc/xinetd.d /etc/xml"
CXXFLAGS="-march=barcelona -mtune=barcelona -O2 -pipe"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--alphabetical --with-bdeps=y --misspell-suggestions=n --autounmask=n --quiet-build=n --verbose-slot-rebuilds=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms sign strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
INSTALL_MASK="/etc/systemd /lib/systemd /lib32/systemd /lib64/systemd /usr/lib/systemd /usr/lib32/systemd /usr/lib64/systemd /etc/init.d/functions.sh"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/opt/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"
PORTDIR="/var/portage"
PORTDIR_OVERLAY="/var/lib/layman/kde-sunset /usr/local/portage"
SYNC="rsync://192.168.0.254/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 c++0x cairo caps cdda cdr cli cracklib crypt css cups cxx dbus declarative dri dts dvd dvdr emboss encode exif faac fam ffmpeg firefox flac gdbm gif glamor gles2 gmp gnutls gtk iconv icu idn imagemagick inotify jpeg jpeg2k kde kipi lame lcms libnotify lzma mac mad matroska midi mmap mmx mmxext mng modules mp3 mp4 mpeg mpfr multilib ncurses nls nptl nsplugin ogg opengl openmp opus pam pango pcre pdf phonon plasma png ppds qt3support qt4 quicktime readline rtmp schroedinger sdl session slang speex spell sse sse2 ssl startup-notification svg theora threads tiff truetype twolame udev unicode upower usb vaapi vcd vdpau vorbis vpx wxwidgets x264 x265 xattr xcb xcomposite xinerama xml xscreensaver xv xvid xvmc zlib zsh-completion" ABI_X86="64" ALSA_CARDS="emu10k1 hda-intel usb-audio" APACHE2_MODULES="access_compat alias auth_digest authn_anon auth_basic authn_core authn_default authn_file authz_core authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dir env file_cache filter headers include info log_config mime mime_magic rewrite status unique_id unixd userdir vhost_alias" ELIBC="glibc" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev joystick" KERNEL="linux" LIBREOFFICE_EXTENSIONS="pdfimport presenter-console presenter-minimizer" LINGUAS="de en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_USER_TARGETS="arm" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="radeon"
USE_PYTHON="2.7 3.3 3.4"
Unset:  CPPFLAGS, CTARGET, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

games-strategy/warzone2100-3.1.1 was built with the following:
USE="-debug nls qt4 videos"
Comment 1 Torsten Kaiser 2014-09-27 21:00:52 UTC
I hit the same error after the upgrade to glew-1.11.0 triggerd a rebuild of warzone2100.

The interresting parts of the broken function:
// Make OpenGL's VBO functions available under the core names for drivers that support OpenGL 1.4 only but have the VBO extension
void screen_EnableMissingFunctions()
{
[snip]
 if (!GLEW_VERSION_2_0 && GLEW_ARB_shader_objects)
        {
                debug(LOG_WARNING, "Pre-OpenGL 2.0: Fixing ARB_shader_objects extension function names.");
[snip]
                __glewShaderSource = __glewShaderSourceARB;
[snip]
        }

Newer GL(?) headers seem to have added an additional 'const' into one of the function prototypes and now 
"void (*)(unsigned int, int, const char**, const int*)"
is no longer identical with 
"void (*)(unsigned int, int, const char* const*, const int*)"

... a cast might fix this.

OTOH: It seems that upstream has killed any support for OpenGL < 2.0, so that whole segment of code is gone in the upstream sources for warzone2100-3.2:
https://github.com/Warzone2100/warzone2100/commit/7b8cddf0926b69393445ac829fd1a0ed5a050cdb

So a safer fix might be to preempt that requirement (According to wikipedia even integrated intel chipsets from 2004 have OpenGL 2.1 in mesa) and replace that part of screen_EnableMissingFunctions() with something like this:

                debug(LOG_FATAL, _("the Pre-OpenGL 2.0 + ARB_shader_objects workaround no longer works under newer versions of GLEW. Please upgrade your graphics drivers/hardware, if possible."));
                exit(1);

(I took this code from the caller of screen_EnableMissingFunctions() were it would output a similar message about needing OpenGL 1.2 and then exit()ing.)
Comment 2 Torsten Kaiser 2014-09-29 17:40:44 UTC
Arch linux seems to have opted for just the cast:
https://www.mail-archive.com/arch-commits@archlinux.org/msg185000.html

In lib/ivis_opengl/screen.cpp:
               __glewLinkProgram = __glewLinkProgramARB;
-              __glewShaderSource = __glewShaderSourceARB;
+              __glewShaderSource = (PFNGLSHADERSOURCEPROC) __glewShaderSourceARB;
               __glewUniform1f = __glewUniform1fARB;
Comment 3 Tupone Alfredo gentoo-dev 2014-10-29 12:50:37 UTC
Should be fixed (with casting)