Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 510474 - games-action/extreme-tuxracer-0.6.0 compile fails with media-libs/libsdl-1.2.15-r5: SDL_platform.h: No such file or directory
Summary: games-action/extreme-tuxracer-0.6.0 compile fails with media-libs/libsdl-1.2....
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Games
URL: https://sourceforge.net/apps/phpbb/ex...
Whiteboard:
Keywords: STABLE
Depends on:
Blocks: 512430
  Show dependency tree
 
Reported: 2014-05-16 09:47 UTC by Ulrich Müller
Modified: 2014-07-30 08:19 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,26.10 KB, text/plain)
2014-05-16 09:47 UTC, Ulrich Müller
Details
Patch fixing the issue in etr (0001-Append-SDL-flags-to-CXXFLAGS-rather-than-CFLAGS.patch,1.05 KB, patch)
2014-05-16 21:30 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2014-05-16 09:47:38 UTC
Created attachment 377058 [details]
build.log

make[2]: Entering directory '/var/tmp/portage/games-action/extreme-tuxracer-0.6.0/work/etr-0.6.0'
x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I.   -DETR_DATA_DIR=\"/usr/share/games\"  -march=core2 -O2 -ggdb -pipe -I/usr/include/freetype2 -std=c++11 -c -o audio.o audio.cpp
In file included from /usr/include/SDL/SDL_config.h:10:0,
                 from /usr/include/SDL/SDL_stdinc.h:30,
                 from /usr/include/SDL/SDL_main.h:26,
                 from /usr/include/SDL/SDL.h:30,
                 from bh.h:60,
                 from audio.h:20,
                 from audio.cpp:21:
/usr/include/x86_64-pc-linux-gnu/SDL/SDL_config.h:30:26: fatal error: SDL_platform.h: No such file or directory
compilation terminated.
Makefile:616: recipe for target 'audio.o' failed
make[2]: *** [audio.o] Error 1
make[2]: Leaving directory '/var/tmp/portage/games-action/extreme-tuxracer-0.6.0/work/etr-0.6.0'
Makefile:632: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/games-action/extreme-tuxracer-0.6.0/work/etr-0.6.0'
Makefile:457: recipe for target 'all' failed
make: *** [all] Error 2
 * ERROR: games-action/extreme-tuxracer-0.6.0::gentoo failed (compile phase):
 *   emake failed


Not sure who is to blame, but here are some observations:

1. extreme-tuxracer compiles fine with libsdl-1.2.15-r4

2. configure writes the following flags to the Makefile:
CFLAGS = -march=core2 -O2 -ggdb -pipe -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL  -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL
CXXFLAGS = -march=core2 -O2 -ggdb -pipe -I/usr/include/freetype2 -std=c++11
So, CFLAGS correctly inherits -I/usr/include/SDL from SDL_CFLAGS, while CXXFLAGS doesn't.


$ emerge --info
Portage 2.2.10 (default/linux/amd64/13.0/desktop, gcc-4.7.3, glibc-2.19, 3.11.3-gentoo x86_64)
=================================================================
System uname: Linux-3.11.3-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9300_@_2.50GHz-with-gentoo-2.2
KiB Mem:     3907740 total,    968260 free
KiB Swap:    6168924 total,   6028420 free
Timestamp of tree: Fri, 16 May 2014 08:45:01 +0000
ld GNU ld (GNU Binutils) 2.24
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p47
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.6-r1, 3.3.5, 3.4.0
dev-util/ccache:          3.1.9-r3
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.14.1
sys-devel/binutils:       2.24-r2
sys-devel/gcc:            4.6.4, 4.7.3-r1, 4.8.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.14 (virtual/os-headers)
sys-libs/glibc:           2.19
Repositories: gentoo emacs a1 ulm local
Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -ggdb -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /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/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/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="-march=core2 -O2 -ggdb -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache compressdebug 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://gentoo.inode.at http://gentoo.oregonstate.edu"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude=/metadata/cache"
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="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/emacs /var/lib/layman/a1 /var/lib/layman/ulm /usr/portage/local"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X Xaw3d a52 aac aalib acl acpi alsa amd64 amr ansi bbdb berkdb branding bzip2 cairo caps cdda cdparanoia cdr cli consolekit cracklib crypt cups curl cxx dbus dga directfb doc dri dts dvd dvdr elisp emacs emboss encode exif expat fam fbcon ffmpeg firefox flac fortran gcj gd gdbm gif gimp gimpprint glitz glut gpm gtk gtkhtml guile iconv idea imap ipv6 java jbig jpeg kpathsea latex lcms libcaca libnotify logrotate mad mbrola mmx mng modules motif mp3 mp4 mpeg multilib ncurses networking nls nocd nptl nscd nsplugin offensive ogg opengl openmp pam pango pcre pdf php png policykit postgres ppds qt3support qt4 rdesktop readline real recode regex ruby sasl sbcl sdl sendmail session skey socks5 source sox spell sqlite sse sse2 ssl startup-notification svg tcpd tex tiff truetype type1 udev udisks unicode upower usb userlocales vorbis wxwidgets wxwindows x264 xcb xft xml xpm xulrunner xv xvid zlib" ABI_X86="64 32" 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="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" 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" 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" LINGUAS="de de_DE en en_GB en_US fr it es" 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 vesa fbdev v4l" 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, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, USE_PYTHON
Comment 1 Ulrich Müller gentoo-dev 2014-05-16 10:05:48 UTC
(In reply to Ulrich Müller from comment #0)
> Not sure who is to blame, but here are some observations:
> 
> 1. extreme-tuxracer compiles fine with libsdl-1.2.15-r4
> 
> 2. configure writes the following flags to the Makefile:
> CFLAGS = -march=core2 -O2 -ggdb -pipe -I/usr/include/SDL -D_GNU_SOURCE=1
> -D_REENTRANT -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL 
> -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL
> CXXFLAGS = -march=core2 -O2 -ggdb -pipe -I/usr/include/freetype2 -std=c++11
> So, CFLAGS correctly inherits -I/usr/include/SDL from SDL_CFLAGS, while
> CXXFLAGS doesn't.

3. SDL header files include their siblings as "SDL_platform.h" instead of <SDL/SDL_platform.h>
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-05-16 18:44:56 UTC
I can reproduce this with this simple program:

  #include <SDL/SDL_config.h>

  int main()
  {
    return 0;
  }

Sadly, I don't see a good solution here. I can think of two possible workarounds:

1. wrap relatively #included headers as well -- SDL_platform.h in this case,

2. replace the relative #include with <SDL/*.h>.

I'll try to find out how multilib-portage solves this.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-05-16 18:57:42 UTC
Workaround #1 would require the following change:

--- libsdl-1.2.15-r5.ebuild	15 May 2014 16:15:03 -0000	1.4
+++ libsdl-1.2.15-r6.ebuild	16 May 2014 18:56:19 -0000
@@ -63,13 +63,19 @@
 S=${WORKDIR}/SDL-${PV}
 
 MULTILIB_WRAPPED_HEADERS=(
+	/usr/include/SDL/begin_code.h
+	/usr/include/SDL/close_code.h
 	/usr/include/SDL/SDL_byteorder.h
 	/usr/include/SDL/SDL_config.h
 	/usr/include/SDL/SDL_endian.h
+	/usr/include/SDL/SDL_error.h
 	/usr/include/SDL/SDL_getenv.h
 	/usr/include/SDL/SDL_keysym.h
+	/usr/include/SDL/SDL_platform.h
+	/usr/include/SDL/SDL_stdinc.h
 	/usr/include/SDL/SDL_syswm.h
 	/usr/include/SDL/SDL_types.h
+	/usr/include/SDL/SDL_version.h
 )
 
 pkg_setup() {
Comment 4 Thomas Sachau gentoo-dev 2014-05-16 19:07:42 UTC
Short version:

(In reply to Ulrich Müller from comment #0)
> x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I.  
> -DETR_DATA_DIR=\"/usr/share/games\"  -march=core2 -O2 -ggdb -pipe
> -I/usr/include/freetype2 -std=c++11 -c -o audio.o audio.cpp

is missing -I/usr/include/SDL as you already have outlined in

> 2. configure writes the following flags to the Makefile:
> CFLAGS = -march=core2 -O2 -ggdb -pipe -I/usr/include/SDL -D_GNU_SOURCE=1
> -D_REENTRANT -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL 
> -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL
> CXXFLAGS = -march=core2 -O2 -ggdb -pipe -I/usr/include/freetype2 -std=c++11
> So, CFLAGS correctly inherits -I/usr/include/SDL from SDL_CFLAGS, while
> CXXFLAGS doesn't.

so the proper fix is including that part in CXXFLAGS too.

If you want a longer version, tell me. ;-)
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-05-16 20:41:44 UTC
Yes, fixing the build system to add the relevant flags to CXXFLAGS would be a proper thing to do, and would solve the issue at hand. However, we need to think of the more generic issue.

Do we support building against SDL without using sdl-config/pkg-config? That is, do we expect plain #include <SDL/SDL_config.h> to work without -I/usr/include/SDL? If we do, then we need to apply additional hacks on top of SDL.

And in fact, we need to consider that in the future more packages may suffer similar issues, and not have extra -I workarounds in place. In this case, I think the only reasonable solution would be to wrap the included headers or force #include <>.

However, it should be noted that packages suffering this are quite unlikely since #include "" are pretty rare in system headers, and the wrapped headers do not #include non-system headers often.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-05-16 21:29:58 UTC
Upstreamed with patch 'attached'.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-05-16 21:30:17 UTC
Created attachment 377084 [details, diff]
Patch fixing the issue in etr
Comment 8 Julian Ospald 2014-05-17 19:20:50 UTC
+  17 May 2014; Julian Ospald <hasufell@gentoo.org>
+  extreme-tuxracer-0.6.0.ebuild, +files/extreme-tuxracer-0.6.0-libsdl.patch:
+  fix build failure wrt #510474
Comment 9 SpanKY gentoo-dev 2014-07-30 08:19:18 UTC
(In reply to Michał Górny from comment #7)

SDL_CFLAGS are just preprocessor flags, so it should really be in CPPFLAGS.  it probably doesn't break with this package though if it only builds C++ files.