[compiler-rt] 3a200f3 - [compiler-rt] Fix build on NetBSD 9.99.44

Kamil Rytarowski via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 05:57:35 PST 2020


Author: Kamil Rytarowski
Date: 2020-01-31T14:57:20+01:00
New Revision: 3a200f3f2e52e671b8d9911e3724d6b11dbbbe08

URL: https://github.com/llvm/llvm-project/commit/3a200f3f2e52e671b8d9911e3724d6b11dbbbe08
DIFF: https://github.com/llvm/llvm-project/commit/3a200f3f2e52e671b8d9911e3724d6b11dbbbe08.diff

LOG: [compiler-rt] Fix build on NetBSD 9.99.44

Fix build on >= 9.99.44 after the removal of urio(4).
Add compat code for the device as NetBSD-9.0 is supported.

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
    compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
    compiler-rt/utils/generate_netbsd_ioctls.awk

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc b/compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
index d0cc4da9755f..576807ea3a6a 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
@@ -446,9 +446,6 @@ static void ioctl_table_fill() {
   _(STICIO_STOPQ, NONE, 0);
   /* Entries from file: dev/usb/ukyopon.h */
   _(UKYOPON_IDENTIFY, WRITE, struct_ukyopon_identify_sz);
-  /* Entries from file: dev/usb/urio.h */
-  _(URIO_SEND_COMMAND, READWRITE, struct_urio_command_sz);
-  _(URIO_RECV_COMMAND, READWRITE, struct_urio_command_sz);
   /* Entries from file: dev/usb/usb.h */
   _(USB_REQUEST, READWRITE, struct_usb_ctl_request_sz);
   _(USB_SETDEBUG, READ, sizeof(int));
@@ -1405,6 +1402,9 @@ static void ioctl_table_fill() {
   /* Entries from file: dev/filemon/filemon.h (compat <= 9.99.26) */
   _(FILEMON_SET_FD, READWRITE, sizeof(int));
   _(FILEMON_SET_PID, READWRITE, sizeof(int));
+  /* Entries from file: dev/usb/urio.h (compat <= 9.99.43) */
+  _(URIO_SEND_COMMAND, READWRITE, struct_urio_command_sz);
+  _(URIO_RECV_COMMAND, READWRITE, struct_urio_command_sz);
 #undef _
 } // NOLINT
 

diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
index 48a78c8998a2..066502bd0099 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
@@ -190,7 +190,21 @@
 #include <dev/sun/vuid_event.h>
 #include <dev/tc/sticio.h>
 #include <dev/usb/ukyopon.h>
+#if !__NetBSD_Prereq__(9, 99, 44)
 #include <dev/usb/urio.h>
+#else
+struct urio_command {
+  unsigned short length;
+  int request;
+  int requesttype;
+  int value;
+  int index;
+  void *buffer;
+  int timeout;
+};
+#define URIO_SEND_COMMAND      _IOWR('U', 200, struct urio_command)
+#define URIO_RECV_COMMAND      _IOWR('U', 201, struct urio_command)
+#endif
 #include <dev/usb/usb.h>
 #include <dev/usb/utoppy.h>
 #include <dev/vme/xio.h>

diff  --git a/compiler-rt/utils/generate_netbsd_ioctls.awk b/compiler-rt/utils/generate_netbsd_ioctls.awk
index 0d3f01a54b65..29840c99068f 100755
--- a/compiler-rt/utils/generate_netbsd_ioctls.awk
+++ b/compiler-rt/utils/generate_netbsd_ioctls.awk
@@ -256,6 +256,8 @@ END {
   # Add compat entries
   add_compat("dev/filemon/filemon.h (compat <= 9.99.26)", "FILEMON_SET_FD", "READWRITE", "sizeof(int)")
   add_compat("", "FILEMON_SET_PID", "READWRITE", "sizeof(int)")
+  add_compat("dev/usb/urio.h (compat <= 9.99.43)", "URIO_SEND_COMMAND", "READWRITE", "struct_urio_command_sz")
+  add_compat("", "URIO_RECV_COMMAND", "READWRITE", "struct_urio_command_sz")
 
   # Generate sanitizer_interceptors_ioctl_netbsd.inc
 


        


More information about the llvm-commits mailing list