From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Google-Smtp-Source: AGHT+IGoSIdLmQsX9LspsHtMTyVqqKQlV+lrqknFIS7C+LRCTNf5IWgwDEvFWWYaa2+iM7bMUDSCpQ== 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 Content-Transfer-Encoding: 8bit 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 List-Id: 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. */ -- 2.43.0