summaryrefslogtreecommitdiff
path: root/ld-gnu-to-sun
blob: aae278c2327a1587b7a86f90fa16c1d47069f6af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

set -e
set -u

cmd=/usr/bin/sunld

while [ $# -ne 0 ]; do
    case "$1" in
        # GCC with GNU ld passes -m <emulation>,
        # Sun ld does not need it, and -m options has different meaning:
        -m) shift || true;;

        # ignore all plugins (gcc >= 4.9)
        -plugin) shift || true;;
        -plugin-opt=*);;

        # Ignore long options, Sun ld does not support long options at all:
        --*) ;;

        *) cmd="$cmd $1" ;;
    esac
    shift || true
done

# Trace:
set -x
exec $cmd

exit 0