[MPlayer-users] Errors Compiling on PS3

Larry Reznick lreznick at idistream.com
Thu Jan 4 18:59:24 CET 2007


I'm trying to adapt MPlayer to run on a Fedora Core 5 installation on a 
Playstation 3:

# uname -a
Linux ps3.idistream.com 2.6.16 #1 SMP Wed Nov 8 07:25:31 JST 2006 ppc64 
ppc64 ppc64 GNU/Linux


I downloaded the latest SVN as of yesterday (2007-01-03):

# cat version.h
#define VERSION "dev-SVN-r21812-3.2.3"
#define MP_TITLE "MPlayer dev-SVN-r21812-3.2.3 (C) 2000-2006 MPlayer Team"


I also installed the PPC versions of the codecs from 
all-ppc-20061022.tar.bz2. Furthermore, I renamed the compiler links as 
follows:

# ls -oh /usr/bin/gcc* /usr/bin/g++*
lrwxrwxrwx 1 root   14 Jan  4 09:10 /usr/bin/g++ -> /usr/bin/g++32
-rwxr-xr-x 3 root 110K Feb 11  2006 /usr/bin/g++32
-rwxr-xr-x 4 root 158K Mar  9  2006 /usr/bin/g++41
lrwxrwxrwx 1 root   14 Jan  3 13:32 /usr/bin/gcc -> /usr/bin/gcc32
-rwxr-xr-x 3 root 109K Feb 11  2006 /usr/bin/gcc32
-rwxr-xr-x 3 root 156K Mar  9  2006 /usr/bin/gcc41
-rwxr-xr-x 1 root 2.0K Mar  6  2006 /usr/bin/gccmakedep


The libc it uses is as follows:

# ls -oh /lib/libc[.-]*
-rwxr-xr-x 1 root 1.7M Mar  7  2006 /lib/libc-2.4.so
lrwxrwxrwx 1 root   11 Dec 29 11:57 /lib/libc.so.6 -> libc-2.4.so


The binutils version is as follows:

# as --version
GNU assembler 2.16.91.0.6 20060212
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `ppc-redhat-linux'.


After a "make distclean", running configure gives the following output:

# ./configure --enable-gui --enable-largefiles
Detected operating system: Linux
Detected host architecture: ppc
Checking for cc version ... 3.2.3, ok
Checking for host cc ... cc
Checking for cross compilation ... no
Checking for CPU type ... Cell Broadband Engine altivec
Checking for GCC & CPU optimization abilities ... none
Checking for assembler support of -pipe option ... yes
Checking for compiler support of named assembler arguments ... yes
Checking for .align is a power of two ... yes
Checking for GCC altivec support ... FSF-style (-maltivec -mabi=altivec)
Checking for altivec.h ... yes
Checking for awk ... gawk
Checking for extra headers ... none
Checking for extra libs ... none
Checking for -lposix ... no
Checking for -lm ... yes
Checking for langinfo ... yes
Checking for language ... using en (man pages: en )
Checking for enable sighandler ... yes
Checking for runtime cpudetection ... no
Checking for restrict keyword ... __restrict
Checking for __builtin_expect ... yes
Checking for kstat ... no
Checking for posix4 ... no
Checking for lrintf ... yes
Checking for round ... yes
Checking for nanosleep ... yes
Checking for socklib ... yes
Checking for inet_pton() ... yes (using )
Checking for inttypes.h (required) ... yes
Checking for int_fastXY_t in inttypes.h ... yes
Checking for word size ... 32
Checking for stddef.h ... yes
Checking for malloc.h ... yes
Checking for memalign() ... yes
Checking for alloca.h ... yes
Checking for mman.h ... yes
Checking for dynamic loader ... yes
Checking for dynamic a/v plugins support ... no
Checking for pthread ... yes (using -lpthread)
Checking for rpath ... no
Checking for iconv ... yes
Checking for sys/soundcard.h ... yes
Checking for sys/dvdio.h ... no
Checking for sys/cdio.h ... no
Checking for linux/cdrom.h ... yes
Checking for dvd.h ... no
Checking for termcap ... yes (using -lncurses)
Checking for termios ... yes (using sys/termios.h)
Checking for shm ... yes
Checking for linux devfs ... no
Checking for scandir() ... yes
Checking for strsep() ... yes
Checking for strlcpy() ... no
Checking for strlcat() ... no
Checking for fseeko() ... yes
Checking for localtime_r() ... yes
Checking for vsscanf() ... yes
Checking for swab() ... yes
Checking for POSIX select() ... yes
Checking for gettimeofday() ... yes
Checking for glob() ... yes
Checking for setenv() ... yes
Checking for sys/sysinfo.h ... yes
Checking for pkg-config ... yes
Checking for Samba support (libsmbclient) ... yes
Checking for 3dfx ... no
Checking for tdfxfb ... no
Checking for s3fb ... no
Checking for tdfxvid ... no
Checking for tga ... yes
Checking for DirectFB ... no
Checking for X11 headers presence ... yes (using /usr/include)
Checking for X11 ... yes
Checking for DPMS ... yes (using Xdpms 4)
Checking for Xv ... yes
Checking for XvMC ... no
Checking for Xinerama ... yes
Checking for Xxf86vm ... yes
Checking for XF86keysym ... yes
Checking for DGA ... 2 (using DGA 2.0)
Checking for OpenGL ... yes
Checking for /dev/mga_vid ... no
Checking for xmga ... no
Checking for GGI ... no
Checking for GGI extension: libggiwmh ... no
Checking for AA ... no
Checking for CACA ... no
Checking for SVGAlib ... no
Checking for FBDev ... yes
Checking for DVB ... no
Checking for DVB HEAD ... yes
Checking for PNG support ... yes
Checking for JPEG support ... yes
Checking for PNM support ... yes
Checking for GIF support ... no
Checking for VESA support ... no
Checking for SDL ... yes (using sdl-config)
Checking for NAS ... no
Checking for DXR2 ... no
Checking for DXR3/H+ ... no
Checking for IVTV TV-Out ... no
Checking for OSS Audio ... yes
Checking for aRts ... yes
Checking for EsounD ... yes
Checking for esd_get_latency() ... yes
Checking for Polyp ... no
Checking for JACK ... no
Checking for OpenAL ... no
Checking for ALSA audio ... yes (using alsa 1.0.x and alsa/asoundlib.h)
Checking for Sun audio ... no
Checking for VCD support ... yes
Checking for DVD support (libdvdnav) ... no
Checking for dvdread ... yes (internal)
Checking for internal libdvdcss ... yes
Checking for cdparanoia ... no
Checking for libcdio ... no
Checking for bitmap font support ... yes
Checking for freetype >= 2.0.9 ... yes
Checking for fontconfig ... yes
Checking for SSA/ASS support ... yes
Checking for fribidi with charsets ... no
Checking for ENCA ... no
Checking for zlib ... yes
Checking for RTC ... no
Checking for external liblzo support ... no
Checking for mad support ... no
Checking for Toolame ... no
Checking for Twolame ... no
Checking for OggVorbis support ... yes (internal Tremor)
Checking for libspeex (version >= 1.1 required) ... no
Checking for OggTheora support ... no
Checking for mp3lib support ... yes
Checking for liba52 support ... yes
Checking for libdts support ... no
Checking for libmpeg2 support ... yes
Checking for libmpcdec (musepack, version >= 1.2.1 required) ... no
Checking for FAAC (AAC encoder) support ... no (in libavcodec: )
Checking for FAAD2 (AAC) support ... yes (internal floating-point)
Checking for LADSPA plugin support ... no
Checking for Win32 codecs ... no
Checking for XAnim codecs ... yes (using /usr/local/lib/codecs)
Checking for RealPlayer codecs ... yes (using /usr/local/lib/codecs)
Checking for LIVE555 Streaming Media libraries ... no
Checking for FFmpeg libavutil (static) ... yes
Checking for FFmpeg libavcodec (static) ... yes
Checking for FFmpeg libavformat (static) ... yes
Checking for FFmpeg libpostproc (static) ... yes
Checking for md5sum support ... yes
Checking for AMR narrowband ... no
Checking for AMR narrowband, fixed point ... no
Checking for AMR wideband ... no
Checking for libdv-0.9.5+ ... no
Checking for zr ... no
Checking for bl ... no
Checking for XviD ... no
Checking for x264 ... no (in libavcodec: no)
Checking for nut ... no
Checking for libmp3lame (for mencoder) ... no
Checking for mencoder ... yes
Checking for fastmemcpy ... yes
Checking for UniquE RAR File Library ... yes
Checking for TV interface ... yes
Checking for Video 4 Linux TV interface ... yes
Checking for Video 4 Linux 2 TV interface ... yes
Checking for Radio interface ... no
Checking for Capture for Radio interface ... no
Checking for Video 4 Linux 2 Radio interface ... no
Checking for Video 4 Linux Radio interface ... no
Checking for Video 4 Linux 2 MPEG PVR interface ... no
Checking for audio select() ... yes
Checking for network ... yes
Checking for ftp ... yes
Checking for vstream client ... no
Checking for byte order ... big-endian
Checking for OSD menu ... no
Checking for QuickTime codecs ... auto
Checking for Subtitles sorting ... yes
Checking for XMMS inputplugin support ... no
Checking for inet6 ... yes
Checking for gethostbyname2 ... yes
Checking for GUI ... yes
Checking for XShape extension ... yes
Checking for GTK+ version ... 2.8.15
Checking for glib version ... 2.10.1
Checking for automatic gdb attach ... no
Checking for compiler support for noexecstack ... yes
Checking for ftello() ... yes
Checking for VIDIX (internal) ... yes
Checking for VIDIX (external) ... no
Checking for joystick ... no
Checking for lirc ... no
Checking for lircc ... no
Checking for color console output ... no
Creating config.mak
Creating config.h

Config files successfully generated by ./configure !

  Install prefix: /usr/local
  Data directory: /usr/local/share/mplayer
  Config direct.: /usr/local/etc/mplayer

  Byte order: big-endian
  Optimizing for:  altivec

  Languages:
    Messages/GUI: en
    Manual pages: en

  Enabled optional drivers:
    Input: ftp network tv-v4l2 tv-v4l tv libdvdcss dvdread vcd dvb smb
    Codecs: libavcodec real xanim faad2 libmpeg2 liba52 mp3lib 
tremor(internal)
    Audio output: alsa esd arts oss sdl mpegpes(dvb)
    Video output: xvidix cvidix md5sum sdl pnm jpeg png mpegpes(dvb) 
fbdev opengl dga xv x11 xover tga
    Audio filters:
  Disabled optional drivers:
    Input: vstream pvr radio live555 cddb cdda dvdnav
    Codecs: qtx x264 xvid libdv amr_wb amr_nb win32 faac musepack libdts 
libtheora speex twolame toolame libmad liblzo gif
    Audio output: sun openal jack polyp ivtv dxr2 nas
    Video output: winvidix bl zr zr2 ivtv dxr3 dxr2 vesa gif89a svga 
caca aa ggi xmga mga xvmc dfbmga directfb tdfx_vid s3fb tdfxfb 3dfx
    Audio filters: ladspa

'config.h' and 'config.mak' contain your configuration options.
Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
      compile *** DO NOT REPORT BUGS if you tweak these files ***

'make' will now compile MPlayer and 'make install' will install it.
Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.

NOTE: Win32 codec DLLs are not supported on your CPU (ppc) or your
operating system (Linux). You may encounter a few files that cannot
be played due to missing open source video/audio codec support.

Check configure.log if you wonder why an autodetection failed (make sure
development headers/packages are installed).

NOTE: The --enable-* parameters unconditionally force options on, completely
skipping autodetection. This behavior is unlike what you may be used to from
autoconf-based configure scripts that can decide to override you. This 
greater
level of control comes at a price. You may have to provide the correct 
compiler
and linker flags yourself.
If you used one of these options (except --enable-gui and similar ones that
turn on internal features) and experience a compilation or linking failure,
make sure you have passed the necessary compiler/linker flags to configure.

If you suspect a bug, please read DOCS/HTML/en/bugreports.html.


I can deliver the config.h & config.mak files if you think you need to 
see them.

On compiling, it gets through several files without trouble. Once it 
gets to libdha, I get numerous errors in pci.c. Here is the output 
relevant to pci.c:

cc -c -fPIC -I. -I.. -Wdeclaration-after-statement -O4   -pipe 
-ffast-math -fomit-frame-pointer -maltivec -mabi=altivec -D_REENTRANT 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE 
-I/usr/include  -I/usr/include/SDL -D_REENTRANT -I/usr/include/kde/artsc 
-pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  
-I/usr/include/freetype2 -I/usr/include/gtk-2.0 
-I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo 
-I/usr/include/pango-1.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include   -o pci.o pci.c
In file included from /usr/include/linux/pci.h:20,
                 from sysdep/pci_linux.c:134,
                 from pci.c:64:
/usr/include/linux/mod_devicetable.h:18: syntax error before "__u32"
/usr/include/linux/mod_devicetable.h:20: syntax error before "class"
/usr/include/linux/mod_devicetable.h:21: syntax error before "driver_data"
/usr/include/linux/mod_devicetable.h:31: syntax error before "__u32"
/usr/include/linux/mod_devicetable.h:33: syntax error before "model_id"
/usr/include/linux/mod_devicetable.h:34: syntax error before "specifier_id"
/usr/include/linux/mod_devicetable.h:35: syntax error before "version"
/usr/include/linux/mod_devicetable.h:36: syntax error before "driver_data"
/usr/include/linux/mod_devicetable.h:37: `kernel_ulong_t' undeclared 
here (not in a function)
/usr/include/linux/mod_devicetable.h:38: syntax error before '}' token
/usr/include/linux/mod_devicetable.h:100: syntax error before "__u16"
/usr/include/linux/mod_devicetable.h:104: syntax error before "idProduct"
/usr/include/linux/mod_devicetable.h:105: syntax error before "bcdDevice_lo"
/usr/include/linux/mod_devicetable.h:106: syntax error before "bcdDevice_hi"
/usr/include/linux/mod_devicetable.h:109: syntax error before "bDeviceClass"
/usr/include/linux/mod_devicetable.h:110: syntax error before 
"bDeviceSubClass"
/usr/include/linux/mod_devicetable.h:111: syntax error before 
"bDeviceProtocol"
/usr/include/linux/mod_devicetable.h:114: syntax error before 
"bInterfaceClass"
/usr/include/linux/mod_devicetable.h:115: syntax error before 
"bInterfaceSubClass"
/usr/include/linux/mod_devicetable.h:116: syntax error before 
"bInterfaceProtocol"
/usr/include/linux/mod_devicetable.h:119: syntax error before "driver_info"
/usr/include/linux/mod_devicetable.h:136: syntax error before "__u16"
/usr/include/linux/mod_devicetable.h:139: syntax error before "dev_type"
/usr/include/linux/mod_devicetable.h:140: syntax error before "cu_model"
/usr/include/linux/mod_devicetable.h:141: syntax error before "dev_model"
/usr/include/linux/mod_devicetable.h:143: syntax error before "driver_info"
/usr/include/linux/mod_devicetable.h:156: syntax error before "__u8"
/usr/include/linux/mod_devicetable.h:161: syntax error before "__u8"
/usr/include/linux/mod_devicetable.h:164: syntax error before "__u8"
/usr/include/linux/mod_devicetable.h:166: syntax error before '}' token
/usr/include/linux/mod_devicetable.h:172: syntax error before "__u8"
/usr/include/linux/mod_devicetable.h:174: syntax error before "id"
/usr/include/linux/mod_devicetable.h:175: syntax error before "proto"
/usr/include/linux/mod_devicetable.h:189: syntax error before 
"kernel_ulong_t"
/usr/include/linux/mod_devicetable.h:202: syntax error before "__u16"
/usr/include/linux/mod_devicetable.h:205: syntax error before "card_id"
/usr/include/linux/mod_devicetable.h:207: syntax error before "func_id"
/usr/include/linux/mod_devicetable.h:210: syntax error before "function"
/usr/include/linux/mod_devicetable.h:213: syntax error before "device_no"
/usr/include/linux/mod_devicetable.h:215: syntax error before "prod_id_hash"
/usr/include/linux/mod_devicetable.h:216: `__u32' undeclared here (not 
in a function)
/usr/include/linux/mod_devicetable.h:222: syntax error before "prod_id"
/usr/include/linux/mod_devicetable.h:223: `kernel_ulong_t' undeclared 
here (not
in a function)
/usr/include/linux/mod_devicetable.h:227: syntax error before "driver_info"
/usr/include/linux/mod_devicetable.h:231: syntax error before "cisfile"
/usr/include/linux/mod_devicetable.h:249: syntax error before "__u16"
make[1]: *** [pci.o] Error 1
make[1]: Leaving directory `/root/download/tarfiles/mplayer/libdha'
make: *** [libdha/libdha.so] Error 2


The __u32 problem appears because in the 
/usr/include/linux/mod_devicetable.h is the definition of struct 
pci_device_id, which contains an expectation that __KERNEL__ is defined 
to include <linux/types.h>, which contains the definition of __u32 and 
other relevant types used in mod_devicetable.h, and, in that same 
__KERNEL__ section is the definition of kernel_ulong_t, also used by 
struct pci_device_id.

To see whether this was the only problem, I forced a #define of 
__KERNEL__ into libdha/pci.c just prior to the #include 
"sysdep/pci_linux.c" and then recompiled. This delivered an even larger 
set of errors, from which I extract the leading subset below:

# time make
make -C libvo libvo.a
make[1]: Entering directory `/root/download/tarfiles/mplayer/libvo'
make[1]: `libvo.a' is up to date.
make[1]: Leaving directory `/root/download/tarfiles/mplayer/libvo'
make -C libao2
make[1]: Entering directory `/root/download/tarfiles/mplayer/libao2'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/download/tarfiles/mplayer/libao2'
make -C input
make[1]: Entering directory `/root/download/tarfiles/mplayer/input'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/download/tarfiles/mplayer/input'
make -C libdha
make[1]: Entering directory `/root/download/tarfiles/mplayer/libdha'
cc -c -fPIC -I. -I.. -Wdeclaration-after-statement -O4   -pipe 
-ffast-math -fomit-frame-pointer -maltivec -mabi=altivec -D_REENTRANT 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE 
-I/usr/include  -I/usr/include/SDL -D_REENTRANT -I/usr/include/kde/artsc 
-pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  
-I/usr/include/freetype2 -I/usr/include/gtk-2.0 
-I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo 
-I/usr/include/pango-1.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include   -o pci.o pci.c
In file included from /usr/include/asm/paca.h:22,
                 from /usr/include/asm/spinlock.h:23,
                 from /usr/include/linux/spinlock.h:87,
                 from /usr/include/linux/kobject.h:23,
                 from /usr/include/linux/device.h:16,
                 from /usr/include/linux/pci.h:54,
                 from sysdep/pci_linux.c:134,
                 from pci.c:65:
/usr/include/asm/mmu.h: In function `get_kernel_vsid':
/usr/include/asm/mmu.h:392: `SID_SHIFT' undeclared (first use in this 
function)
/usr/include/asm/mmu.h:392: (Each undeclared identifier is reported only 
once
/usr/include/asm/mmu.h:392: for each function it appears in.)
/usr/include/asm/mmu.h: In function `get_vsid':
/usr/include/asm/mmu.h:399: `SID_SHIFT' undeclared (first use in this 
function)
In file included from /usr/include/linux/timex.h:58,
                 from /usr/include/linux/sched.h:11,
                 from /usr/include/linux/module.h:10,
                 from /usr/include/linux/device.h:20,
                 from /usr/include/linux/pci.h:54,
                 from sysdep/pci_linux.c:134,
                 from pci.c:65:
/usr/include/linux/time.h: At top level:
/usr/include/linux/time.h:12: redefinition of `struct timespec'
/usr/include/linux/time.h:18: redefinition of `struct timeval'
In file included from /usr/include/asm/div64.h:1,
                 from /usr/include/linux/calc64.h:5,
                 from /usr/include/linux/jiffies.h:4,
                 from /usr/include/linux/sched.h:12,
                 from /usr/include/linux/module.h:10,
                 from /usr/include/linux/device.h:20,
                 from /usr/include/linux/pci.h:54,
                 from sysdep/pci_linux.c:134,
                 from pci.c:65:
/usr/include/asm-generic/div64.h:35: syntax error before "__div64_32"
/usr/include/asm-generic/div64.h:35: syntax error before '*' token
In file included from /usr/include/linux/jiffies.h:4,
                 from /usr/include/linux/sched.h:12,
                 from /usr/include/linux/module.h:10,
                 from /usr/include/linux/device.h:20,
                 from /usr/include/linux/pci.h:54,
                 from sysdep/pci_linux.c:134,
                 from pci.c:65:
/usr/include/linux/calc64.h: In function `do_div_llr':
/usr/include/linux/calc64.h:25: `uint32_t' undeclared (first use in this 
function)
/usr/include/linux/calc64.h:25: syntax error before "__base"
/usr/include/linux/calc64.h:25: `uint64_t' undeclared (first use in this 
function)
/usr/include/linux/calc64.h:25: syntax error before ')' token
/usr/include/linux/calc64.h:25: `__rem' undeclared (first use in this 
function)
/usr/include/linux/calc64.h:25: `__base' undeclared (first use in this 
function)In file included from /usr/include/linux/sched.h:12,
                 from /usr/include/linux/module.h:10,
                 from /usr/include/linux/device.h:20,
                 from /usr/include/linux/pci.h:54,
                 from sysdep/pci_linux.c:134,
                 from pci.c:65:
/usr/include/linux/jiffies.h: At top level:
/usr/include/linux/jiffies.h:377: syntax error before "jiffies_to_clock_t"
/usr/include/linux/jiffies.h: In function `jiffies_to_clock_t':
/usr/include/linux/jiffies.h:383: `uint32_t' undeclared (first use in 
this function)
/usr/include/linux/jiffies.h:383: syntax error before "__base"
/usr/include/linux/jiffies.h:383: `uint64_t' undeclared (first use in 
this function)


Each one of these problems that I attack leads to some problems 
disappearing, but the problems continue like this. ("...a maze of twisty 
passages, all alike.") I have avoided changing any system file; only 
temporarily changing pci.c. Somehow, some definitions aren't set right 
or something else is wrong such that necessary files aren't getting 
included. Keep in mind that the first change was to set a __KERNEL__ 
definition before including a kernel-oriented header file. Other 
modifications I tried were similar in that I had to define a name or 
forcibly include a header to trigger definitions that would resolve one 
or more of these errors -- files or definitions that probably should 
have been included as a matter of course.

Can you give me any hints what might be done to correct these compiling 
problems?


Thanks.

--Larry




More information about the MPlayer-users mailing list