From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fencepost.gnu.org (fencepost.gnu.org [IPv6:2001:470:142:3::e]) by sourceware.org (Postfix) with ESMTPS id 467663858D28 for ; Sat, 6 May 2023 11:55:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 467663858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Subject:To:From:Date:in-reply-to: references; bh=5Wef0kU0y6/e8BEQfSt2nSV2S+plqnwDeW8s40MXsC4=; b=U1+CC+rVIt7YzN YHCRxboE2JFjGhygEetoDgvH5qRbMeQGJTkPFNX6npbf8dJXgCOfXoBZPHpOnplcImfE1LuVvcfBz s2PxC+Oahv0pzyFNHW0fqYsdEpicUcELp1eg9uk3vaWKF5iRTjOtDWzYrjog7N6f55te8gdnYMPen G4a85orLGbs5YdlFWv1xdPTut/vaswTgwS907geUAUUddFzQjQ8MVciCf4BqjJUXhT24vcOanf2wc 5K+VbHileFilBXx+ZdJerRWaS+hVJdgHQGxIPmRok48vjZVErhQZZ6jKzaXf/uGFVctwQkVXXs33n GkuoX5vkGJ5NA/QhAJ1Q==; Received: from lfbn-bor-1-1163-184.w92-158.abo.wanadoo.fr ([92.158.138.184] helo=begin) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvGVt-0003Dt-Re; Sat, 06 May 2023 07:55:52 -0400 Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1pvGVs-009ZBZ-1S; Sat, 06 May 2023 13:55:44 +0200 Date: Sat, 6 May 2023 13:55:44 +0200 From: Samuel Thibault To: gcc-patches@gcc.gnu.org, Thomas Schwinge Cc: bug-hurd@gnu.org Subject: [PATCH] hurd: Ad default-pie and static-pie support Message-ID: <20230506115544.y5hzmvwlgoup22ct@begin> Mail-Followup-To: gcc-patches@gcc.gnu.org, Thomas Schwinge , bug-hurd@gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This fixes the Hurd spec in the default-pie case, and adds static-pie support. gcc/ChangeLog: * gcc/config/i386/gnu.h: Use PIE_SPEC, add static-pie case. * gcc/config/i386/gnu64.h: Use PIE_SPEC, add static-pie case. diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h index 8dc6d9ee4e3..e776144f96c 100644 --- a/gcc/config/i386/gnu.h +++ b/gcc/config/i386/gnu.h @@ -27,12 +27,12 @@ along with GCC. If not, see . #undef STARTFILE_SPEC #if defined HAVE_LD_PIE #define STARTFILE_SPEC \ - "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \ - crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" + "%{!shared: %{pg|p|profile:%{static-pie:grcrt0.o%s;static:gcrt0.o%s;:gcrt1.o%s};static-pie:rcrt0.o%s;static:crt0.o%s;" PIE_SPEC ":Scrt1.o%s;:crt1.o%s}} \ + crti.o%s %{static:crtbeginT.o%s;shared|static-pie|" PIE_SPEC ":crtbeginS.o%s;:crtbegin.o%s}" #else #define STARTFILE_SPEC \ "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};static:crt0.o%s;:crt1.o%s}} \ - crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" + crti.o%s %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}" #endif #ifdef TARGET_LIBC_PROVIDES_SSP diff --git a/gcc/config/i386/gnu64.h b/gcc/config/i386/gnu64.h index a411f0e802a..332372fa067 100644 --- a/gcc/config/i386/gnu64.h +++ b/gcc/config/i386/gnu64.h @@ -31,10 +31,10 @@ along with GCC. If not, see . #undef STARTFILE_SPEC #if defined HAVE_LD_PIE #define STARTFILE_SPEC \ - "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \ - crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" + "%{!shared: %{pg|p|profile:%{static-pie:grcrt0.o%s;static:gcrt0.o%s;:gcrt1.o%s};static-pie:rcrt0.o%s;static:crt0.o%s;" PIE_SPEC ":Scrt1.o%s;:crt1.o%s}} \ + crti.o%s %{static:crtbeginT.o%s;shared|static-pie|" PIE_SPEC ":crtbeginS.o%s;:crtbegin.o%s}" #else #define STARTFILE_SPEC \ "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};static:crt0.o%s;:crt1.o%s}} \ - crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" + crti.o%s %{static:crtbeginT.o%s;shared|static-pie|" PIE_SPEC ":crtbeginS.o%s;:crtbegin.o%s}" #endif