From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14153 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ferdi265 Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] fix musl-gcc.specs.sh to correctly handle -static-pie Date: Tue, 28 May 2019 22:19:18 +0200 Message-ID: <9ea47b05-2298-dc48-d938-f1593c1d0d3c@gmail.com> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="90V2U1OkMxJs2flZT31dIkWMVvn9snZxY" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="149350"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 To: musl@lists.openwall.com Original-X-From: musl-return-14169-gllmg-musl=m.gmane.org@lists.openwall.com Tue May 28 22:20:27 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1hViaA-000ceR-Uf for gllmg-musl@m.gmane.org; Tue, 28 May 2019 22:20:27 +0200 Original-Received: (qmail 32242 invoked by uid 550); 28 May 2019 20:20:23 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 31903 invoked from network); 28 May 2019 20:19:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:openpgp:autocrypt:subject:message-id:date:user-agent :mime-version; bh=//isX/VjSFiEo5xhWyB5MrpISWypKzQDwv+NkElgnlk=; b=TLBSIk5+RZ8e/JO84MT9QhNwUbb3cbp+iw9iOOSjYEsl0Z8m1Uc9PP60JTZCY47juz qpb2/oI6fYZ0KBd4lvjYWE8bSNYtTZRZ/SJGtNkS2oa1usfmo4Y8awrfU24surDwyWqi HAtzLeHx3GFDVpx/SCU+qpCFz7CA6FKX9NPzf5kGhD4a/3JmXUJhHTFUs15UX1wmhpa8 dBB8NdUkd+Q1UxtRVhMcMLu8T8OpIn6oD+eYrdyTuhNWMLrEdb0hSMMkqnT1bGynalYx M3P0FKl9tg/VgiIBqunz29GDCNd2xZomQ46IUSR46/tK082vbbXd4CpagOmQkgs/33O7 WBTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:openpgp:autocrypt:subject:message-id :date:user-agent:mime-version; bh=//isX/VjSFiEo5xhWyB5MrpISWypKzQDwv+NkElgnlk=; b=B1/8oXiCsNwEB1pqenZiIzETkrbJYFSrJW+tecl5oHC1Rq4iCvA+43Y2VW59buJ+9q uCD/3eJSzrLtJialRnCiPMFlTumfF87CcNsXS83j1Hbu5dMYJ8Oc8wEUpUpe5zU2GDfO NkA7mMj92GV8Z5H5My9AOMMBo5zOqPedcDBKz+3GLeIOiV9cLt1e5QuXjWtJTjIIoHHE ynPNyr1oZyF900VwzTppX1Kz1v3tvDtY17XsXT8Nqd3Pkn33Mp0pvpgSyMps6SDFh5+5 EGgvel5I3yIVi0CgNNN5jtpGSrI8hoHP2pfHVHxhQztUMKrnhK8Hv5u3i13z5CQsUSxG QMEA== X-Gm-Message-State: APjAAAWUFYFkVzKUhEWS+kD9wDdTt1u3Hfn9S0B3ZZqgqUHkktG37vgw rPc+kVt9BRi4BsC8+XA19S2zSPWwbjA= X-Google-Smtp-Source: APXvYqyC6kMF5bYHy20C8MdeqmJsXcKo0YTY/eqiEVoKQveOTNS/jm2MeqGNABGrSh/P8lBShxqJrA== X-Received: by 2002:a5d:688b:: with SMTP id h11mr15256715wru.99.1559074764340; Tue, 28 May 2019 13:19:24 -0700 (PDT) Openpgp: preference=signencrypt Autocrypt: addr=theferdi265@gmail.com; prefer-encrypt=mutual; keydata= mQINBFSdNAkBEADNFpZVS6YaOHTHnynFMiO13rs64O/gJBqfB93Hqe3tvg7ayuHvhkjzIgD+ 1NGeqdpndKdpaoVphCy503gh1fcRMAdM2KS4UXPw67zcKOQ29w3ZXz4xn3bHENp6pGdSqrS7 wqrNjkSXPagW9uO3okaYCZCOrDPaev8XKFfjDdcrIw8gA4CBhOhJLvP/6dLSkNrepzQXLhxW 0GerCNbI5SKVjf0muJewj+KUhuBBq3bNgDVpDZRWDfCVCNdD7xz0S0FXd3Tp+3u3WwGvSJhD PnGis3Zdc6bD1aMNhfwussow5+txDfqjhYxli09uo4JUoBC2Ey2OAxdN4l3u6FXTinjnGLUQ 9EB+yNHomUJqBd2s/BCAupW7owAB0I6/9btxWLSxUA0aWwiWVApfHxdn3l2WZqiKYDMw/Zb/ +j3nLNhiLUaFX8Qhd9OoalMGhtNcTTmuDdn0DEazY+GB8QrUfn6rxguP2VI7BT59rfjhgumc Zh1kEeKZm/75xilofVXVB9+EtBjTQWkvaa6ki0MwzD96DFJnwU8WqbeMQ0jMboXHR85Rm7eK Q1XiZmPF2VJ4kQQAvmueR747WBELTuVzsxf4G2VTwucRhk3uN/UPqLJ3cKc4kgXl4MDQWqsQ dI6Zs3U53lr052eyeTmmtDF47gwh+XN6EEeJmGTjafFNzVytEwARAQABtCBGZXJkaTI2NSA8 dGhlZmVyZGkyNjVAZ21haWwuY29tPokCOAQTAQIAIgUCVJ00CQIbIwYLCQgHAwIGFQgCCQoL BBYCAwECHgECF4 Xref: news.gmane.org gmane.linux.lib.musl.general:14153 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --90V2U1OkMxJs2flZT31dIkWMVvn9snZxY Content-Type: multipart/mixed; boundary="gXHryyFIfferVHUqQENrx6cCEKF0hjTG6"; protected-headers="v1" From: Ferdi265 To: musl@lists.openwall.com Message-ID: <9ea47b05-2298-dc48-d938-f1593c1d0d3c@gmail.com> Subject: [PATCH] fix musl-gcc.specs.sh to correctly handle -static-pie --gXHryyFIfferVHUqQENrx6cCEKF0hjTG6 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hello, Today I wanted to use musl-gcc to build -static-pie binaries. I noticed that this does not work (musl-libc is still linked as a shared library and is also still requested as an interpreter). Looking into the musl-gcc.specs file the bug was obvious: rcrt1.o was not used as a startfile, and neither -no-dynamic-linker nor -static were passed to the linker. This patch fixes this by actually using rcrt1.o and passing the linker options when -static-pie is given. I don't have much experience with the specifics of gcc .spec files and which options need to be passed, but this seems to work with all variations of -shared, -static, and -static-pie that I've tried. Here (https://github.com/Ferdi265/musl) is the repository with the patch on GitHub, and I've also attached the patch below. Greetings, Ferdinand "Ferdi265" Bachmann --- PATCH BELOW --- =46rom 070bce8f7e508a951d3b65da227b2fca3a65f37b Mon Sep 17 00:00:00 2001 From: Ferdinand Bachmann Date: Tue, 28 May 2019 21:53:25 +0200 Subject: [PATCH] fix musl-gcc.specs.sh to correctly handle -static-pie --- tools/musl-gcc.specs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/musl-gcc.specs.sh b/tools/musl-gcc.specs.sh index 30492574..7206cb25 100644 --- a/tools/musl-gcc.specs.sh +++ b/tools/musl-gcc.specs.sh @@ -17,13 +17,13 @@ cat <