From patchwork Sat Oct 28 19:20:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 159286 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp1364946vqb; Sat, 28 Oct 2023 12:21:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFl9AMgUmXN02Up3KZcQi0BdoP0OfDAULOzczHO5/b67D4gCkXURvig9iJ9A3R2iK0gkcyv X-Received: by 2002:a05:620a:458e:b0:777:7214:44d with SMTP id bp14-20020a05620a458e00b007777214044dmr8858721qkb.23.1698520864224; Sat, 28 Oct 2023 12:21:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698520864; cv=pass; d=google.com; s=arc-20160816; b=ZV285+bfit8LQ1MYGfJOF2R635HV4bUTo+mX7Ugb2LIRqDzH0JyBctIaygb7w98ENv l9NkZguSR4LVmUjui/CiOgDfgjnq3NtJNLS8C0I299EjEVorQtrJlT8Ef4Dnd1WczL9C EEB1fDYy3Q7AA2VQU5lzsCgxTxQV19dVqhA0KPk12Ogfz4Srbvl8h7qUiclCccOvpQYg YY/JvUCvylmteM8zqJ/C5pjqinnieDY/xt3Rd4q2+JdKoLPl80Q3zls35SHKYXnhvstJ tuka5TW63dRNqRu0MXQcxeAFzhqEL18WhhkLLcpHSHya67QZrHxr2Uqb/ngN45e60P9j Py6A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:user-agent:organization :content-disposition:mime-version:mail-followup-to:message-id :subject:cc:to:from:date:dkim-signature:arc-filter:dmarc-filter :delivered-to; bh=5Wef0kU0y6/e8BEQfSt2nSV2S+plqnwDeW8s40MXsC4=; fh=pzOnVYvpYgdfXppMsQPEzVURPG8LisOd71qvf1JtnTM=; b=JUtvAZAvrWmd0gt6ClxUsV0lSJ6dMIrzbCgpmw/C8HNlOWmtYHy1eLHlq6zfbLgiUp X+CCuTpOlOT2GQjVWyGfJyKyqRkx8vUo3L+h9/n3k7eI4r+8KpD5ZQ1JP71LmeG0dVXj M0nn4FNb1ixLNdPvtaiy9Man28kGqrCbKwjb0sbd42wSd97vVZr0FIK15m7Nwt8bcdEq wlHM085jIkgwNnQAproxyWqFHStx3oLfLCmdMAQ+NwffGwzA9DVSO3xGiaO7H9bZ7A40 8OLutUysth3EX4Y3zspyg15Zr3Iqb4PZi18wVheibj+YDSjDflerQGuJJ7wW9BeMfA/J aCBw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gnu.org header.s=fencepost-gnu-org header.b=okieQp3Z; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id u5-20020a05620a0c4500b00779db6b77dcsi2845824qki.353.2023.10.28.12.21.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 12:21:04 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gnu.org header.s=fencepost-gnu-org header.b=okieQp3Z; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 00B8038618E5 for ; Sat, 28 Oct 2023 19:21:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from fencepost.gnu.org (fencepost.gnu.org [IPv6:2001:470:142:3::e]) by sourceware.org (Postfix) with ESMTPS id D0FB7385C6FC for ; Sat, 28 Oct 2023 19:20:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D0FB7385C6FC Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D0FB7385C6FC Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698520843; cv=none; b=cC5Q9LA9Yodl/PbJtWE5+8YtegdbtsIHj3bFr0IzU8++EGj1CnuPK8mvW7yNCPVm0aDtAcOUhid3B+hZRwwr/Pp9j/POZugxsH8U9PXanR/ktCOcGsT+RWfce3hQES4fS4iCopDKscsjegBEQInq+sbJtn7N01jsedbE2wG4Ac4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698520843; c=relaxed/simple; bh=2zPnOfbq8uY1g+n6CpUnJ/bwuF34HE4/uzf0UOVvles=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=fb3K1ZGS8TLBVfnHCrN6ADY8UJchxdwrHgXP54vJZqelN8fa83eACN9Pb+nONauortwGxhis6r6OR+3dBTGM+9LtaZ7rtRQKkPK5cftjnSJHwQCf9gQ/aHME3ZMN1yrp+OVT44SyJMix/AHxr//Q7y+Zf9PDgowgJXT4qV4/IkM= ARC-Authentication-Results: i=1; server2.sourceware.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=okieQp3Zp7wh5N nuehi/Zpe4mqP9mUrN+fsNmS7zPW4hqfv771foDrGoLEhqKUPRMUIXc3Q8zpPsx+K0rmxRpMwNYNe A2LFn+UpcXvlyP6K8o4IqtLbsUVjzaDj5CuJozlOSyB9RG/NyjpooCXFBAh74XTxzKZt+07PgUeD2 hTiDvaR7SAVoYIRx8gc5cchiBqa/RLay8jp5qjEe20X1trTXQei86J3PytdapyapI2bOnOz6a4yI/ jJO4MV9k+AInPzrjrN+M47q9uSQAsYm6/pzcD26mKgpiboc5H/WBLl1rYkKKhtVLpdpiX44IQwc5h 085bjSfSGE6p0ftirkiA==; Date: Sat, 28 Oct 2023 21:20:39 +0200 From: Samuel Thibault To: gcc-patches@gcc.gnu.org, Thomas Schwinge Cc: bug-hurd@gnu.org Subject: [PATCH,resend] hurd: Ad default-pie and static-pie support Message-ID: <20231028192039.kgv7sp5f7kucqvvf@begin> Mail-Followup-To: gcc-patches@gcc.gnu.org, Thomas Schwinge , bug-hurd@gnu.org MIME-Version: 1.0 Content-Disposition: inline Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-8.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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781028213305377774 X-GMAIL-MSGID: 1781028213305377774 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