strip_fPIC.sh
author Ryan C. Gordon <icculus@icculus.org>
Mon, 12 Dec 2005 09:13:12 +0000
changeset 1199 2d6dc7de1145
parent 22 48c34d68918e
permissions -rwxr-xr-x
From: Mike Frysinger <vapier@gentoo.org>
To: sdl@libsdl.org
Date: Sun, 11 Dec 2005 22:57:37 -0500
Subject: [SDL] exec stack in libsdl update

i posted back in September a patch to remove executable stacks:
http://www.devolution.com/pipermail/sdl/2005-September/070626.html

later in November, a similar patch was merged it seems:
http://www.libsdl.org/cgi/cvsweb.cgi/SDL12/src/hermes/mmx_main.asm

however, this lacks the additional output format checks that i posted in my
patch ... this isnt a problem if the hermes asm code is only ever used to
produce ELF objects, but if this is not true, then the additional checks in
my original patch will need to be merged
-mike
slouken@0
     1
#!/bin/sh
slouken@0
     2
#
slouken@0
     3
# libtool assumes that the compiler can handle the -fPIC flag
slouken@0
     4
# This isn't always true (for example, nasm can't handle it)
slouken@0
     5
command=""
slouken@1
     6
while [ $# -gt 0 ]; do
slouken@22
     7
    case "$1" in
slouken@22
     8
        -?PIC)
slouken@22
     9
            # Ignore -fPIC and -DPIC options
slouken@22
    10
            ;;
slouken@22
    11
        *)
slouken@0
    12
            command="$command $1"
slouken@22
    13
            ;;
slouken@22
    14
    esac
slouken@0
    15
    shift
slouken@0
    16
done
slouken@0
    17
echo $command
slouken@0
    18
exec $command