From patchwork Mon Nov 27 14:52:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 170217 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3180272vqx; Mon, 27 Nov 2023 06:52:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEOsBZ6vUcHwcmNdjorXmqXU3rwb2OE5RwthaiLZg+r87s+ZnqW2EVypO5bs7Dk9kk1fu+c X-Received: by 2002:a05:620a:8121:b0:77d:5833:8bb5 with SMTP id os33-20020a05620a812100b0077d58338bb5mr12288308qkn.34.1701096757552; Mon, 27 Nov 2023 06:52:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701096757; cv=pass; d=google.com; s=arc-20160816; b=FsOKH/Mv071o6fscs5AAMLfj6STbQyCebbttwDXMpt336r4ZMTRa42p4fR3kQKZMi0 zV+4KRjv71m390gN2mCtpghrYaJj58YgqHdFzL6iy6BIvU3prjLPFWA5b1epvE6hu66m e+iYZbC6m/qAoD4DOxpsJik3bA0CkskrbidIoiHFRoBEGvpRsF36PHjxsv/0yUR9DNX3 KIVqSkuq/vKu0pFfsK/AVobD4d3G+uHjAttlaRUyC4rFPyMu26pPRfSK2U+M0yQxOmG+ AmXSq4yd8agLeAzk5+BGAMsThSyc8vtGxSQplFgzwVflw+LqcRJs5EiCAcHUJ9l1Qt4e uySA== 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:mime-version:message-id:date :user-agent:references:in-reply-to:subject:cc:to:from:ironport-sdr :arc-filter:dmarc-filter:delivered-to; bh=MbZmi5hLsKKpsXrrue4P+94bnXK0TOPGQf0AeAk3RkU=; fh=yxuASnO8uE3vdod7hhP+Xa0QZuXN0mNx56fCIqp+xQY=; b=f652Vm/QYBlfMPPJWDQqvmj8IhUHYoZMGX3ghNG5wlytKdsYccpvJ9WPXfu9J+OpzT adRQcGTpI8DxreDnf4WX+D4+HYvkzyBbldSCrLLKkz7k47uW3aJhErdw1EMdszCxPwst a1Q6xCLeuooEAoN2N99pssMEZcezJaiebrRGZA21CG5WTPiw1SK14voVZos/jkpz1QHb nnFnCP51uRRmW6Xycs7e0hgpdipWNI/42KHvldXBOwZiDAHXvaNobfYIg2SoE8SZF9HA d3V2IoyTr+97mPSHghtf+Ys+NceTmlR7pZ4j8TGLeWlkZn5GEvGPn4W/BdVZb0en2nG0 jWTA== ARC-Authentication-Results: i=2; mx.google.com; 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" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ql4-20020a05620a890400b0077d856c0558si6614758qkn.359.2023.11.27.06.52.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 06:52:37 -0800 (PST) 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; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CC98D385841E for ; Mon, 27 Nov 2023 14:52:33 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id E3E5E3858CD1 for ; Mon, 27 Nov 2023 14:52:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E3E5E3858CD1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E3E5E3858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.137.180 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701096731; cv=none; b=L1ilx5LcpP1n/hdG9vjdi6b1E2NStVM0qe9GKXiWPRBAVsZPPZ+aXaejhcYTecNbGdJCzuiZ7d4J1TnVCfTJV9H7kXPVwRNHAeqtazS2Hl/eAyG7H5N+ErHJSs2j9vfRYrbMrFCItlWEBbUZL6Xx8FpImBhMlIHjSMS+QG8rQ2A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701096731; c=relaxed/simple; bh=iYMLXQCxbWKgeErSB0cuhyaRLpQ5xoS949srlbw8Rck=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=gQwYZRAteCfpSiyejjW5ENr7GRzWFR75wIhLWd0V9uvAEnA3aJuYfQ6iooDnkpwA9h/syZPC+N53g5joVPmaTsZjrQEl0X2LkxLK3qsvjoAtKLLZaRfOvd17JuictQ2YyvbeDvhzOqavSwWR2DaCbt+jvqWxdb9T9DNM8i2w5ow= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: uTwyZGHRTL2YgbJW/cnrNQ== X-CSE-MsgGUID: ges+CgPRQEmpj+BFXt8B9w== X-IronPort-AV: E=Sophos;i="6.04,231,1695715200"; d="scan'208,223";a="23795618" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 27 Nov 2023 06:52:08 -0800 IronPort-SDR: 6lkxDbZBY7ZNIFFv7FF/L8qll+wNVrl7ka+ZOp6etGGRCTupfY23AUESL4Px1FKCzjLv02knYh LNo/+YD/3ZC9GEGB4RcV2pKcYQfwjY7U1H+fCMGQXZ/POQCo11r6/rpHimWbyTRnfSgHcxWjka LJNPvl2YGLaCmuZRFlLPs4riLTFZWRPRXmwqNfqaNX/hGtlsZ/BWJ0YUdMCMCFk+Hze8vF/+m4 8M0p7ruTPIwhQKKuYTcDwOeoq2q4z2P4h6QCXLotdF3J7o30xdQVnfnoPjWMg548zI6rIW1uv4 gKQ= From: Thomas Schwinge To: Samuel Thibault , CC: Subject: hurd: Ad default-pie and static-pie support In-Reply-To: <20231028192039.kgv7sp5f7kucqvvf@begin> References: <20231028192039.kgv7sp5f7kucqvvf@begin> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Mon, 27 Nov 2023 15:52:02 +0100 Message-ID: <87jzq3s0z1.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, 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 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: 1783729233470850482 Hi! On 2023-10-28T21:20:39+0200, Samuel Thibault wrote: > This fixes the Hurd spec in the default-pie case, and adds static-pie > support. I understand that your change does work for you as-is, so I've now pushed that to master branch in commit c768917402d4cba69a92c737e56e177f5b8ab0df "hurd: Ad default-pie and static-pie support", see attached. Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From c768917402d4cba69a92c737e56e177f5b8ab0df Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 6 May 2023 13:55:44 +0200 Subject: [PATCH] hurd: Ad default-pie and static-pie support This fixes the Hurd spec in the default-pie case, and adds static-pie support. gcc/ChangeLog: * config/i386/gnu.h: Use PIE_SPEC, add static-pie case. * config/i386/gnu64.h: Use PIE_SPEC, add static-pie case. --- gcc/config/i386/gnu.h | 6 +++--- gcc/config/i386/gnu64.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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 -- 2.34.1