From 2caf855f4fc6a9d250ed4008d1b7004584df64fb Mon Sep 17 00:00:00 2001
From: Yixun Lan <dlan@gentoo.org>
Date: Wed, 20 Apr 2022 07:51:35 +0800
Subject: [PATCH] use -pthread to fix the missing atomic issue
Due to no 1, 2byte atomic instructions in RISC-V hardware,
the software layer have to emulate relavant function in atomic library
And in RISC-V platform, the flag "-pthread" will exapnd
link option with "--push-state --as-needed -latomic --pop-state"
So, this will effectively fix the atomic issue.
https://github.com/riscv-collab/riscv-gcc/issues/12 use Option 4
https://stackoverflow.com/questions/23250863/difference-between-pthread-and-lpthread-while-compiling
Signed-off-by: Yixun Lan <dlan@gentoo.org>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 14bb5d0..da45769 100644
a
|
b
|
AC_CHECK_DECLS([pthread_condattr_setclock], [], [], [[#include <pthread.h>]])
|
120 | 120 | if test "$windows" = "1"; then |
121 | 121 | libdeps="-lws2_32" |
122 | 122 | else |
123 | | libdeps=-lpthread |
| 123 | libdeps=-pthread |
124 | 124 | CHECK_ICONV([libdeps="$libdeps -liconv"]) |
125 | 125 | |
126 | 126 | CHECK_RANDOM |