fix musl-gcc wrapper to work with -pie
authorRich Felker <dalias@aerifal.cx>
Thu, 31 May 2012 01:19:32 +0000 (21:19 -0400)
committerRich Felker <dalias@aerifal.cx>
Thu, 31 May 2012 01:19:32 +0000 (21:19 -0400)
linking the wrong crt1.o resulted in textrels and thus crashing

tools/musl-gcc.specs.sh

index 30b2676..5604685 100644 (file)
@@ -17,7 +17,7 @@ cat <<EOF
 libgcc.a%s %:if-exists(libgcc_eh.a%s)
 
 *startfile:
-%{!shared: $libdir/crt1.o} $libdir/crti.o %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}
+%{!shared: $libdir/%{pie:S}crt1.o} $libdir/crti.o %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}
 
 *endfile:
 %{shared|pie:crtendS.o%s;:crtend.o%s} $libdir/crtn.o