Re: Segmentation fault in static binaries built with recent binutils

Submitted by Szabolcs Nagy on July 18, 2018, 8:24 p.m.

Details

Message ID 20180718202406.GO4418@port70.net
State New
Series "Re: Segmentation fault in static binaries built with recent binutils"
Headers show

Commit Message

Szabolcs Nagy July 18, 2018, 8:24 p.m.
* Szabolcs Nagy <nsz@port70.net> [2018-07-18 22:19:28 +0200]:
> the difference between the two cases was --build-id
> 
> --build-id=sha1 works, --build-id=none segfaults
> 

as a work around you can add build-id to the musl-gcc.specs

Patch hide | download patch | download mbox

diff --git a/tools/musl-gcc.specs.sh b/tools/musl-gcc.specs.sh
index 294e24f7..9b4aa761 100644
--- a/tools/musl-gcc.specs.sh
+++ b/tools/musl-gcc.specs.sh
@@ -23,7 +23,7 @@  libgcc.a%s %:if-exists(libgcc_eh.a%s)
 %{shared|pie:crtendS.o%s;:crtend.o%s} $libdir/crtn.o
 
 *link:
--dynamic-linker $ldso -nostdlib %{shared:-shared} %{static:-static} %{rdynamic:-export-dynamic}
+--build-id -dynamic-linker $ldso -nostdlib %{shared:-shared} %{static:-static} %{rdynamic:-export-dynamic}
 
 *esp_link: