From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id 4F4313858422; Thu, 18 Nov 2021 17:59:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4F4313858422 Received: by mail-pj1-x1029.google.com with SMTP id v23so5738290pjr.5; Thu, 18 Nov 2021 09:59:15 -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=se0pcT1iK8PAdo0HJ8S/ignTJs0zBAf6rKfjq63wXGg=; b=T/9KUXnwCAZum5CoNPTpFn5naTSrfnkOimZJKreRdvTHycNo5QTg7e2xNX/QchS2hb 47CumVMDIKrnM0+d6TgBzAKMCXIfZDGT6Ue8cdvIPRx4D/nQjGCImoeK/ECutDWEaSW/ d/xTBuE/JtUb0DEKhri3I6nv1Df2zTQiIRU68ftdsO4ZlGrWoFZWMd2gHiQUqdXnQczz hTlGtc8I3lwzgD9FF6HdrB3pl0ohY1RUHB6dSvJXa3gSuhBQFL3a9Ve+dMrL+SmeC990 dOohnZJB1fz2vaixH3BqAcsTbR6LMSadYy6kZzWLoslDIuepVM4IOH/JeW2mALAPXvR/ FC8A== X-Gm-Message-State: AOAM531USOJugMIBVKUvn3C9FS310oKfnCTW5CtR8JAuvUBOf8gjb6is hDvv+LWYwUu03+N6Hu8kO0gfDn1w83IG/Iz7NKHlQad7WcA= X-Google-Smtp-Source: ABdhPJxh89u4REHGG0CZJZ1Y1+3e1DnKS13BB4pLwTqREaPnMIeBqbVtC/t495NJwj3mQdCDoJE/up3PR6arlcCBLVo= X-Received: by 2002:a17:90b:3a85:: with SMTP id om5mr13095112pjb.28.1637258354412; Thu, 18 Nov 2021 09:59:14 -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> <549f87ce-d3c1-c4ff-8aae-bc899668c730@gotplt.org> <838b41ee-3cbc-6ae7-0798-d2659abcea87@gotplt.org> In-Reply-To: <838b41ee-3cbc-6ae7-0798-d2659abcea87@gotplt.org> From: "H.J. Lu" Date: Thu, 18 Nov 2021 09:58:38 -0800 Message-ID: Subject: Re: [PATCH] New option --enable-pie-programs To: Siddhesh Poyarekar Cc: Adhemerval Zanella , Florian Weimer , Siddhesh Poyarekar , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3023.3 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 17:59:17 -0000 On Thu, Nov 18, 2021 at 9:54 AM Siddhesh Poyarekar wrote: > > On 11/18/21 22:26, H.J. Lu wrote: > > On Thu, Nov 18, 2021 at 8:49 AM Siddhesh Poyarekar wrote: > >> > >> On 11/18/21 22:14, H.J. Lu wrote: > >>> --enable-pie means --disable-pie which looks odd since PIE isn't really > >>> disabled, just isn't the default. But I don't feel it very strongly. As for > >> > >> Ahh then the option you suggested is actually different, in that > >> --enable-default-pie=no doesn't actually disable PIE for default-PIE > >> toolchains. That is, it is similar to the --enable-pie-programs option > >> I implemented with the added functionality of transparently enabling > >> static-pie. Have I understood that correctly? > >> > > > > I am not sure. --enable-default-pie and --disable-default-pie should > > be independent of compilers, except for static PIE. If compiler supports > > static PIE, --enable-default-pie implies --enable-static-pie. > > > > How do you see --disable-default-pie behaving with a compiler that > produces PIE by default? That is, in case where > libc_cv_cc_default_pie=yes? Should it add -fno-pie or leave it as is? > It should add -fno-pie by default when building programs. -- H.J.