Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp179083lqp; Tue, 11 Jun 2024 20:02:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXpqjZpnI2lvpNSCFUk08uCtXJRwgb2iNKsM9A9kdaqteKBcXaAAgsB6rycg2Jub7WhQXmnmzsIA2BJdOYZMFsYdxiFwC46IfGRTYHtMg== X-Google-Smtp-Source: AGHT+IE4li6L0/NKagnsQ4/9lP1jjKSRCOnfgwxJAY8FJj4APtiKLg+k6SIwcNfnZbioceVwKgCJ X-Received: by 2002:a17:903:2282:b0:1f6:a43f:5b38 with SMTP id d9443c01a7336-1f83b5178a1mr6814255ad.4.1718161372109; Tue, 11 Jun 2024 20:02:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718161372; cv=pass; d=google.com; s=arc-20160816; b=XwHuRI5wEHobdx6U00iSDc8vw3R++FXICfsoUmQCon/VSPM578wApJy3K8ibAII2/L GND1SmDYyb3LGcPanHHC/iIDLoTqqir+3533GxxHuUWF86ZSHa9MqZCSbV/1NobwREoD orQPhV/oPFsmY2I0t23Ieu4PG8KyNTQ9WKAy+Tify+Y4CyqLxDBILt/jbsCHeRVWS0Qp 78UI7ZMxgastE1jvJneFZ684YcpiX5jEWlqv2rxZcNlDmwAW0ZhCEJqif/sCahTTWM9r EFIEX84p84VH7+SvtX2LN45ejftNGE0p3ObK1p3JHCeM0zwmIPtQdX0a3pDt3+9ubWEI +i9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:from:content-language :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id; bh=siZTD0brAvlSOjTlMEz+NarGEdWw0JVrd24lJ98gjpc=; fh=V5Wl53aScqTCuWgkQknI9HBLmtxcDs3UTSIKutc4Jxg=; b=U8rkGYBs/XeKyqCotoP4UrNjSS+IL/WkA68Jh8Y8hlOvjUhmP5LDkgbY7tOtKvzUDd rR2upanGa1zdObAebBHwdqRs5WG/JQfsg5snRtY6kl3q76NLFSKr0M1/E0y+RXlyjnQQ 0l6vFm0e5ARigAfU9d2eL0ZOFYfUa9UjnFlpAQN/0gdzLN2wvn8G9OUnwYxXUcm7Tf+x bIpvDoipFGjIGekNYttna0IPEkzoqmfxp6XlcyLagNCNVypf1KS32cGhafsye7wC4Dse i599cLbm7uWKd3ihLidq/6mF56ltvqlhGzxXv11rA2xiZ+tc/FlTMFlxMqd/+FlUso93 LjOQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-210847-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210847-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f731711f68si23048735ad.599.2024.06.11.20.02.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 20:02:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210847-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-210847-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210847-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BAF6B282A6D for ; Wed, 12 Jun 2024 03:02:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF5CA1799B; Wed, 12 Jun 2024 03:02:46 +0000 (UTC) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0017811182 for ; Wed, 12 Jun 2024 03:02:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.255 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718161366; cv=none; b=HZ8/bBpx4mTdryk80F9t74E6XxuA+mVLYiMcxqTX1H64lVNkIO4xtQOkkjeatQWPBAL8jF+x3x4uF81WmTI2CnKlQeRaQFzX9JdIyJIn+3bd9BY2mFAzTg+4z6zULX8+2kEG7mhT1Ys3cUFPgXupqNtGcrxUZgoW1O4VNc5eW3Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718161366; c=relaxed/simple; bh=z7SFNGqX2BtgFOLZtTPrHEcCw9sjTaEi9gADm24RfGk=; h=Message-ID:Date:MIME-Version:From:Subject:To:CC:Content-Type; b=hsWm0D9BGMQuMTWMHraQMVSwwjdPmQMu/rwS/6C9MyQbMQKaJCU/OlAojreIjCkY6mfyS4YQteRplxbGNNP8AliqGuwztbxvDIpjXKIjY+No2lYm4YsmUQZk52gyOAS+/AmqB1Rd2yTMv5wMzm99gnh2BuJBwUIX7EDgd4Exqsk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.255 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4VzVbm3Snxz1SC4h; Wed, 12 Jun 2024 10:58:28 +0800 (CST) Received: from kwepemd500012.china.huawei.com (unknown [7.221.188.25]) by mail.maildlp.com (Postfix) with ESMTPS id B4A56140EEF; Wed, 12 Jun 2024 11:02:33 +0800 (CST) Received: from [10.67.111.176] (10.67.111.176) by kwepemd500012.china.huawei.com (7.221.188.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Wed, 12 Jun 2024 11:02:33 +0800 Message-ID: Date: Wed, 12 Jun 2024 11:02:32 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Content-Language: en-US From: Li Zetao Subject: riscv: link error when supporting KCSAN To: CC: , Kefeng Wang , Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggpeml100015.china.huawei.com (7.185.36.168) To kwepemd500012.china.huawei.com (7.221.188.25) Hi all, I'm developing support for KCSAN on riscv but getting the following link error: riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L996': core.c:(.text+0x2b62): undefined reference to `__atomic_exchange_1' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1015': core.c:(.text+0x2c40): undefined reference to `__atomic_fetch_add_1' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1034': core.c:(.text+0x2d1e): undefined reference to `__atomic_fetch_sub_1' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1053': core.c:(.text+0x2dfc): undefined reference to `__atomic_fetch_and_1' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1071': core.c:(.text+0x2eda): undefined reference to `__atomic_fetch_or_1' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1090': core.c:(.text+0x2fb8): undefined reference to `__atomic_fetch_xor_1' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1109': core.c:(.text+0x3096): undefined reference to `__atomic_fetch_nand_1' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1128': core.c:(.text+0x3182): undefined reference to `__atomic_compare_exchange_1' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1147': core.c:(.text+0x3274): undefined reference to `__atomic_compare_exchange_1' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1166': core.c:(.text+0x3366): undefined reference to `__atomic_compare_exchange_1' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1220': core.c:(.text+0x35ec): undefined reference to `__atomic_exchange_2' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1239': core.c:(.text+0x36ce): undefined reference to `__atomic_fetch_add_2' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1258': core.c:(.text+0x37b0): undefined reference to `__atomic_fetch_sub_2' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1277': core.c:(.text+0x3892): undefined reference to `__atomic_fetch_and_2' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1296': core.c:(.text+0x3974): undefined reference to `__atomic_fetch_or_2' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1315': core.c:(.text+0x3a56): undefined reference to `__atomic_fetch_xor_2' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1334': core.c:(.text+0x3b38): undefined reference to `__atomic_fetch_nand_2' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1353': core.c:(.text+0x3c28): undefined reference to `__atomic_compare_exchange_2' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1372': core.c:(.text+0x3d1e): undefined reference to `__atomic_compare_exchange_2' riscv64-linux-gnu-ld: kernel/kcsan/core.o: in function `.L1391': core.c:(.text+0x3e14): undefined reference to `__atomic_compare_exchange_2' make[2]: *** [scripts/Makefile.vmlinux:34: vmlinux] Error 1 make[1]: *** [/home/l00517538/PrIntFuzz/third_party/linux/Makefile:1171: vmlinux] Error 2 The reason for the error is that riscv only supports 32-bit or 64-bit atomic operations.As far as I know, this error is solved through the no-outline-atomics option on arm64. How can I solve this problem on riscv? Best regards, Li Zetao