diff options
Diffstat (limited to 'libc-top-half/musl/tools/ld.musl-clang.in')
-rw-r--r-- | libc-top-half/musl/tools/ld.musl-clang.in | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/libc-top-half/musl/tools/ld.musl-clang.in b/libc-top-half/musl/tools/ld.musl-clang.in new file mode 100644 index 0000000..93763d6 --- /dev/null +++ b/libc-top-half/musl/tools/ld.musl-clang.in @@ -0,0 +1,51 @@ +#!/bin/sh +cc="@CC@" +libc_lib="@LIBDIR@" +ldso="@LDSO@" +cleared= +shared= +userlinkdir= +userlink= + +for x ; do + test "$cleared" || set -- ; cleared=1 + + case "$x" in + -L-user-start) + userlinkdir=1 + ;; + -L-user-end) + userlinkdir= + ;; + -L*) + test "$userlinkdir" && set -- "$@" "$x" + ;; + -l-user-start) + userlink=1 + ;; + -l-user-end) + userlink= + ;; + crtbegin*.o|crtend*.o) + set -- "$@" $($cc -print-file-name=$x) + ;; + -lgcc|-lgcc_eh) + file=lib${x#-l}.a + set -- "$@" $($cc -print-file-name=$file) + ;; + -l*) + test "$userlink" && set -- "$@" "$x" + ;; + -shared) + shared=1 + set -- "$@" -shared + ;; + -sysroot=*|--sysroot=*) + ;; + *) + set -- "$@" "$x" + ;; + esac +done + +exec $($cc -print-prog-name=ld) -nostdlib "$@" -lc -dynamic-linker "$ldso" |