From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 62C023858D1E for ; Wed, 17 May 2023 09:22:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 62C023858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-643a6f993a7so351192b3a.1 for ; Wed, 17 May 2023 02:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684315362; x=1686907362; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=M02bD1sd5X0qxn93g2aisRJWOdWjemEgE2mzCp69isY=; b=RsFtiWJvuM/8UDndx4cDK1gX9NHbEXs0uQkW11i0kvLVmK0TrTj9KGKscmhyH6SmhU GvmhOR0tn7jb4o34xfKrfHcYZ/Cm4kqqdum1S9sAeyAPjfNAEE7cQHZ1RvsFEvACt2Jj KxqTg98PTY3mLDH3fCCX1iQ82zZY6CrD8dJNSDoBn2PEgkhQaHKNZTwaLCEjPLYVuXSP PIKI4BsfWBYDH5hNim8Ft+XjeSFQj0fcsp7q4EMzlXo1FWeVO7IMQMSYynDggmUCKy8V WfkMBXaudKSTgPJddWCm+RDjJMY4Lo60lryUFf17nT3O/eSs9arRgiXbvYEpkn4mCN0y egTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684315362; x=1686907362; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=M02bD1sd5X0qxn93g2aisRJWOdWjemEgE2mzCp69isY=; b=XLUHSzb3hNjkH2aI7sUeIuDwZpQJEiB9XJ2X9ZkVmdDmqe/ytC2ifDnr6bWRU9B1Yb 5KozOCFXBFfkPGWACjiu2DrjLidWUGYW8of+7bPCkY4qB2vIeY/QyyPtT8KPszG1s+IC 6iY6YxqehrJpiInhM/S5oErkHdq0MeA5yQKmz5pLxFyyD2R47nBhjv42VhNdD+aJmxHS yjjp0XAuqmPDQ/XCCnqDblewY9Pfq7clj+1w6T7iQEMeQ1EIDNY9unOqv4jXZikI1EwB 2oMpZ6oY4aSyp/LOQOTZlS7ImfvDG67otmxZGO1MtNpPt7+QrFFT8dWGX0ii1XfU56Hy REvA== X-Gm-Message-State: AC+VfDyOBqIbJxg0YaAWbpKesebF/d1vDL4atI8Et44rhPg0LZTtTz9i cF09L4b8XMfd/STV68T/t69we2DqKE7KIt/6 X-Google-Smtp-Source: ACHHUZ6WRw8W0rbEi0WtPZPWveL8pwLF5pH/37uPhFtbPW4VNgnOYBQ/RuLJMaQx7+ioTlbP7OCwJg== X-Received: by 2002:a05:6a00:218c:b0:645:fc7b:63db with SMTP id h12-20020a056a00218c00b00645fc7b63dbmr153722pfi.20.1684315362033; Wed, 17 May 2023 02:22:42 -0700 (PDT) Received: from debian ([47.242.94.15]) by smtp.gmail.com with ESMTPSA id r20-20020a63ec54000000b005305023fed7sm13704937pgj.74.2023.05.17.02.22.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 02:22:41 -0700 (PDT) Date: Wed, 17 May 2023 17:22:38 +0800 From: Bo YU To: gcc-patches@gcc.gnu.org Cc: palmer@rivosinc.com, kito.cheng@sifive.com, jeffreyalaw@gmail.com, jiawei@iscas.ac.cn Subject: [PATCH 13-backport] riscv/linux: Don't add -latomic with -pthread Message-ID: <20230517092238.imdawv4fkhu466bf@debian> X-PGP-Key: https://github.com/yuzibo/yuzibo.github.io/blob/master/_includes/subkey-signing-06-18-143E4BAF-pub.asc MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="356gczsszaha46vy" Content-Disposition: inline X-Spam-Status: No, score=-9.4 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: --356gczsszaha46vy Content-Type: multipart/mixed; boundary="w3e5j3jvceleudv5" Content-Disposition: inline --w3e5j3jvceleudv5 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, I just want to backport the commit to gcc-13 branch: commit 203f3060dd363361b172f7295f42bb6bf5ac0b3b Author: Andreas Schwab Date: Sat Apr 23 15:48:42 2022 +0200 riscv/linux: Don't add -latomic with -pthread Now that we have support for inline subword atomic operations, it is no longer necessary to link against libatomic. This also fixes testsuite failures because the framework does not properly set up the linker fla= gs for finding libatomic. The use of atomic operations is also independent of the use of libpthr= ead. gcc/ * config/riscv/linux.h (LIB_SPEC): Don't redefine. The discussion is here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104338#c20 --=20 Regards, -- Bo YU --w3e5j3jvceleudv5 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-riscv-linux-Don-t-add-latomic-with-pthread.patch" Content-Transfer-Encoding: quoted-printable =46rom d376ec41a9affa946df4676c3bf81118d122f281 Mon Sep 17 00:00:00 2001 =46rom: Andreas Schwab Date: Sat, 23 Apr 2022 15:48:42 +0200 Subject: [PATCH 13-backport] riscv/linux: Don't add -latomic with -pthread Now that we have support for inline subword atomic operations, it is no longer necessary to link against libatomic. This also fixes testsuite failures because the framework does not properly set up the linker flags for finding libatomic. The use of atomic operations is also independent of the use of libpthread. gcc/ * config/riscv/linux.h (LIB_SPEC): Don't redefine. (cherry picked from commit 203f3060dd363361b172f7295f42bb6bf5ac0b3b) --- gcc/config/riscv/linux.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h index b9557a75dc7..2fdfd930cf2 100644 --- a/gcc/config/riscv/linux.h +++ b/gcc/config/riscv/linux.h @@ -35,16 +35,6 @@ along with GCC; see the file COPYING3. If not see #undef MUSL_DYNAMIC_LINKER #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-riscv" XLEN_SPEC MUSL_ABI_SUFFIX= ".so.1" =20 -/* Because RISC-V only has word-sized atomics, it requries libatomic where - others do not. So link libatomic by default, as needed. */ -#undef LIB_SPEC -#ifdef LD_AS_NEEDED_OPTION -#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC \ - " %{pthread:" LD_AS_NEEDED_OPTION " -latomic " LD_NO_AS_NEEDED_OPTION "}" -#else -#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC " -latomic " -#endif - #define ICACHE_FLUSH_FUNC "__riscv_flush_icache" =20 #define CPP_SPEC "%{pthread:-D_REENTRANT}" --=20 2.39.2 --w3e5j3jvceleudv5-- --356gczsszaha46vy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEIcmhjYVTlmab0tjp+RVP3hQ+S68FAmRknM0ACgkQ+RVP3hQ+ S68dWg/7BoPnsvYAx8Q3LzQmsWZR6ioC7nkI78M3m1dVDd8TYw6Ar4Ds/85TlMg0 puDFTZ/hL3w8Di9g7zClAn9fZNUHDkP23sIAEvtKcoHDLmj33lE3YxOo6cQaOPYC 36KQ1QqTY+XcG/Drq/57j7J77rCQUa6jEmL6lencU863Oz20AHOSQyhhhcI9VBx9 zDuZF4t/rvJQjCZF+9I/TzV3/xH1T91riDsHUeWtOlGf6X3AUtZS5x0ZMWbvpiIY al2xPy3UiBJD77jmx1Kj2QcHIdsTGR1wzI2uPgFGMMS1G0lIPW0s8EQv+QMk+4kf hAeQYDercZGCj6v9FSBK/qFqYtAngpIY3+kB+PQs3/BJU14CZAmNRjUosZGhEiln AqytW2RSYLJ7hhCEbY2TjezudK5PCu2ROr46FkZPXJYMBjZZdoj1Vry8JgCAbb9j UbjeptX9sECXQGfa6H2nNXNUe19bW+JWIWS+BMzLnQB+DAYF5jE8WyfGJNQKRxvu r7f/eUuQaqfZOUF8EL75laxZGMod46yixEHQUN0uDOm0NM5+QqDUZCmsJcKVgjih KJpbTFFdtrztKRYi5bLI0dXomF1ph64eTSN6UdtiHG6NYMkOTDOVtYH9pQPwa3IK MMvZ5Z73yK7KWR4fu8G1kilHGKSvJBfjy9IGCqwIXxbgplBhiZw= =NpCB -----END PGP SIGNATURE----- --356gczsszaha46vy--