pmaports/cross/gcc-aarch64/0051-libgo-Explicitly-define-SYS_timer_settime-for-32-bit.patch
2022-09-30 17:31:59 -07:00

36 lines
1.1 KiB
Diff

From d53e8a0e94e34dc609e34dd5e404debda2640cfb Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Sat, 30 Jul 2022 07:29:28 -0700
Subject: [PATCH] libgo: use SYS_timer_settime32
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Musl defines SYS_timer_settime32, not SYS_timer_settime, on 32-bit systems.
Based on patch by Sören Tempel.
Change-Id: I1f3485028d132ceca1aba595325af24b4d72b894
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/420222
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
---
libgo/sysinfo.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
index fc021099..180f5c31 100644
--- a/libgo/sysinfo.c
+++ b/libgo/sysinfo.c
@@ -354,6 +354,11 @@ enum {
};
#endif
+#if !defined(SYS_timer_settime) && defined(SYS_timer_settime32)
+// musl defines SYS_timer_settim32 on 32-bit systems.
+#define SYS_timer_settime SYS_timer_settime32
+#endif
+
#if defined(HAVE_LOFF_T)
// loff_t can be defined as a macro; for -fgo-dump-spec make sure we
// see a typedef.