Fixes building for RPi using --no-undefined
authorGabriel Jacobo <gabomdq@gmail.com>
Sun, 17 Nov 2013 11:07:55 -0300
changeset 8007f4264c673a8d
parent 8006 a906369d3f8e
child 8008 5e5819ca19db
Fixes building for RPi using --no-undefined
README-raspberrypi.txt
build-scripts/raspberrypi-buildbot.sh
configure
configure.in
     1.1 --- a/README-raspberrypi.txt	Sun Nov 17 10:41:16 2013 -0300
     1.2 +++ b/README-raspberrypi.txt	Sun Nov 17 11:07:55 2013 -0300
     1.3 @@ -62,6 +62,12 @@
     1.4      sudo umount $SYSROOT/proc
     1.5      sudo umount $SYSROOT/sys
     1.6      sudo umount /mnt
     1.7 +    
     1.8 +There's one more fix required, as the libdl.so symlink uses an absolute path 
     1.9 +which doesn't quite work in our setup.
    1.10 +
    1.11 +    sudo rm -rf $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
    1.12 +    sudo ln -s ../../../lib/arm-linux-gnueabihf/libdl.so.2 $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
    1.13  
    1.14  The final step is compiling SDL itself.
    1.15  
     2.1 --- a/build-scripts/raspberrypi-buildbot.sh	Sun Nov 17 10:41:16 2013 -0300
     2.2 +++ b/build-scripts/raspberrypi-buildbot.sh	Sun Nov 17 11:07:55 2013 -0300
     2.3 @@ -39,7 +39,7 @@
     2.4  pushd $BUILDBOTDIR
     2.5  
     2.6  SYSROOT="/opt/rpi-sysroot"
     2.7 -export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux"
     2.8 +export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux -L$SYSROOT/opt/vc/lib"
     2.9  # -L$SYSROOT/usr/lib/arm-linux-gnueabihf"
    2.10  # !!! FIXME: shouldn't have to --disable-* things here.
    2.11  ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd
     3.1 --- a/configure	Sun Nov 17 10:41:16 2013 -0300
     3.2 +++ b/configure	Sun Nov 17 11:07:55 2013 -0300
     3.3 @@ -22102,11 +22102,10 @@
     3.4                  # Raspberry Pi
     3.5                  ARCH=linux
     3.6                  RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
     3.7 -                RPI_LDFLAGS="-L/opt/vc/lib -lbcm_host"
     3.8                  CFLAGS="$CFLAGS $RPI_CFLAGS"
     3.9                  SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
    3.10                  EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
    3.11 -                SDL_LIBS="$SDL_LIBS $RPI_LDFLAGS"
    3.12 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L/opt/vc/lib -lbcm_host -ldl"
    3.13  
    3.14                  if test x$enable_video = xyes; then
    3.15                      SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
     4.1 --- a/configure.in	Sun Nov 17 10:41:16 2013 -0300
     4.2 +++ b/configure.in	Sun Nov 17 11:07:55 2013 -0300
     4.3 @@ -2384,11 +2384,10 @@
     4.4                  # Raspberry Pi
     4.5                  ARCH=linux
     4.6                  RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
     4.7 -                RPI_LDFLAGS="-L/opt/vc/lib -lbcm_host"
     4.8                  CFLAGS="$CFLAGS $RPI_CFLAGS"
     4.9                  SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
    4.10                  EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
    4.11 -                SDL_LIBS="$SDL_LIBS $RPI_LDFLAGS"
    4.12 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L/opt/vc/lib -lbcm_host -ldl"
    4.13  
    4.14                  if test x$enable_video = xyes; then
    4.15                      SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"