mirror of
git://git.musl-libc.org/musl
synced 2024-12-17 04:05:05 +00:00
7dad9c2125
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.
38 lines
564 B
Bash
38 lines
564 B
Bash
incdir=$1
|
|
libdir=$2
|
|
ldso=$3
|
|
cat <<EOF
|
|
%rename cpp_options old_cpp_options
|
|
|
|
*cpp_options:
|
|
-nostdinc -isystem $incdir -isystem include%s %(old_cpp_options)
|
|
|
|
*cc1:
|
|
%(cc1_cpu) -nostdinc -isystem $incdir -isystem include%s
|
|
|
|
*link_libgcc:
|
|
-L$libdir -L .%s
|
|
|
|
*libgcc:
|
|
libgcc.a%s %:if-exists(libgcc_eh.a%s)
|
|
|
|
*startfile:
|
|
%{!shared: $libdir/Scrt1.o} $libdir/crti.o crtbeginS.o%s
|
|
|
|
*endfile:
|
|
crtendS.o%s $libdir/crtn.o
|
|
|
|
*link:
|
|
-dynamic-linker $ldso -nostdlib %{shared:-shared} %{static:-static} %{rdynamic:-export-dynamic}
|
|
|
|
*esp_link:
|
|
|
|
|
|
*esp_options:
|
|
|
|
|
|
*esp_cpp_options:
|
|
|
|
|
|
EOF
|