use -L/...../ -lgcc instead of /...../libgcc.a in musl-gcc wrapper
authorRich Felker <dalias@aerifal.cx>
Tue, 1 Mar 2011 17:04:36 +0000 (12:04 -0500)
committerRich Felker <dalias@aerifal.cx>
Tue, 1 Mar 2011 17:04:36 +0000 (12:04 -0500)
this should avoid warnings about unused libs when not linking, and
might fix some other obscure issues too. i might replace this approach
with a completely different one soon though.

tools/gen-musl-gcc.sh

index 89f7f4d98e4965d70fc71194679ed674894ca542..bf20c1f63ce1d19b68e67faec90f05a8cb0bbd7c 100644 (file)
@@ -11,6 +11,7 @@ libc_end="$libc_lib/crtn.o"
 
 gcc_inc=$libc_inc
 libgcc="`gcc \"$@\" -print-file-name=libgcc.a`"
+libgcc=${libgcc%libgcc.a}
 
 gcc -wrapper sh,-c,'
 x= ; y= ; z= ; s= ; for i ; do
@@ -26,5 +27,5 @@ done
 exec "$0" "$@"
 ' -std=gnu99 -nostdinc -nostdlib \
   -isystem "$libc_inc" -isystem "$gcc_inc" \
-  -Wl,-xxxxxx "$@" -L"$libc_lib" -lc "$libgcc" -Lxxxxxx -Wl,-nostdlib
+  -Wl,-xxxxxx "$@" -L"$libc_lib" -lc -L"$libgcc" -lgcc -Lxxxxxx -Wl,-nostdlib
 EOF