From: Li Zetao <lizetao1@huawei.com>
To: <linux-riscv@lists.infradead.org>
Cc: <dvyukov@google.com>, Kefeng Wang <wangkefeng.wang@huawei.com>,
<linux-kernel@vger.kernel.org>
Subject: riscv: link error when supporting KCSAN
Date: Wed, 12 Jun 2024 11:02:32 +0800 [thread overview]
Message-ID: <c740ef8f-1bb4-0c4a-4b88-77dab19f3e31@huawei.com> (raw)
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
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next reply other threads:[~2024-06-12 3:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-12 3:02 Li Zetao [this message]
2024-06-12 6:28 ` riscv: link error when supporting KCSAN Andrea Parri
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c740ef8f-1bb4-0c4a-4b88-77dab19f3e31@huawei.com \
--to=lizetao1@huawei.com \
--cc=dvyukov@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=wangkefeng.wang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox