Back to home page

LXR

 
 

    


0001 #!/bin/sh
0002 # run gcc with ld options
0003 # used as a wrapper to execute link time optimizations
0004 # yes virginia, this is not pretty
0005 
0006 ARGS="-nostdlib"
0007 
0008 while [ "$1" != "" ] ; do
0009         case "$1" in
0010         -save-temps|-m32|-m64) N="$1" ;;
0011         -r) N="$1" ;;
0012         -[Wg]*) N="$1" ;;
0013         -[olv]|-[Ofd]*|-nostdlib) N="$1" ;;
0014         --end-group|--start-group)
0015                  N="-Wl,$1" ;;
0016         -[RTFGhIezcbyYu]*|\
0017 --script|--defsym|-init|-Map|--oformat|-rpath|\
0018 -rpath-link|--sort-section|--section-start|-Tbss|-Tdata|-Ttext|\
0019 --version-script|--dynamic-list|--version-exports-symbol|--wrap|-m)
0020                 A="$1" ; shift ; N="-Wl,$A,$1" ;;
0021         -[m]*) N="$1" ;;
0022         -*) N="-Wl,$1" ;;
0023         *)  N="$1" ;;
0024         esac
0025         ARGS="$ARGS $N"
0026         shift
0027 done
0028 
0029 exec $CC $ARGS