Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 169388 - media-libs/libsdl fails to compile w/ linux-headers-2.6.20
Summary: media-libs/libsdl fails to compile w/ linux-headers-2.6.20
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
: 170285 170775 (view as bug list)
Depends on:
Blocks: sane-linux-headers
  Show dependency tree
 
Reported: 2007-03-05 01:05 UTC by merwan kashouty
Modified: 2007-04-08 14:51 UTC (History)
4 users (show)

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


Attachments
libsdl-1.2.11-no-yasm.patch (libsdl-1.2.11-no-yasm.patch,1.67 KB, patch)
2007-03-05 16:07 UTC, Peter Alfredsen (RETIRED)
Details | Diff
libsdl-1.2.11-pagesize.patch (libsdl-1.2.11-pagesize.patch,3.00 KB, patch)
2007-03-05 16:08 UTC, Peter Alfredsen (RETIRED)
Details | Diff
libsdl-1.2.11-r1.ebuild (libsdl-1.2.11-r1.ebuild,4.88 KB, text/plain)
2007-03-05 16:09 UTC, Peter Alfredsen (RETIRED)
Details
XF86DGA.c-page.h.patch (XF86DGA.c-page.h.patch,496 bytes, patch)
2007-03-13 23:18 UTC, Ed Catmur
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description merwan kashouty 2007-03-05 01:05:31 UTC
i have this failing on both ~amd64 and ~x86 with the same error... a workaround posted in bug #168730 

ln -nsf /usr/src/linux/include/asm-x86_64/page.h /usr/include/asm
 
 or for x86

ln -nsf /usr/src/linux/include/asm-i386/page.h /usr/include/asm

enables libsdl to compile now on both installs... but is there a "real" solution to this issue of does libsdl just need to fixed upstream?

i saw where the above was marked a duplicate of bug #159304 but wasnt entirely sure what to make of that



Reproducible: Always
Comment 1 merwan kashouty 2007-03-05 01:08:51 UTC
 x86_64-pc-linux-gnu-gcc -march=k8 -O2 -pipe -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -DXTHREADS -I/usr/include/directfb -D_REENTRANT -D_REENTRANT -DHAVE_LINUX_VERSION_H -c ./src/video/x11/SDL_x11video.c -o build/SDL_x11video.o >/dev/null 2>&1
./src/video/Xext/Xxf86dga/XF86DGA.c:21:40: error: asm/page.h: No such file or directory
make: *** [build/XF86DGA.lo] Error 1
make: *** Waiting for unfinished jobs....
 x86_64-pc-linux-gnu-gcc -march=k8 -O2 -pipe -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -DXTHREADS -I/usr/include/directfb -D_REENTRANT -D_REENTRANT -DHAVE_LINUX_VERSION_H -c ./src/video/x11/SDL_x11wm.c -o build/SDL_x11wm.o >/dev/null 2>&1
 x86_64-pc-linux-gnu-gcc -march=k8 -O2 -pipe -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -DXTHREADS -I/usr/include/directfb -D_REENTRANT -D_REENTRANT -DHAVE_LINUX_VERSION_H -c ./src/video/x11/SDL_x11yuv.c -o build/SDL_x11yuv.o >/dev/null 2>&1

!!! ERROR: media-libs/libsdl-1.2.11-r1 failed.
Comment 2 Paul Taylor 2007-03-05 04:06:27 UTC
Ditto; different file, same error:

 x86_64-pc-linux-gnu-gcc -march=athlon64 -O2 -pipe -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -c ./src/video/fbcon/SDL_fbriva.c -o build/SDL_fbriva.o >/dev/null 2>&1
./src/video/fbcon/SDL_fbvideo.c:32:57: error: asm/page.h: No such file or directory
make: *** [build/SDL_fbvideo.lo] Error 1
make: *** Waiting for unfinished jobs....
 x86_64-pc-linux-gnu-gcc -march=athlon64 -O2 -pipe -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -c ./src/thread/pthread/SDL_systhread.c  -fPIC -DPIC -o build/.libs/SDL_systhread.o
 x86_64-pc-linux-gnu-gcc -march=athlon64 -O2 -pipe -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -c ./src/thread/pthread/SDL_systhread.c -o build/SDL_systhread.o >/dev/null 2>&1

!!! ERROR: media-libs/libsdl-1.2.11-r1 failed.
Comment 3 Darren Dale 2007-03-05 11:33:43 UTC
> ln -nsf /usr/src/linux/include/asm-i386/page.h /usr/include/asm
> 
> enables libsdl to compile now on both installs... but is there a "real"
> solution to this issue of does libsdl just need to fixed upstream?

This did not work for me, on ~x86 with gcc-4.1.2:

 ./build-scripts/strip_fPIC.sh /usr/bin/yasm -f elf -I ./src/hermes/ -DHIDDEN_VISIBILITY ./src/hermes/mmx_main.asm  -fPIC -DPIC -o build/.libs/mmx_main.o
/usr/bin/yasm -f elf -I ./src/hermes/ -DHIDDEN_VISIBILITY ./src/hermes/mmx_main.asm -o build/.libs/mmx_main.o
./src/hermes/mmx_main.asm:75: invalid argument to [SECTION]
./src/hermes/mmx_main.asm:75: undefined symbol `.note.GNU' (first use)
./src/hermes/mmx_main.asm:75: undefined symbol `stack' (first use)
./src/hermes/mmx_main.asm:75:  (Each undefined symbol is reported only once.)
make: *** [build/mmx_main.lo] Error 1
make: *** Waiting for unfinished jobs....

!!! ERROR: media-libs/libsdl-1.2.11-r1 failed.
Call stack:
  ebuild.sh, line 1614:   Called dyn_compile
  ebuild.sh, line 971:   Called qa_call 'src_compile'
  environment, line 3613:   Called src_compile
  libsdl-1.2.11-r1.ebuild, line 160:   Called die
Comment 4 Peter Alfredsen (RETIRED) gentoo-dev 2007-03-05 12:04:21 UTC
(In reply to comment #3)
> > ln -nsf /usr/src/linux/include/asm-i386/page.h /usr/include/asm
> > 
> > enables libsdl to compile now on both installs... but is there a "real"
> > solution to this issue of does libsdl just need to fixed upstream?
> 
> This did not work for me, on ~x86 with gcc-4.1.2:
[...]
> ./src/hermes/mmx_main.asm:75: invalid argument to [SECTION]

See bug #163053

From your reports (I saw only the mmx_main error when compiling), it seems that there are two bugs with libsdl:
1)Libsdl doesn't compile with >yasm-0.4. This is being taken upstream.

2)Libsdl doesn't compile with linux-headers-2.6.20-r1. A trivial fix is probably possible here. See the patches I submitted in the blockers of bug #159304 for an idea.
Comment 5 Peter Alfredsen (RETIRED) gentoo-dev 2007-03-05 13:04:27 UTC
Could y'all please post the output of emerge -pv libsdl.
I wondered why the libsdl RPM didn't have a fix for this, since Fedora uses limited linux-headers too. It seems they don't offer all the functionality we do:
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-aalib --disable-video-directfb --disable-video-ggi --disable-video-svga
I'm trying to pin down which USE flags are including the files that fail.

These are the files that include asm/page.h:
src/video/Xext/Xxf86dga/XF86DGA.c:#include <asm/page.h>   /* PAGE_SIZE */
src/video/fbcon/SDL_fbvideo.c:#include <asm/page.h>             /* For definition of PAGE_SIZE */
src/video/ps2gs/SDL_gsyuv.c:#include <asm/page.h>               /* For definition of PAGE_SIZE */

we'll probably be able to just remove the include of asm/page.h and do:
#define PAGE_SIZE (getpagesize()) (after include <unistd.h>)
instead, since unistd.h is already included.
WARNING: HACK HACK HACK
Comment 6 Peter Alfredsen (RETIRED) gentoo-dev 2007-03-05 16:07:11 UTC
Created attachment 112174 [details, diff]
libsdl-1.2.11-no-yasm.patch

PATCH for yasm compile. Uses nasm instead. See BUG #163053.
Comment 7 Peter Alfredsen (RETIRED) gentoo-dev 2007-03-05 16:08:07 UTC
Created attachment 112175 [details, diff]
libsdl-1.2.11-pagesize.patch

PATCH for linux-headers-2.6.20-r1 compile.
Comment 8 Peter Alfredsen (RETIRED) gentoo-dev 2007-03-05 16:09:58 UTC
Created attachment 112177 [details]
libsdl-1.2.11-r1.ebuild

Ebuild for no-yasm and pagesize patch. Compiles for me. Please test. Fixes BUG #163053 (media-libs/libsdl-1.2.11-r1 mmx_main.asm:75: invalid argument to [SECTION]) also.
Comment 9 SpanKY gentoo-dev 2007-03-05 16:47:05 UTC
Comment on attachment 112174 [details, diff]
libsdl-1.2.11-no-yasm.patch

this bug has nothing to do with yasm
Comment 10 SpanKY gentoo-dev 2007-03-05 16:47:38 UTC
asm/page.h issue should be fixed in cvs
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2007-03-10 16:34:11 UTC
*** Bug 170285 has been marked as a duplicate of this bug. ***
Comment 12 Jakub Moc (RETIRED) gentoo-dev 2007-03-13 19:17:23 UTC
*** Bug 170775 has been marked as a duplicate of this bug. ***
Comment 13 Ed Catmur 2007-03-13 22:52:53 UTC
This is not fixed; reporter, please reopen.

 i686-pc-linux-gnu-gcc -march=pentium4 -mtune=pentium4 -O2 -pipe -fno-ident
-I./include -D_GNU_SOURCE=1 -fvisibility=hidden -DXTHREADS -D_REENTRANT
-DHAVE_LINUX_VERSION_H -c ./src/video/x11/SDL_x11yuv.c  -fPIC -DPIC -o
build/.libs/SDL_x11yuv.o
 i686-pc-linux-gnu-gcc -march=pentium4 -mtune=pentium4 -O2 -pipe -fno-ident
-I./include -D_GNU_SOURCE=1 -fvisibility=hidden -DXTHREADS -D_REENTRANT
-DHAVE_LINUX_VERSION_H -c ./src/video/Xext/Xxf86dga/XF86DGA.c  -fPIC -DPIC -o
build/.libs/XF86DGA.o
./src/video/Xext/Xxf86dga/XF86DGA.c:21:40: error: asm/page.h: No such file or
directory
make: *** [build/XF86DGA.lo] Error 1
make: *** Waiting for unfinished jobs....
 i686-pc-linux-gnu-gcc -march=pentium4 -mtune=pentium4 -O2 -pipe -fno-ident
-I./include -D_GNU_SOURCE=1 -fvisibility=hidden -DXTHREADS -D_REENTRANT
-DHAVE_LINUX_VERSION_H -c ./src/video/x11/SDL_x11yuv.c -o build/SDL_x11yuv.o
>/dev/null 2>&1

To make it clear: the error in the above is in XF86DGA.c, which is not touched by the patch in Gentoo CVS (files/libsdl-1.2.11-fbcon-page-header.patch).

This is presumably only compiled when USE="X", which will be why vapier didn't spot it.  It's fixed in Peter Alfredsen's patch, though, which is a little unfortunate.

I'll post a cumulative patch to use the fix in files/libsdl-1.2.11-fbcon-page-header.patch on XF86DGA.c.
Comment 14 Ed Catmur 2007-03-13 23:18:38 UTC
Created attachment 113222 [details, diff]
XF86DGA.c-page.h.patch

OK, so actually it's controlled by USE="dga".  Anyway, HAVE_GETPAGESIZE won't work because this isn't in sdl/, so this patch simply syncs that stanza to the same in x11-libs/libXxf86dga-1.0.1 (which we should really be using instead of compiling our own copy; why not?)
Comment 15 Jakub Moc (RETIRED) gentoo-dev 2007-03-13 23:54:09 UTC
Reopen.
Comment 16 SpanKY gentoo-dev 2007-03-14 00:09:55 UTC
added to cvs, cheers
Comment 17 Gunnlaugur Thor Briem 2007-04-08 14:51:19 UTC
-r1 and -r2 are still unstable on most archs, so "stable" libsdl is still broken because of asm/page.h