From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id 16F98385841C; Thu, 18 Nov 2021 12:43:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 16F98385841C Received: by mail-pg1-x52d.google.com with SMTP id d64so3183095pgc.7; Thu, 18 Nov 2021 04:43:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=blqZbNNHp/+toO8+PtK9KkqLkKeTE7mLrKCVv7XDoNI=; b=CWh3HWp8SmW6PYQUOm3tvyHm14s7aaX7AVmZBEmqqJk+40IJx+gqi8rRqf87zwQLe0 p0XTNsCz6krrHiP9IibZsBie8ItDWNev6U+VyVi+9G65BnUJ7WRAgYTaoOQeChAeCfVo ErLizOGY0VvZFzBjPHlb7Qj4a5OOaltxf0S84oFf1S1kBpEI3isD1UfyPYyQi2Ue/Ukx anptE17rEyoMTLKcR9RGIOyvAD7LsZQOqC98Ctj81I9XI2eirJUX87dXjc5icXDOYeng drl0L2JGaiNUrEEOLomLixCJvT8/8KX6stwZHvOThN8ZileyGCZGI1NeTRx3KuCBjkBb hQZA== X-Gm-Message-State: AOAM532LBi908TfBrNDEdK4T4WV+isGLNzhjOH2SFB23ThYrQNA3feSH X+FmhKyImM6UEQDiZapZ6ELy+WtLKbUY6gjx8fE= X-Google-Smtp-Source: ABdhPJxTesnYOMV4GbdgGxvPp42iPT8pI10S6fgBC6N7JRkgaYCuVLzZuffbywl+1XfBlupTDt1e+RGNU+JYSpMuWII= X-Received: by 2002:a63:87c1:: with SMTP id i184mr11095481pge.75.1637239398200; Thu, 18 Nov 2021 04:43:18 -0800 (PST) MIME-Version: 1.0 References: <20211116135240.3092651-1-siddhesh@sourceware.org> <87czn0cicn.fsf@oldenburg.str.redhat.com> <875ysr9nwo.fsf@oldenburg.str.redhat.com> <87wnl787vg.fsf@oldenburg.str.redhat.com> <4e9ac2de-aa3d-d9bf-c838-74e8fb59ead5@sourceware.org> <07d2bb89-93c7-54b0-dec6-7fdbd4e4998e@gotplt.org> In-Reply-To: <07d2bb89-93c7-54b0-dec6-7fdbd4e4998e@gotplt.org> From: "H.J. Lu" Date: Thu, 18 Nov 2021 04:42:42 -0800 Message-ID: Subject: Re: [PATCH] New option --enable-pie-programs To: Siddhesh Poyarekar Cc: Siddhesh Poyarekar , Florian Weimer , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3022.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2021 12:43:20 -0000 On Thu, Nov 18, 2021 at 1:24 AM Siddhesh Poyarekar wrote: > > On 11/17/21 15:34, Siddhesh Poyarekar via Libc-alpha wrote: > > I suppose you're right. That is current behaviour with > > --enable-static-pie too; wouldn't a similar argument hold for > > --enable-static-pie=no? Or is the rationale in that case is that > > *static-pie* is disabled, not pie itself and hence the default PIE > > toolchain could get away with building PIE dynamic programs, just not > > static ones? > > > > I wonder if the clearer option is to have a new > > --enable-pie=, where "no" disables PIE (even on > > default-PIE toolchains), "dynamic" enables PIE for dynamic programs and > > "full" or "yes" enables static-pie on architectures that support it, > > terminating with an error if it's not supported. --enable-static-pie=no > > could then imply --enable-pie=dynamic and could be deprecated. I don't > > remember if we have ever deprecated configure flags before. > > > > Even simpler, we could have just a yes/no option and enable static-pie > > transparently on architectures that support it, making an explicit > > --enable-static-pie=no equivalent to disabling all PIE. It may in > > theory break a use case but I don't know if there's actually a use case > > where one would strictly want only dynamic PIE and not static PIE. > > A third option (as we discussed offlist yesterday) could be to always > build glibc dynamic programs as PIE as long as the toolchain supports > it. Would non-distribution use cases be adversely affected by not > having an option to produce non-PIE glibc programs, e.g. iconvconfig, > getconf, etc.? How about --enable-default-pie? -- H.J.