about summary refs log tree commit diff
path: root/tools
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2018-08-02 19:15:48 -0400
committerRich Felker <dalias@aerifal.cx>2018-08-02 19:15:48 -0400
commit7dad9c212587267818de919dd9c5886f18f99779 (patch)
treec40a9c1b374304ffb30720fa9d35a92240217d0b /tools
parent14992d4384990d40f6d3cfb799780fb696d77762 (diff)
downloadmusl-7dad9c212587267818de919dd9c5886f18f99779.tar.gz
musl-7dad9c212587267818de919dd9c5886f18f99779.tar.xz
musl-7dad9c212587267818de919dd9c5886f18f99779.zip
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')
-rw-r--r--tools/musl-gcc.specs.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/musl-gcc.specs.sh b/tools/musl-gcc.specs.sh
index 294e24f7..30492574 100644
--- a/tools/musl-gcc.specs.sh
+++ b/tools/musl-gcc.specs.sh
@@ -17,10 +17,10 @@ cat <<EOF
 libgcc.a%s %:if-exists(libgcc_eh.a%s)
 
 *startfile:
-%{!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
 
 *endfile:
-%{shared|pie:crtendS.o%s;:crtend.o%s} $libdir/crtn.o
+crtendS.o%s $libdir/crtn.o
 
 *link:
 -dynamic-linker $ldso -nostdlib %{shared:-shared} %{static:-static} %{rdynamic:-export-dynamic}