Skip to content
diff -u --recursive gcc-8.4.0-vanilla/gcc/real.h gcc-8.4.0/gcc/real.h
--- gcc-8.4.0-vanilla/gcc/real.h 2020-03-04 02:30:01.000000000 -0600
+++ gcc-8.4.0/gcc/real.h 2022-05-18 17:02:22.708820427 -0500
@@ -70,8 +70,10 @@
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -77,8 +77,10 @@ struct GTY(()) real_value {
+ (REAL_VALUE_TYPE_SIZE%HOST_BITS_PER_WIDE_INT ? 1 : 0)) /* round up */
/* Verify the guess. */
......
From 203f3060dd363361b172f7295f42bb6bf5ac0b3b Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@suse.de>
Date: Sat, 23 Apr 2022 15:48:42 +0200
Subject: [PATCH] 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.
---
gcc/config/riscv/linux.h | 10 ----------
1 file changed, 10 deletions(-)
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -35,16 +35,6 @@ along with GCC; see the file COPYING3.
#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}"