提交 7dad9c21 编写于 作者: R Rich Felker

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.
上级 14992d43
......@@ -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}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册