diff mbox series

[libsanitizer] : Guard cyclades inclusion in sanitizer

Message ID patch-14494-tamar@arm.com
State New
Headers show
Series [libsanitizer] : Guard cyclades inclusion in sanitizer | expand

Commit Message

Tamar Christina May 20, 2021, 10:49 a.m. UTC
Hi All,

libsanitizer: Guard cyclades inclusion in sanitizer

The Linux kernel has removed the interface to cyclades from
the latest kernel headers[1] due to them being orphaned for the
past 13 years.

libsanitizer uses this header when compiling against glibc, but
glibcs itself doesn't seem to have any references to cyclades.

Further more it seems that the driver is broken in the kernel and
the firmware doesn't seem to be available anymore.

As such since this is breaking the build of libsanitizer (and so the
GCC bootstrap[2]) I propose to remove this.

[1] https://lkml.org/lkml/2021/3/2/153
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379

(cherry picked from commit f7c5351552387bd43f6ca3631016d7f0dfe0f135)

Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.

Ok for master?

Thanks,
Tamar

libsanitizer/ChangeLog:

	PR sanitizer/100379
	* sanitizer_common/sanitizer_common_interceptors_ioctl.inc: Remove cyclades.
	* sanitizer_common/sanitizer_platform_limits_posix.cpp: Likewise.
	* sanitizer_common/sanitizer_platform_limits_posix.h: Likewise.

--- inline copy of patch -- 
diff --git a/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
index 7f181258eab52b11688d6857ddfe09acc98ba986..b7da659875574ed3ca457780799d5b4c556d2f68 100644


--

Comments

Jakub Jelinek May 20, 2021, 11 a.m. UTC | #1
On Thu, May 20, 2021 at 11:49:03AM +0100, Tamar Christina wrote:
> libsanitizer: Guard cyclades inclusion in sanitizer
> 
> The Linux kernel has removed the interface to cyclades from
> the latest kernel headers[1] due to them being orphaned for the
> past 13 years.
> 
> libsanitizer uses this header when compiling against glibc, but
> glibcs itself doesn't seem to have any references to cyclades.
> 
> Further more it seems that the driver is broken in the kernel and
> the firmware doesn't seem to be available anymore.
> 
> As such since this is breaking the build of libsanitizer (and so the
> GCC bootstrap[2]) I propose to remove this.
> 
> [1] https://lkml.org/lkml/2021/3/2/153
> [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379
> 
> (cherry picked from commit f7c5351552387bd43f6ca3631016d7f0dfe0f135)
> 
> Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.
> 
> Ok for master?
> 
> Thanks,
> Tamar
> 
> libsanitizer/ChangeLog:
> 
> 	PR sanitizer/100379
> 	* sanitizer_common/sanitizer_common_interceptors_ioctl.inc: Remove cyclades.
> 	* sanitizer_common/sanitizer_platform_limits_posix.cpp: Likewise.
> 	* sanitizer_common/sanitizer_platform_limits_posix.h: Likewise.

The *.inc line is too long.  And furthermore it should read:
	PR sanitizer/100379
	* sanitizer_common/sanitizer_common_interceptors_ioctl.inc: Cherry-pick
	llvm-project revision f7c5351552387bd43f6ca3631016d7f0dfe0f135.
	* sanitizer_common/sanitizer_platform_limits_posix.cpp: Likewise.
	* sanitizer_common/sanitizer_platform_limits_posix.h: Likewise.

Ok for trunk and release branches with that change.
Thanks.

	Jakub
Florian Weimer May 20, 2021, 11:05 a.m. UTC | #2
* Tamar Christina via Gcc-patches:

> Hi All,
>
> libsanitizer: Guard cyclades inclusion in sanitizer
>
> The Linux kernel has removed the interface to cyclades from
> the latest kernel headers[1] due to them being orphaned for the
> past 13 years.

Nit: The commit subject doesn't match the patch because it removes the
functionality unconditionally (which is fine).

Thanks,
Florian
diff mbox series

Patch

diff --git a/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
index 7f181258eab52b11688d6857ddfe09acc98ba986..b7da659875574ed3ca457780799d5b4c556d2f68 100644
--- a/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
+++ b/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
@@ -370,15 +370,6 @@  static void ioctl_table_fill() {
 
 #if SANITIZER_GLIBC
   // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
-  _(CYGETDEFTHRESH, WRITE, sizeof(int));
-  _(CYGETDEFTIMEOUT, WRITE, sizeof(int));
-  _(CYGETMON, WRITE, struct_cyclades_monitor_sz);
-  _(CYGETTHRESH, WRITE, sizeof(int));
-  _(CYGETTIMEOUT, WRITE, sizeof(int));
-  _(CYSETDEFTHRESH, NONE, 0);
-  _(CYSETDEFTIMEOUT, NONE, 0);
-  _(CYSETTHRESH, NONE, 0);
-  _(CYSETTIMEOUT, NONE, 0);
   _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz);
   _(EQL_ENSLAVE, WRITE, struct_ifreq_sz);
   _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz);
diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
index ad358eef8b77e0f0098af41f30ce3e7084ee4552..cba41ba54943d80da7d557ce52e1a3ee36e3946a 100644
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -983,7 +983,6 @@  extern unsigned struct_vt_mode_sz;
 
 #if SANITIZER_LINUX && !SANITIZER_ANDROID
 extern unsigned struct_ax25_parms_struct_sz;
-extern unsigned struct_cyclades_monitor_sz;
 extern unsigned struct_input_keymap_entry_sz;
 extern unsigned struct_ipx_config_data_sz;
 extern unsigned struct_kbdiacrs_sz;
@@ -1328,15 +1327,6 @@  extern unsigned IOCTL_VT_WAITACTIVE;
 #endif  // SANITIZER_LINUX
 
 #if SANITIZER_LINUX && !SANITIZER_ANDROID
-extern unsigned IOCTL_CYGETDEFTHRESH;
-extern unsigned IOCTL_CYGETDEFTIMEOUT;
-extern unsigned IOCTL_CYGETMON;
-extern unsigned IOCTL_CYGETTHRESH;
-extern unsigned IOCTL_CYGETTIMEOUT;
-extern unsigned IOCTL_CYSETDEFTHRESH;
-extern unsigned IOCTL_CYSETDEFTIMEOUT;
-extern unsigned IOCTL_CYSETTHRESH;
-extern unsigned IOCTL_CYSETTIMEOUT;
 extern unsigned IOCTL_EQL_EMANCIPATE;
 extern unsigned IOCTL_EQL_ENSLAVE;
 extern unsigned IOCTL_EQL_GETMASTRCFG;
diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
index 35a690cba5c834a6952ebc0d633195155b151447..6e5c330b98eff32e3fd49b4ff95f72a50230c538 100644
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -143,7 +143,6 @@  typedef struct user_fpregs elf_fpregset_t;
 # include <sys/procfs.h>
 #endif
 #include <sys/user.h>
-#include <linux/cyclades.h>
 #include <linux/if_eql.h>
 #include <linux/if_plip.h>
 #include <linux/lp.h>
@@ -460,7 +459,6 @@  unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
 
 #if SANITIZER_GLIBC
   unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
-  unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
 #if EV_VERSION > (0x010000)
   unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry);
 #else
@@ -824,15 +822,6 @@  unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
 #endif // SANITIZER_LINUX
 
 #if SANITIZER_LINUX && !SANITIZER_ANDROID
-  unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
-  unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
-  unsigned IOCTL_CYGETMON = CYGETMON;
-  unsigned IOCTL_CYGETTHRESH = CYGETTHRESH;
-  unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT;
-  unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH;
-  unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT;
-  unsigned IOCTL_CYSETTHRESH = CYSETTHRESH;
-  unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT;
   unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE;
   unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE;
   unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG;