From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 2D72D3857C65 for ; Wed, 17 Nov 2021 09:11:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2D72D3857C65 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-66-p0QNols9Otm_VbDuJu2i3g-1; Wed, 17 Nov 2021 04:11:18 -0500 X-MC-Unique: p0QNols9Otm_VbDuJu2i3g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D78A2802C8F; Wed, 17 Nov 2021 09:11:17 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.194.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A76445F4ED; Wed, 17 Nov 2021 09:11:01 +0000 (UTC) From: Florian Weimer To: Siddhesh Poyarekar Cc: libc-alpha@sourceware.org, carlos@redhat.com Subject: Re: [PATCH] New option --enable-pie-programs References: <20211116135240.3092651-1-siddhesh@sourceware.org> <87czn0cicn.fsf@oldenburg.str.redhat.com> <875ysr9nwo.fsf@oldenburg.str.redhat.com> Date: Wed, 17 Nov 2021 10:10:59 +0100 In-Reply-To: (Siddhesh Poyarekar's message of "Wed, 17 Nov 2021 14:20:36 +0530") Message-ID: <87wnl787vg.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable 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 09:11:23 -0000 * Siddhesh Poyarekar: > 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. But that doesn't make sense, does it? If the user requests non-PIE programs, they should get that. Thanks, Florian