From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8819 Path: news.gmane.org!not-for-mail From: Petr Hosek Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] don't define SHARED macro in the source Date: Sat, 07 Nov 2015 23:24:56 +0000 Message-ID: References: <20151107132404.GD8500@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114c85ec9247140523fbabd6 X-Trace: ger.gmane.org 1446938724 18435 80.91.229.3 (7 Nov 2015 23:25:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Nov 2015 23:25:24 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8832-gllmg-musl=m.gmane.org@lists.openwall.com Sun Nov 08 00:25:23 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZvCrL-0005zJ-19 for gllmg-musl@m.gmane.org; Sun, 08 Nov 2015 00:25:23 +0100 Original-Received: (qmail 22029 invoked by uid 550); 7 Nov 2015 23:25:19 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 21991 invoked from network); 7 Nov 2015 23:25:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=1v+7l/HSlqXfXv/RoSu1UMCduph7sB/TiOr5WAiGnQY=; b=djHnwrOlUZeZKlKSLhh+BSM2/4/7y2bmOzvUg6cGW4kCDPoaxA5OR4BHuENcTT/why Fz9Byo2C19eb92NVHI/ZoWTSuKsMrWJ5xlefybEe3HyzBdOPAZdcG8hEHnVkrBQswnv7 nCFA/1xuqQz+7+uEsizmRz28+C4fT8GGqRcTY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type; bh=1v+7l/HSlqXfXv/RoSu1UMCduph7sB/TiOr5WAiGnQY=; b=Es3CYbJ2gPbwKehFoTQOKXlaWOsdxz0giGnxZz9URt4p9j/c4ZMs2u+X0xD+iEzvSk 2mP4sNWW9GDxNusdzOfnqg5RX3Ahi3j0fob7mAwURZTpPFUJvqCNCizIAY62UaYVfAs4 1fopjFt+ISRNrawwyuCfPhUzI19NE+ZX5SDOt/JeZ8bxf+u/v3BRrFLljaX3w/aCgiOH vk0cEPp/16xQ9/piwrMrnbcgDJTF/ElyAW2iJAFKUk2v8qlNl1ccd0TrUHurj1uWSNbL vqWHdHdbImnqkZl5NqTZn2Hg9bQYn0DZ1aaDtix7spwyfAG4azGAX/TVWK4DxMFyiIzv Yjnw== X-Gm-Message-State: ALoCoQkOFrKN2b9QxJ7U6aSuo+h0Wb2+pngbpKu8Qo2u8mGGnKLkaZNANpxWTwUfyn34eVk+E7ji X-Received: by 10.129.56.4 with SMTP id f4mr16405927ywa.201.1446938705783; Sat, 07 Nov 2015 15:25:05 -0800 (PST) In-Reply-To: <20151107132404.GD8500@port70.net> Xref: news.gmane.org gmane.linux.lib.musl.general:8819 Archived-At: --001a114c85ec9247140523fbabd6 Content-Type: text/plain; charset=UTF-8 We don't support static pie in our toolchain so I haven't really tested that scenario but now I see why the SHARED macro is needed here. One option around this issue would be to avoid building rcrt1.c altogether, but I'd like to avoid carrying an extra patch for that. The other option would be to allow inline assembly in this case since it seems to be only used as a guard. I'll see if the second option is feasible. On Sat, Nov 7, 2015 at 5:24 AM Szabolcs Nagy wrote: > * Petr Hosek [2015-11-06 23:46:40 +0000]: > > When building musl with pnacl-clang compiler I found a bug: crt/rcrt1.c > > defines the SHARED macro which enables the conditional block in > > src/ldso/dlstart.c, this breaks for us because pnacl-clang doesn't > support > > shared libraries nor inline assembly. If my understanding is correct, the > > SHARED macro should be (and already is) defined only in > CFLAGS_ALL_SHARED. > > The attached patch fixes that. > > but rcrt1.o is not built with CFLAGS_ALL_SHARED and SHARED is needed > > rcrt1.o should be only used for static pie > > > From 7b1348fa1a8dd2d02a9087639c6b02ce9585aef2 Mon Sep 17 00:00:00 2001 > > From: Petr Hosek > > Date: Thu, 5 Nov 2015 21:55:20 -0800 > > Subject: [PATCH] don't define SHARED macro in the source > > > > the SHARED macro should only be defined in CFLAGS_ALL_SHARED when > > building musl as shared library. > > --- > > crt/rcrt1.c | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/crt/rcrt1.c b/crt/rcrt1.c > > index 9be117f..0ba78f8 100644 > > --- a/crt/rcrt1.c > > +++ b/crt/rcrt1.c > > @@ -1,4 +1,3 @@ > > -#define SHARED > > #define START "_start" > > #define _dlstart_c _start_c > > #include "../src/ldso/dlstart.c" > > -- > > 2.6.0.rc2.230.g3dd15c0 > > > > --001a114c85ec9247140523fbabd6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
We don't support static pie in our toolchain so I have= n't really tested that scenario but now I see why the SHARED macro is n= eeded here.

One option around this issue would be to avo= id=C2=A0building rcrt1.c altogether, but I'd like to avoid carrying an = extra patch for that. The other option would be to allow inline assembly in= this case since it seems to be only used as a guard.=C2=A0 I'll see if= the second option is feasible.

On Sat, Nov 7, 2015 at 5:24 AM Szabolcs Nagy <nsz@port70.net> wrote:
* Petr Hosek <phosek@google.com> [2015-11-06 23:46:40 +0000]:
> When building musl with pnacl-clang compiler I found a bug: crt/rcrt1.= c
> defines the SHARED macro which enables the conditional block in
> src/ldso/dlstart.c, this breaks for us because pnacl-clang doesn't= support
> shared libraries nor inline assembly. If my understanding is correct, = the
> SHARED macro should be (and already is) defined only in CFLAGS_ALL_SHA= RED.
> The attached patch fixes that.

but rcrt1.o is not built with CFLAGS_ALL_SHARED and SHARED is needed

rcrt1.o should be only used for static pie

> From 7b1348fa1a8dd2d02a9087639c6b02ce9585aef2 Mon Sep 17 00:00:00 2001=
> From: Petr Hosek <phosek@chromium.org>
> Date: Thu, 5 Nov 2015 21:55:20 -0800
> Subject: [PATCH] don't define SHARED macro in the source
>
> the SHARED macro should only be defined in CFLAGS_ALL_SHARED when
> building musl as shared library.
> ---
>=C2=A0 crt/rcrt1.c | 1 -
>=C2=A0 1 file changed, 1 deletion(-)
>
> diff --git a/crt/rcrt1.c b/crt/rcrt1.c
> index 9be117f..0ba78f8 100644
> --- a/crt/rcrt1.c
> +++ b/crt/rcrt1.c
> @@ -1,4 +1,3 @@
> -#define SHARED
>=C2=A0 #define START "_start"
>=C2=A0 #define _dlstart_c _start_c
>=C2=A0 #include "../src/ldso/dlstart.c"
> --
> 2.6.0.rc2.230.g3dd15c0
>

--001a114c85ec9247140523fbabd6--