From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by sourceware.org (Postfix) with ESMTPS id C3C913858D28 for ; Sat, 23 Mar 2024 14:35:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C3C913858D28 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 C3C913858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::134 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711204525; cv=none; b=ZcTvduESTQMrmgtx3f3EP91OJNjYtBpRhLoRe5qKyUi48OTPbHvniyaL3/wdbrHZRKmkVYe/K3580LLYqf8yTZMaHsMRIMa5WBsOX2PoK/8o6crGWk0ehTTnpIVNlVIIZr6btbx8BynF31DsoL9u5YhrfLGruZwckcdtejrdY0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711204525; c=relaxed/simple; bh=9BoteMuiF9g0Rw2zuMzUqm+twEhZCf42GKB0lJcXC7Q=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fewJCRenZlXc5w00kuqCjKogKsLOa0+ulAcK7P3B4ZDZGYfO6am8gqD31Cn9h7Wao4SWVvuuu2OHOSXD1eBZ7iDEZxfBS24loR0ucqO4IEAmdu5TRLxLzmtA2zK5cu47XkafvmSi8KHsjn7pASxfo/H2fV71kGi12dRLZ1a9sAM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-513e89d0816so3821719e87.0 for ; Sat, 23 Mar 2024 07:35:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711204521; x=1711809321; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=lCW6B+dizEXXMOMr/VkwaydEC436puQHi12+l/Toeqg=; b=THIxsE73FWMEASh6dF1lXad2q3KlqmwjtsjYJzL+rFPtPxxAvQcgqfCNeAxgstpWgy nP4ZbCijc9FhuHW4gQ9G4MYMD/kpUPg1GGEkgL6DDMbHCN3P5z35euDCjOtL/fIOAM0R gl2cZz3n+fzKxRh4hPeXYDeBo7mHjpqLC/Siy8uoqZJPgD8APTPKUtPXtbvCp7FVbm+U ITGS5GqmclesHoPbZJcheyz6hM7+S3SOgmP/gLo24I/I0XdgzGu2AitaobCI53s1YZTS dJJwUhqLGDDHmSRnBBRs9eoMiuZx5ozMu8NKJX+iBQXEZauHjbvWg+kNcyd9dxVEm88E 8+8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711204521; x=1711809321; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lCW6B+dizEXXMOMr/VkwaydEC436puQHi12+l/Toeqg=; b=VPVM1uh+59DstWl8tShr48VTByewRt3O3c6mPkJB3RBEdFU7DWkZhINNMexXHqExOV WLYGt8QmvgK2qriefqkejtKPZDHXFNy4DPb2/2Jk5VoNj0q/HE5gbg1XEAyEBZajfze8 7w1SPObb3cweHiimdDbLh0h4RvfDM59grM3rLIWyxcyytEE43eB6ZRHFRlO8xdkiimLc yMudXFr2poQj9tn43ntm4RmUqRCsXBuuSDgoMwODQZ6ImN9F1iC35LD6vYA4b9Pa9roz +LhlQXn5RVkyRufDeyX1Q/jqyqC3f1ojVsggKH3Xxir/ryYYDvesI0a012ynq4QeE2dZ UhQg== X-Gm-Message-State: AOJu0YzIB5Ks1fbH69DHNJ1izXRhD6gvOzxwNyLzLNYgb7cUMUtm16NI tpFANjSGa5vp0Xr8DiIyDoWVKbOeW8q50ve9J1KmFuWRWbWD5xQ7g8agGFLY X-Google-Smtp-Source: AGHT+IFLZbzXGFy6+Yogzwa8X680j4hNXSdK1+WXezT1oTpC/vdclkf5rBN0c/Bp/t8ivzjujQKNxQ== X-Received: by 2002:ac2:546e:0:b0:515:9475:512d with SMTP id e14-20020ac2546e000000b005159475512dmr1377244lfn.28.1711204520297; Sat, 23 Mar 2024 07:35:20 -0700 (PDT) Received: from localhost.localdomain ([2a02:2168:b216:4700:7eaf:f2aa:b4d0:13e9]) by smtp.gmail.com with ESMTPSA id x12-20020ac25dcc000000b00513e4914c74sm309844lfq.225.2024.03.23.07.35.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 07:35:19 -0700 (PDT) From: Sergey Bugaev To: gcc-patches@gcc.gnu.org Cc: bug-hurd@gnu.org, Thomas Schwinge , Richard Sandiford Subject: [PATCH v2 1/3] Move GNU/Hurd startfile spec from config/i386/gnu.h to config/gnu.h Date: Sat, 23 Mar 2024 17:35:11 +0300 Message-ID: <20240323143513.120786-1-bugaevc@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.3 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 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. gcc/Changelog: * config/i386/gnu.h: Move GNU/Hurd STARTFILE_SPEC from here... * config/gnu.h: ...to here. 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 ac99f7605..e2a33baf0 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 3f42714d1..af1d55887 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.44.0