Index: compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc +++ compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc @@ -370,6 +370,7 @@ #if SANITIZER_GLIBC // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE +#if SANITIZER_LINUX_CYCLADES _(CYGETDEFTHRESH, WRITE, sizeof(int)); _(CYGETDEFTIMEOUT, WRITE, sizeof(int)); _(CYGETMON, WRITE, struct_cyclades_monitor_sz); @@ -379,6 +380,7 @@ _(CYSETDEFTIMEOUT, NONE, 0); _(CYSETTHRESH, NONE, 0); _(CYSETTIMEOUT, NONE, 0); +#endif _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz); _(EQL_ENSLAVE, WRITE, struct_ifreq_sz); _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz); Index: compiler-rt/lib/sanitizer_common/sanitizer_platform.h =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_platform.h +++ compiler-rt/lib/sanitizer_common/sanitizer_platform.h @@ -390,4 +390,17 @@ #define SANITIZER_SUPPORTS_INIT_FOR_DLOPEN 0 #endif +// Kernel has removed this header, as such check for it's existance +// before trying to include defines from it. +// https://lkml.org/lkml/2021/3/2/153 +#ifdef __has_include +# if __has_include() && !SANITIZER_ANDROID +# define SANITIZER_LINUX_CYCLADES 1 +# else +# define SANITIZER_LINUX_CYCLADES 0 +# endif +#else +# define SANITIZER_LINUX_CYCLADES 0 +#endif + #endif // SANITIZER_PLATFORM_H Index: compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +++ compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h @@ -983,7 +983,9 @@ #if SANITIZER_LINUX && !SANITIZER_ANDROID extern unsigned struct_ax25_parms_struct_sz; +#if SANITIZER_LINUX_CYCLADES extern unsigned struct_cyclades_monitor_sz; +#endif extern unsigned struct_input_keymap_entry_sz; extern unsigned struct_ipx_config_data_sz; extern unsigned struct_kbdiacrs_sz; @@ -1328,6 +1330,7 @@ #endif // SANITIZER_LINUX #if SANITIZER_LINUX && !SANITIZER_ANDROID +#if SANITIZER_LINUX_CYCLADES extern unsigned IOCTL_CYGETDEFTHRESH; extern unsigned IOCTL_CYGETDEFTIMEOUT; extern unsigned IOCTL_CYGETMON; @@ -1337,6 +1340,7 @@ extern unsigned IOCTL_CYSETDEFTIMEOUT; extern unsigned IOCTL_CYSETTHRESH; extern unsigned IOCTL_CYSETTIMEOUT; +#endif extern unsigned IOCTL_EQL_EMANCIPATE; extern unsigned IOCTL_EQL_ENSLAVE; extern unsigned IOCTL_EQL_GETMASTRCFG; Index: compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp +++ compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp @@ -143,7 +143,9 @@ # include #endif #include -#include +#if SANITIZER_LINUX_CYCLADES +# include +#endif #include #include #include @@ -460,7 +462,9 @@ #if SANITIZER_GLIBC unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct); +#if SANITIZER_LINUX_CYCLADES unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor); +#endif #if EV_VERSION > (0x010000) unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry); #else @@ -824,6 +828,7 @@ #endif // SANITIZER_LINUX #if SANITIZER_LINUX && !SANITIZER_ANDROID +#if SANITIZER_LINUX_CYCLADES unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH; unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT; unsigned IOCTL_CYGETMON = CYGETMON; @@ -833,6 +838,7 @@ unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT; unsigned IOCTL_CYSETTHRESH = CYSETTHRESH; unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT; +#endif unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE; unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE; unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG;