Control: tags -1 patch

Hi,

On 30.01.2014 13:30, Roland Stigge wrote:
clamav FTBFS on powerpc (and other arches) like this:

...
   CC     fan.o
In file included from fan.c:38:0:
fan-syscalllib.h:14:3: error: #error "System call numbers not defined for this 
architecture"
  # error "System call numbers not defined for this architecture"
    ^
fan-syscalllib.h: In function 'fanotify_init':
fan-syscalllib.h:19:17: error: '__NR_fanotify_init' undeclared (first use in 
this function)
   return syscall(__NR_fanotify_init, flags, event_f_flags);
                  ^

This happened also on Rasbian [1], where it got fixed for arm.
The attached patch should fix it for Debian build architectures, but I have not tested it. I took the numbers from [2].

If this patch works, it would be good if it got forwarded to upstream.

Best regards,
Andreas

1: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=41&t=65937
2: http://codesearch.debian.net/search?q=package%3Alinux+__NR_fanotify_init

diff -ru clamav-0.98+dfsg.orig/clamd/fan-syscalllib.h clamav-0.98+dfsg/clamd/fan-syscalllib.h
--- clamav-0.98+dfsg.orig/clamd/fan-syscalllib.h	2013-09-16 21:28:14.000000000 +0200
+++ clamav-0.98+dfsg/clamd/fan-syscalllib.h	2014-01-31 18:11:57.214083037 +0100
@@ -10,6 +10,37 @@
 #elif defined(__i386__)
 # define __NR_fanotify_init	338
 # define __NR_fanotify_mark	339
+#elif defined(__thumb__) || defined(__ARM_EABI__)
+# define __NR_fanotify_init 367
+# define __NR_fanotify_mark 368
+#elif defined(__arm64__)
+# define __NR_fanotify_init 262
+# define __NR_fanotify_mark 263
+#elif defined(__ia64__)
+# define __NR_fanotify_init 1323
+# define __NR_fanotify_mark 1324
+#elif defined _MIPS_SIM
+# if _MIPS_SIM == _MIPS_SIM_ABI32
+#  define __NR_fanotify_init 4336
+#  define __NR_fanotify_mark 4337
+# elif _MIPS_SIM == _MIPS_SIM_ABI64
+#  define __NR_fanotify_init 5295
+#  define __NR_fanotify_mark 5296
+# elif _MIPS_SIM == _MIPS_SIM_NABI32
+#  define __NR_fanotify_init 6300
+#  define __NR_fanotify_mark 6301
+# else
+#  error "Unknown _MIPS_SIM; can't define system call numbers"
+# endif
+#elif defined(__powerpc__)
+# define __NR_fanotify_init 323
+# define __NR_fanotify_mark 324
+#elif defined(__s390x__)
+# define __NR_fanotify_init 332
+# define __NR_fanotify_mark 333
+#elif defined(__sparc__)
+# define __NR_fanotify_init 329
+# define __NR_fanotify_mark 330
 #else
 # error "System call numbers not defined for this architecture"
 #endif

Reply via email to