From patchwork Mon Jan 1 11:53:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Bugaev X-Patchwork-Id: 184161 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp3949482dyb; Mon, 1 Jan 2024 04:58:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxdaGz+JKWwXgI8Vn9CenGe8uqP401HXju4nDuoP3K7ZHlSjlTKf2XKYN5byuWCq0NywbF X-Received: by 2002:a0c:f705:0:b0:67f:9d8c:7cf7 with SMTP id w5-20020a0cf705000000b0067f9d8c7cf7mr16867538qvn.7.1704113929688; Mon, 01 Jan 2024 04:58:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704113929; cv=pass; d=google.com; s=arc-20160816; b=RjGDHg30vFp4InJEuodJoFjoui7v4gQca6QbKEnQRI/TvCIbbucBNJgcj4UMUnzNQy E6oegkYZrj4MX0aSn5ELqGY19FVfJKr5TvZoBfvOE15eOPFqAcdf3EGGtcJr+X/O4Q7Y ZDuh8k0ds7yw0Cgwg9JTp1BNJKE0TnSwwfgIn0Rc+BD3aA0ABXB/mCMH0I1JVgCw4wr6 FRBoO4d7etsCV+GRrsN/TIwzyfoHPZU3YnAWcXDk5vpp/+sl7I6ztWNxW3GP2fXx3v/u JE8/cNYxlfz7lRfP1R1hDG+Z6zHt34O0025HbaRKAyp6eH2eQeVy0zh6Kax+Nh3f9v5d w+Cw== 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:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=Lw0dws/OSqG5c2B3SapQE5v0vPFEokDpxmKvNZNi7Ws=; fh=9bJenRX/cD8CU3PEmvrB+wrE7mB8Fw2pK3nnUaGV76o=; b=Aecloo1bKlhnUWzx2iQetJdqD57ni14OA28huWmRmGeHaglDyhKeDfUVMSrYie/BdN PDvYpX+nbOmD7zBY6Cy2So1NTNf3VuacOqGouZ+J6uWfSHY+xRFvYf+m9Wen1ks0XEMY 5eHmJK8M3CWMMlaFUSd1eFALCyu58jf+ytT68GcWnZIAQLZ/479vE+9gTn1Wx4G/tgNY UGkntzk/aQHqiKF01q6+EFZaQWCk4EX0c+h7vrzN668aw4Ggkml75c9xldZNYz0j+pJ9 nuUmuzLfDBeGyxAZRMHdljjXaU8qujuGQ50N18tdP27vXfg1RSOiJhVhaccpjQsf8kxU qtAA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YB8toBPC; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id y18-20020a0cd992000000b0067f9161d2e0si22382499qvj.423.2024.01.01.04.58.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 04:58:49 -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; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YB8toBPC; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 871D83857C76 for ; Mon, 1 Jan 2024 11:55:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by sourceware.org (Postfix) with ESMTPS id DEB833858413 for ; Mon, 1 Jan 2024 11:54:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DEB833858413 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DEB833858413 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::233 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704110046; cv=none; b=fIllYFHUCS8qL2hTNkz3p/nk7jHfXpx6vuj9msERad0SYGkKPTkpX8t5Nys83NJymvg3sREk0oN9h1QWaHnM9ghBbC7lix2jfP0BQyMdF3k1RI2o2v/Qp/IaKzdICXQfHaK/Dom/aKO/HIVIZf81+T8GavrmNgDBujehJ5CD+M0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704110046; c=relaxed/simple; bh=AlInNtLePTK1UG4BEyQI6ElUdooy7h+EvxnKTQI8bds=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gMafTgd1oOwSpUktc4zxYnnpb4eCeQdRToOekDAG1rkAmmGBtGvsJCg9aayCf2loz+NadJqZYCcRa/RuzNcj6c8GuhcAx8kra4zUrsWLAoi0ttBivn2dTPCafZEirnYMYqe+wEZ70KSmQ8gITaYzhuwBCSWNpqe/ScW18ypPwxQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2cc7b9281d1so108657111fa.1 for ; Mon, 01 Jan 2024 03:54:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704110039; x=1704714839; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Lw0dws/OSqG5c2B3SapQE5v0vPFEokDpxmKvNZNi7Ws=; b=YB8toBPCvv6utHGAdrMtIWe/xpJOwX5Avtad9Im0nroqaOhz8l8nAk1Z3z3f+g9Jp/ QK5gMYE5hUH8RR3uY7aigqPFUtVHcwfD+8wRQrGlIXyCtzpMYbe5VkxyOqZdS7+gwnSf zBcrZyoImvNeClckEBE1e+dewzmVzyqn1ZmM+Rvm+BSd+8RxsGFc/m8QAlBx7vMmXbEa iWq7qWX2rD+YoKBH08UFtGHIa7LlaC3VlLeSklKlBICxrgPc2BWSyFwkpp/rZN8OkGiI Vi2tEwyuMrRR0HYKbprRhcOz5RSsrHZfzZJQJxWpcURowsV7Uprr17PZ2Ykc4p09x4hK 3bQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704110039; x=1704714839; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Lw0dws/OSqG5c2B3SapQE5v0vPFEokDpxmKvNZNi7Ws=; b=vXdWlu3WLVYdf4I7FgavNP6DjS56I8/IlY5zJ556U/G+YwMWjb3eM+v/9xvoF9npXM N4yPowOzjq+iFlMuB+ODI6h+RTOGF2GJc8etTc/8GoER/99vLBxH3RrJfSfXJ8BVmA9b 1h6JImhCPCXnaTAOb9YrpAvWCK7LEeH+DFEIpjWzy9uOb7iEMiez2E6tL+xBB1uUEQa4 I629SHiCrlKNI6zzIQNwEi3nyCDaLH5byA6fGdBGVGrgTDXjNcJSm3tskMw086p4c/WU 1Y+d0vs3q6gRV+AMp/F3LtMv0J4k6v0yCiVNO8vB+uZEe4HPfEHWeLsBURIVbJyBe+/J RS7g== X-Gm-Message-State: AOJu0YyznqrhKd7RWjG/0PHWeOH36WSYPzWH7cJZNZpvMg2RY9qu3P/G V2C3huX25PjZskcqr24OvGjaR/13DzQ= X-Received: by 2002:a05:651c:4cf:b0:2cc:f5fa:28ac with SMTP id e15-20020a05651c04cf00b002ccf5fa28acmr2114854lji.102.1704110038797; Mon, 01 Jan 2024 03:53:58 -0800 (PST) Received: from surface-pro-6.. ([2a00:1370:818c:b32f:8da1:ad5a:e55a:5cb0]) by smtp.gmail.com with ESMTPSA id ce26-20020a2eab1a000000b002ccbc09230csm3682109ljb.97.2024.01.01.03.53.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 03:53:58 -0800 (PST) From: Sergey Bugaev To: gcc-patches@gcc.gnu.org, bug-hurd@gnu.org Subject: [PATCH gcc 1/3] Move GNU/Hurd startfile spec from config/i386/gnu.h to config/gnu.h Date: Mon, 1 Jan 2024 14:53:54 +0300 Message-ID: <20240101115356.614446-1-bugaevc@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, 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 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: 1786892967476648000 X-GMAIL-MSGID: 1786892967476648000 Since it's not i386-specific; this makes it possible to reuse it for other architectures. Also, add a warning for the case gnu.h is specified before gnu-user.h, which would cause gnu-user's version of the spec to override gnu's, and not the other way around as it's intended. The i?86-gnu target currently specifies them in the right order, but it's easy to accidentally put them in a wrong order. Signed-off-by: Sergey Bugaev --- gcc/config/gnu.h | 16 ++++++++++++++++ gcc/config/i386/gnu.h | 11 ----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/gcc/config/gnu.h b/gcc/config/gnu.h index 97baea939..89904cd9b 100644 --- a/gcc/config/gnu.h +++ b/gcc/config/gnu.h @@ -31,3 +31,19 @@ along with GCC. If not, see . builtin_assert ("system=unix"); \ builtin_assert ("system=posix"); \ } while (0) + + +#ifndef GNU_USER_TARGET_STARTFILE_SPEC +# warning This file should be included after gnu-user.h, to override its STARTFILE_SPEC +#endif + +#undef STARTFILE_SPEC +#if defined HAVE_LD_PIE +#define STARTFILE_SPEC \ + "%{!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:crtbeginS.o%s;:crtbegin.o%s}" +#endif diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h index e776144f9..60244bfc8 100644 --- a/gcc/config/i386/gnu.h +++ b/gcc/config/i386/gnu.h @@ -24,17 +24,6 @@ along with GCC. If not, see . #undef GNU_USER_DYNAMIC_LINKER #define GNU_USER_DYNAMIC_LINKER "/lib/ld.so" -#undef STARTFILE_SPEC -#if defined HAVE_LD_PIE -#define STARTFILE_SPEC \ - "%{!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:crtbeginS.o%s;:crtbegin.o%s}" -#endif - #ifdef TARGET_LIBC_PROVIDES_SSP /* i386 glibc provides __stack_chk_guard in %gs:0x14. */