From patchwork Wed May 3 10:55:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 89701 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1232203vqo; Wed, 3 May 2023 03:56:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7BDKCttm9PrhlPmQjXnE8OKkJPuqgPUH9f1ZwgKtAS06sY26xPcWx+PrDrsJzYN6nxfAs/ X-Received: by 2002:a17:907:3e83:b0:957:862a:9e6e with SMTP id hs3-20020a1709073e8300b00957862a9e6emr2994216ejc.73.1683111373873; Wed, 03 May 2023 03:56:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683111373; cv=none; d=google.com; s=arc-20160816; b=P21XzghGkHAVd3soTGVhYSmgH77BnQubJVdHxGxoBiaWuqZlwaRX3JrJKEdpuFEvBe 03l8ifaNFJQ4w/933nCaPPG1SOmrJ274ZtEAe4uceuPnUNuqoVRKh429Y5P+oOU9uddg n17qzJOTXjGuLH2pFlx3hgUh0H82Ko7w/b2gtBhlB7SewkvwBgK47Jh3sjCWUdEgBDBt +0zvYZb9eXBbVrloarn9/55JiDh6ttZn0MMFrNg6572qupcZ2gccyKxdgTNX00NbFoTg XHIu62n7ZLfGJbOdJjYcOzJSL+kIit2P3pXPUluMpTbS+7YzsL8M2H9VXbRwnEQYauCl u5Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:message-id:date:subject:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=VPpWCI2+62LgjcbQb8vd71EZV7rmh3+D9XdzPuD53p8=; b=pFo18urzYJ39mxwxcfGsCu1rlfwv8pSnbgLiReDP1ge8hTFrOJmYtGCE549QKEEB4t MgeUO7ZIQyhaVXbYI2a/8QDGoyAB06wCLyxyfKRyXI8KM/4d3U/k5Egxt8Jil9HZ/cyM xSCqJgw54+j2hLsTE8pjBkFTO/waL+oApctEFZTC6pJv0TlcShdDee0EdYh2FIBIZZ74 uARlpHi7gAa25RxM+AuzJeMz058FBY6IT4H/MR1tt8nntnTJfE8Lz9LbaKlEmoPOGd2n Ylrw8VlVteMymE/PDMqzYKSNGLDMEsIWeH0uGnZC6geHNmUN1G7W346vZgXbooVB2UF6 Sqpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ZiSwmwfr; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id hh15-20020a170906a94f00b0094f49e58a80si22101577ejb.685.2023.05.03.03.56.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 03:56:13 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ZiSwmwfr; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C14C63858289 for ; Wed, 3 May 2023 10:56:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C14C63858289 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683111372; bh=VPpWCI2+62LgjcbQb8vd71EZV7rmh3+D9XdzPuD53p8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ZiSwmwfra1rvEdh2+17XDXwATLsAt5YlrPUSlMWkjj6wVWsTlktdV7VHxUmoPqMU6 v2tP74gFePp+eDJevciBlljH5tsgbC5jIGUtf0FNJ172D5YB5yNah6ke8fQm0n3kNJ FbRfA6gE8YfpDbK1WyOkuDlpwDsTrhzB+7xuDeA0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 3F3F13858C33 for ; Wed, 3 May 2023 10:55:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3F3F13858C33 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 5458B2025F for ; Wed, 3 May 2023 10:55:28 +0000 (UTC) Received: from hawking.suse.de (unknown [10.168.4.11]) by relay2.suse.de (Postfix) with ESMTP id 4970A2C141 for ; Wed, 3 May 2023 10:55:28 +0000 (UTC) Received: by hawking.suse.de (Postfix, from userid 17005) id 3DA4E4AAD8C; Wed, 3 May 2023 12:55:28 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] riscv: Don't add -latomic with -pthread X-Yow: This ASIAGO-N-DRIED TOMATO combo would taste a lot better between two plastic SIPPER LIDS! Date: Wed, 03 May 2023 12:55:28 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andreas Schwab via Gcc-patches From: Andreas Schwab Reply-To: Andreas Schwab Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764870192425411459?= X-GMAIL-MSGID: =?utf-8?q?1764870192425411459?= 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 | 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" -/* 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" #define CPP_SPEC "%{pthread:-D_REENTRANT}"