| [chrony-dev] [PATCH] sys_linux: Fix build failure on ARM Cortex-A9 | 
[ Thread Index | 
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
] 
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: [chrony-dev] [PATCH] sys_linux: Fix build failure on ARM Cortex-A9
- From: James Raphael Tiovalen <jamestiotio@xxxxxxxxx>
- Date: Tue,  5 Sep 2023 14:11:06 +0800
- Cc: James Raphael Tiovalen <jamestiotio@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=20221208; t=1693894272; x=1694499072; darn=chrony.tuxfamily.org;        h=content-transfer-encoding:mime-version:message-id:date:subject:cc         :to:from:from:to:cc:subject:date:message-id:reply-to;        bh=G/ejZX1Avbn/MVBB78SpVYXebGCALV/sJHQB3/LFyHU=;        b=OFyEYgQM2NozRr0MuiNsXtdmCR1X0BgkPQ3Ov5+URnLSXgfp7MZTvfJEXxsy4aTMPp         V/esY11dSkM4mbY8GTmVJg1dKqvKcQOd16UZ1FOOpOAjZ67oXQ5trbMsYZa22lJFtSqP         13G1xpUa81YpwL3r+Ax9yzUSp4Ntkbp+OvZ4u+k4ZJQh2VNAm5qiDdiXhz91ug3PnPcl         33sD2cGZKrxW63VX3XW+cnEVXaeaETZNw6LgBVloQU6v0FfUEtywU1vxU3HjC46/L5h6         RakfSxeMJlSwJyda5Bgcdpfq3AN2hJOPEySoTz+zkX4Q044sAexX1H35yHSZ4LL9BXAH         utbA==
Guard references to syscalls not available on 32-bit ARM EABI
(__ARM_EABI__).
Signed-off-by: James Raphael Tiovalen <jamestiotio@xxxxxxxxx>
---
 sys_linux.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff --git a/sys_linux.c b/sys_linux.c
index 6849637..ce91dc9 100644
--- a/sys_linux.c
+++ b/sys_linux.c
@@ -485,7 +485,9 @@ SYS_Linux_EnableSystemCallFilter(int level, SYS_ProcessContext context)
 #endif
     SCMP_SYS(gettimeofday),
     SCMP_SYS(settimeofday),
+#ifdef __NR_time
     SCMP_SYS(time),
+#endif
 
     /* Process */
     SCMP_SYS(clone),
@@ -495,7 +497,9 @@ SYS_Linux_EnableSystemCallFilter(int level, SYS_ProcessContext context)
     SCMP_SYS(exit),
     SCMP_SYS(exit_group),
     SCMP_SYS(getpid),
+#ifdef __NR_getrlimit
     SCMP_SYS(getrlimit),
+#endif
     SCMP_SYS(getuid),
     SCMP_SYS(getuid32),
 #ifdef __NR_membarrier
@@ -510,12 +514,16 @@ SYS_Linux_EnableSystemCallFilter(int level, SYS_ProcessContext context)
     SCMP_SYS(set_tid_address),
     SCMP_SYS(sigreturn),
     SCMP_SYS(wait4),
+#ifdef __NR_waitpid
     SCMP_SYS(waitpid),
+#endif
 
     /* Memory */
     SCMP_SYS(brk),
     SCMP_SYS(madvise),
+#ifdef __NR_mmap
     SCMP_SYS(mmap),
+#endif
     SCMP_SYS(mmap2),
     SCMP_SYS(mprotect),
     SCMP_SYS(mremap),
@@ -539,7 +547,9 @@ SYS_Linux_EnableSystemCallFilter(int level, SYS_ProcessContext context)
     SCMP_SYS(lseek),
     SCMP_SYS(lstat),
     SCMP_SYS(lstat64),
+#ifdef __NR_newfstatat
     SCMP_SYS(newfstatat),
+#endif
     SCMP_SYS(readlink),
     SCMP_SYS(readlinkat),
     SCMP_SYS(rename),
@@ -576,7 +586,9 @@ SYS_Linux_EnableSystemCallFilter(int level, SYS_ProcessContext context)
     SCMP_SYS(sendto),
     SCMP_SYS(shutdown),
     /* TODO: check socketcall arguments */
+#ifdef __NR_socketcall
     SCMP_SYS(socketcall),
+#endif
 
     /* General I/O */
     SCMP_SYS(_newselect),
@@ -600,7 +612,9 @@ SYS_Linux_EnableSystemCallFilter(int level, SYS_ProcessContext context)
 #ifdef __NR_futex_time64
     SCMP_SYS(futex_time64),
 #endif
+#ifdef __NR_select
     SCMP_SYS(select),
+#endif
     SCMP_SYS(set_robust_list),
     SCMP_SYS(write),
     SCMP_SYS(writev),
-- 
2.42.0
-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.