Files
cocos/hal/linux/patches/gcc/14.3.0/0007-libsanitizer-guard-linux-scc.h-for-linux-7.1.patch
T
Sammy Kerata Oina 87f2728cc4
CI / lint (push) Has been cancelled
CI / test (agent) (push) Has been cancelled
CI / test (cli) (push) Has been cancelled
CI / test (cmd) (push) Has been cancelled
CI / test (internal) (push) Has been cancelled
CI / test (manager, true) (push) Has been cancelled
CI / test (pkg) (push) Has been cancelled
CI / upload-coverage (push) Has been cancelled
feat: add patch to guard inclusion of linux/scc.h in libsanitizer for compatibility (#613)
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
2026-07-28 16:07:58 +02:00

34 lines
1.1 KiB
Diff

--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -151,7 +151,15 @@
#include <linux/lp.h>
#include <linux/mroute.h>
#include <linux/mroute6.h>
-#include <linux/scc.h>
+#if defined(__has_include)
+# if __has_include(<linux/scc.h>)
+# include <linux/scc.h>
+# define SANITIZER_HAS_LINUX_SCC_H 1
+# endif
+#else
+# include <linux/scc.h>
+# define SANITIZER_HAS_LINUX_SCC_H 1
+#endif
#include <linux/serial.h>
#include <sys/msg.h>
#include <sys/ipc.h>
@@ -517,8 +525,13 @@
unsigned struct_kbsentry_sz = sizeof(struct kbsentry);
unsigned struct_mtconfiginfo_sz = sizeof(struct mtconfiginfo);
unsigned struct_nr_parms_struct_sz = sizeof(struct nr_parms_struct);
+#if SANITIZER_HAS_LINUX_SCC_H
unsigned struct_scc_modem_sz = sizeof(struct scc_modem);
unsigned struct_scc_stat_sz = sizeof(struct scc_stat);
+#else
+ unsigned struct_scc_modem_sz = 0;
+ unsigned struct_scc_stat_sz = 0;
+#endif
unsigned struct_serial_multiport_struct_sz
= sizeof(struct serial_multiport_struct);
unsigned struct_serial_struct_sz = sizeof(struct serial_struct);