Skip to content

Commit 3a200f3

Browse files
committed
[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.
1 parent 31e29d4 commit 3a200f3

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,6 @@ static void ioctl_table_fill() {
446446
_(STICIO_STOPQ, NONE, 0);
447447
/* Entries from file: dev/usb/ukyopon.h */
448448
_(UKYOPON_IDENTIFY, WRITE, struct_ukyopon_identify_sz);
449-
/* Entries from file: dev/usb/urio.h */
450-
_(URIO_SEND_COMMAND, READWRITE, struct_urio_command_sz);
451-
_(URIO_RECV_COMMAND, READWRITE, struct_urio_command_sz);
452449
/* Entries from file: dev/usb/usb.h */
453450
_(USB_REQUEST, READWRITE, struct_usb_ctl_request_sz);
454451
_(USB_SETDEBUG, READ, sizeof(int));
@@ -1405,6 +1402,9 @@ static void ioctl_table_fill() {
14051402
/* Entries from file: dev/filemon/filemon.h (compat <= 9.99.26) */
14061403
_(FILEMON_SET_FD, READWRITE, sizeof(int));
14071404
_(FILEMON_SET_PID, READWRITE, sizeof(int));
1405+
/* Entries from file: dev/usb/urio.h (compat <= 9.99.43) */
1406+
_(URIO_SEND_COMMAND, READWRITE, struct_urio_command_sz);
1407+
_(URIO_RECV_COMMAND, READWRITE, struct_urio_command_sz);
14081408
#undef _
14091409
} // NOLINT
14101410

compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,21 @@
190190
#include <dev/sun/vuid_event.h>
191191
#include <dev/tc/sticio.h>
192192
#include <dev/usb/ukyopon.h>
193+
#if !__NetBSD_Prereq__(9, 99, 44)
193194
#include <dev/usb/urio.h>
195+
#else
196+
struct urio_command {
197+
unsigned short length;
198+
int request;
199+
int requesttype;
200+
int value;
201+
int index;
202+
void *buffer;
203+
int timeout;
204+
};
205+
#define URIO_SEND_COMMAND _IOWR('U', 200, struct urio_command)
206+
#define URIO_RECV_COMMAND _IOWR('U', 201, struct urio_command)
207+
#endif
194208
#include <dev/usb/usb.h>
195209
#include <dev/usb/utoppy.h>
196210
#include <dev/vme/xio.h>

compiler-rt/utils/generate_netbsd_ioctls.awk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ END {
256256
# Add compat entries
257257
add_compat("dev/filemon/filemon.h (compat <= 9.99.26)", "FILEMON_SET_FD", "READWRITE", "sizeof(int)")
258258
add_compat("", "FILEMON_SET_PID", "READWRITE", "sizeof(int)")
259+
add_compat("dev/usb/urio.h (compat <= 9.99.43)", "URIO_SEND_COMMAND", "READWRITE", "struct_urio_command_sz")
260+
add_compat("", "URIO_RECV_COMMAND", "READWRITE", "struct_urio_command_sz")
259261

260262
# Generate sanitizer_interceptors_ioctl_netbsd.inc
261263

0 commit comments

Comments
 (0)