From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from burlywood.elm.relay.mailchannels.net (burlywood.elm.relay.mailchannels.net [23.83.212.26]) by sourceware.org (Postfix) with ESMTPS id C94793858C27 for ; Wed, 17 Nov 2021 08:50:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C94793858C27 X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 43D6E52DD28; Wed, 17 Nov 2021 08:50:44 +0000 (UTC) Received: from pdx1-sub0-mail-a306.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 5D15E52D438; Wed, 17 Nov 2021 08:50:43 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a306.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.112.64.68 (trex/6.4.3); Wed, 17 Nov 2021 08:50:43 +0000 X-MC-Relay: Junk X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Little-Tart: 3931f2af23ba78c6_1637139043752_1082136096 X-MC-Loop-Signature: 1637139043752:2146492907 X-MC-Ingress-Time: 1637139043752 Received: from [192.168.1.174] (unknown [1.186.223.33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a306.dreamhost.com (Postfix) with ESMTPSA id 4HvGq55P8Zz1W7; Wed, 17 Nov 2021 00:50:41 -0800 (PST) Message-ID: Date: Wed, 17 Nov 2021 14:20:36 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH] New option --enable-pie-programs Content-Language: en-US To: Florian Weimer Cc: libc-alpha@sourceware.org, carlos@redhat.com References: <20211116135240.3092651-1-siddhesh@sourceware.org> <87czn0cicn.fsf@oldenburg.str.redhat.com> <875ysr9nwo.fsf@oldenburg.str.redhat.com> From: Siddhesh Poyarekar In-Reply-To: <875ysr9nwo.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3489.4 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_MSPIKE_BL, RCVD_IN_MSPIKE_ZBI, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=no 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: Wed, 17 Nov 2021 08:50:47 -0000 On 11/17/21 14:09, Florian Weimer wrote: > * Siddhesh Poyarekar: > >> On 11/16/21 19:28, Florian Weimer wrote: >>> * Siddhesh Poyarekar: >>> >>>> Add a new option --enable-pie-programs to build tests and binaries as >>>> PIE. This allows building all dynamic programs in glibc (e.g. >>>> iconvconfig, getconf, etc.) as PIE on architectures that do not have >>>> -static-pie. >>> Please integrate this in some way with libc_cv_cc_pie_default and >>> libc_cv_pie_default. Probably --enable-pie-programs should default to >>> yes if the toolchain defauls to PIE. >> >> AFAICT, libc_cv_cc_pie_default is only to set -fno-pie for non-PIE >> linking with a toolchain that defaults to pie. PIE linking otherwise >> is controlled accross the board with libc_cv_pie_default, which >> includes build-pie-default, static-pie and now pie-programs. >> >> So I reckon it is integrated; the new pie-programs variable is only to >> set CFLAGS to -fPIC. > > --enable-pie-programs=no with a default-PIE toolchain still produces PIE > programs, right? Yes, it should. $libc_cv_pie_default is overwritten only in case of --enable-pie-programs=yes, otherwise it is left alone, much like --enable-static-pie. Siddhesh