Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 15110 - missing SDL include files in gcc 3.2 which causes plex86-20021117 compilation to fail
Summary: missing SDL include files in gcc 3.2 which causes plex86-20021117 compilation...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-04 11:49 UTC by Haroon Rafique
Modified: 2003-10-01 21:20 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Haroon Rafique 2003-02-04 11:49:30 UTC
I think the gcc 3 ebuild does not have the complete set of SDL include files
that originally came with libsdl. It only has one file in
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/SDL/SDL_endian.h

qpkg -l gcc-3.2.2 | grep SDL
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/SDL
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/SDL/SDL_endian.h
qpkg -l libsdl | grep include
/usr/include
/usr/include/SDL
/usr/include/SDL/SDL.h
/usr/include/SDL/SDL_active.h
/usr/include/SDL/SDL_audio.h
/usr/include/SDL/SDL_byteorder.h
/usr/include/SDL/SDL_cdrom.h
/usr/include/SDL/SDL_copying.h
/usr/include/SDL/SDL_endian.h
/usr/include/SDL/SDL_error.h
/usr/include/SDL/SDL_events.h
/usr/include/SDL/SDL_getenv.h
/usr/include/SDL/SDL_joystick.h
/usr/include/SDL/SDL_keyboard.h
/usr/include/SDL/SDL_keysym.h
/usr/include/SDL/SDL_main.h
/usr/include/SDL/SDL_mouse.h
/usr/include/SDL/SDL_mutex.h
/usr/include/SDL/SDL_name.h
/usr/include/SDL/SDL_opengl.h
/usr/include/SDL/SDL_quit.h
/usr/include/SDL/SDL_rwops.h
/usr/include/SDL/SDL_syswm.h
/usr/include/SDL/SDL_thread.h
/usr/include/SDL/SDL_timer.h
/usr/include/SDL/SDL_types.h
/usr/include/SDL/SDL_version.h
/usr/include/SDL/SDL_video.h
/usr/include/SDL/begin_code.h
/usr/include/SDL/close_code.h

Since the include files are not there, plex86 ebuild fails to compile.


Reproducible: Always
Steps to Reproduce:
1. emerge plex86
Actual Results:  
[...snip...]
In file included from sdl.cc:33:
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/SDL/SDL_endian.h:56:23:
SDL_types.h: No such file or directory
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/SDL/SDL_endian.h:57:23:
SDL_rwops.h: No such file or directory
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/SDL/SDL_endian.h:58:27:
SDL_byteorder.h: No such file or directory
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/SDL/SDL_endian.h:60:24:
begin_code.h: No such file or directory
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/SDL/SDL_endian.h:156:24:
close_code.h: No such file or directory
sdl.cc: In function `static void bx_gui_c::specific_init(bx_gui_c*, int, 
   char**, unsigned int, unsigned int, unsigned int)':
sdl.cc:202: warning: unused variable `Uint32 color'
sdl.cc:202: warning: unused variable `Uint32*buf'
sdl.cc: In function `static void bx_gui_c::text_update(Bit8u*, Bit8u*, long 
   unsigned int, long unsigned int, short unsigned int, unsigned int)':
sdl.cc:254: warning: unused variable `char*oldText'
sdl.cc:255: warning: unused variable `char*newText'
sdl.cc: In function `static void bx_gui_c::handle_events()':
sdl.cc:480: warning: unused variable `Uint32*buf'
sdl.cc:480: warning: unused variable `Uint32*buf_row'
sdl.cc:481: warning: unused variable `Uint32*buf2'
sdl.cc:481: warning: unused variable `Uint32*buf_row2'
sdl.cc:482: warning: unused variable `Uint32 disp'
sdl.cc:482: warning: unused variable `Uint32 disp2'
sdl.cc:483: warning: unused variable `int rows'
sdl.cc:483: warning: unused variable `int cols'
sdl.cc: At top level:
icon_bochs.h:31: warning: `unsigned char bochs_icon_bits[128]' defined but not 
   used
make[2]: *** [sdl.o] Error 1
make[2]: Leaving directory
`/var/tmp/portage/plex86-20021117/work/plex86-20021117/user/gui'
make[1]: *** [gui/libgui.a] Error 2
make[1]: Leaving directory
`/var/tmp/portage/plex86-20021117/work/plex86-20021117/user'
make: *** [all] Error 2

!!! ERROR: app-emulation/plex86-20021117 failed.
!!! Function src_compile, Line 40, Exitcode 2
!!! (no error message)


Expected Results:  
The ebuild should compile without any problems once the correct .h files are
present.

The one file SDL_endian.h has a note in there about the file being an
auto-edited file by fixincludes. I have no clue what fixincludes is, so here's
my kludge to do copy the files over.

cd /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/SDL
for file in /usr/include/SDL/*.h
do
  base=`basename $file`
  echo $file converted to $base
  if [ $base = 'SDL_endian.h' ]
  then
    continue
  fi
  echo $file copied to $base
  cp $file $base
done

After the .h files are in place, the plex86 compile works fine.

Portage 2.0.46-r9 (default-x86-1.4, gcc-3.2.2, glibc-2.3.1-r3)
=================================================================
System uname: 2.4.20-gentoo-r1 i686 Intel(R) Pentium(R) 4 CPU 1.80GHz
GENTOO_MIRRORS="http://www.ibiblio.org/pub/Linux/distributions/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config
/usr/kde/3/share/config /usr/kde/3.1/share/config /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY="/usr/portage.local"
USE="x86 oss 3dnow apm avi crypt cups encode gif jpeg libg++ mikmod mmx mpeg
ncurses nls pdflib png qtmt quicktime spell truetype xml2 xmms xv zlib gtkhtml
alsa gdbm berkdb slang readline arts tetex bonobo svga tcltk java guile mysql
postgres X sdl gpm tcpd pam libwww ssl perl python esd imlib oggvorbis gnome gtk
qt kde motif opengl mozilla cdr scanner xfs"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O3 -pipe -s -fomit-frame-pointer -fforce-addr
-falign-functions=4 -fprefetch-loop-arrays -ffast-math"
CXXFLAGS="-march=pentium4 -O3 -pipe -s -fomit-frame-pointer -fforce-addr
-falign-functions=4 -fprefetch-loop-arrays -ffast-math"
ACCEPT_KEYWORDS="x86 ~x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache"
Comment 1 Caleb Shay 2003-02-04 17:08:10 UTC
gcc thinks it is "fixing" the SDL headers when it is installed.  Obviously, it breaks them instead.  We KNOW that the headers included in our systems are compliant with gcc3 since we BUILD them with gcc3 to begin with.  Is there a configure flag we can pass when building gcc to tell it to NOT try to fix headers?

Regardless, the simple solution is:
rm -rf /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include

Poof!  Problem goes away.
Comment 2 Caleb Shay 2003-02-04 17:09:17 UTC
strike that, don't remove the whole include dir (type on my part) you want to remove /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/SDL
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2003-02-04 17:18:58 UTC
I think you are not understanding it properly.  Gcc only add a header in its
internal include dir, if it did 'compat' changes to it, else it should use
the original one in /usr/include.

The problem is actually because SDL_endian.h includes the other by:

--------------------------------------
#include "SDL_types.h"
#include "SDL_rwops.h"
#include "SDL_byteorder.h"

#include "begin_code.h"
--------------------------------------

Meaining gcc is going to look in the current dir.  You can thus blame:

1)  GCC for 'fixing' the header, but not symlinking the rest to there,
    or changing include "" to include <>

2)  SDL for using "".

3)  plex86 for not like sdlroids add -I/usr/include/SDL to CFLAGS.


Ill see if I can find a way to get a generic fix.
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2003-02-04 18:53:38 UTC
Caleb, collison at commit, so if it sounds like I was talking to you, was not =)
Thanks for the input!
Comment 5 Joshua Kinard gentoo-dev 2003-10-01 21:20:15 UTC
Resolving as FIXED as it appears the bug is fixed.  The referenced packages
are old, and the issue was likely fixed in newer versions of the packages.