path: root/tools
diff options
authorRich Felker <>2018-08-02 19:15:48 -0400
committerRich Felker <>2018-08-02 19:15:48 -0400
commit7dad9c212587267818de919dd9c5886f18f99779 (patch)
treec40a9c1b374304ffb30720fa9d35a92240217d0b /tools
parent14992d4384990d40f6d3cfb799780fb696d77762 (diff)
fix musl-gcc wrapper to be compatible with default-pie gcc toolchains
the specfile for the wrapper was written assuming output is pie only if -pie appears on the command line. recent (and older patched) versions of gcc can be configured to produce pie output by default, adn when used with such a toolchain, the wrapper linked the wrong startfiles (crt*) containing pic-incompatible code. rather than trying to figure out gcc's default, simply always use the pic-compatible start files.
Diffstat (limited to 'tools')
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/ b/tools/
index 294e24f7..30492574 100644
--- a/tools/
+++ b/tools/
@@ -17,10 +17,10 @@ cat <<EOF
libgcc.a%s %:if-exists(libgcc_eh.a%s)
-%{!shared: $libdir/%{pie:S}crt1.o} $libdir/crti.o %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}
+%{!shared: $libdir/Scrt1.o} $libdir/crti.o crtbeginS.o%s
-%{shared|pie:crtendS.o%s;:crtend.o%s} $libdir/crtn.o
+crtendS.o%s $libdir/crtn.o
-dynamic-linker $ldso -nostdlib %{shared:-shared} %{static:-static} %{rdynamic:-export-dynamic}