Skip to content

Commit 508bd4d

Browse files
committed
guix: adjust RISC-V __has_include() patch to work with GCC 10
The actual macro is __has_include(), not __has_include__(), using the later would result in build failures when using GCC 10. i.e: ```bash ../sysdeps/unix/sysv/linux/riscv/flush-icache.c:24:5: warning: "__has_include__" is not defined, evaluates to 0 [-Wundef] 24 | #if __has_include__ (<asm/syscalls.h>) ``` Looks like at least someone else has run into the same thing, see: http://lists.busybox.net/pipermail/buildroot/2020-July/590376.html. See also: https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005finclude.html https://clang.llvm.org/docs/LanguageExtensions.html#has-include
1 parent c9c5b30 commit 508bd4d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

contrib/guix/manifest.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ inspecting signatures in Mach-O binaries.")
553553
(base32
554554
"1b2n1gxv9f4fd5yy68qjbnarhf8mf4vmlxk10i3328c1w5pmp0ca"))
555555
(patches (search-our-patches "glibc-ldd-x86_64.patch"
556-
"glibc-2.27-riscv64-Use-__has_include__-to-include-asm-syscalls.h.patch"))))))
556+
"glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch"))))))
557557

558558
(packages->manifest
559559
(append

contrib/guix/patches/glibc-2.27-riscv64-Use-__has_include__-to-include-asm-syscalls.h.patch renamed to contrib/guix/patches/glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Note that this has been modified from the original commit, to use __has_include
2+
instead of __has_include__, as the later was causing build failures with GCC 10.
3+
See also: http://lists.busybox.net/pipermail/buildroot/2020-July/590376.html.
4+
15
https://sourceware.org/git/?p=glibc.git;a=commit;h=0b9c84906f653978fb8768c7ebd0ee14a47e662e
26

37
From 562c52cc81a4e456a62e6455feb32732049e9070 Mon Sep 17 00:00:00 2001
@@ -59,7 +63,7 @@ index d612ef4c6c..0b2042620b 100644
5963
#include <atomic.h>
6064
#include <sys/cachectl.h>
6165
-#include <asm/syscalls.h>
62-
+#if __has_include__ (<asm/syscalls.h>)
66+
+#if __has_include (<asm/syscalls.h>)
6367
+# include <asm/syscalls.h>
6468
+#else
6569
+# include <asm/unistd.h>

0 commit comments

Comments
 (0)