[compiler-rt] Fix __sanitizer_cpuset size on newer FreeBSD
authorMarco Elver <elver@google.com>
Thu, 6 Jul 2023 10:25:47 +0000 (12:25 +0200)
committerMarco Elver <elver@google.com>
Thu, 6 Jul 2023 10:34:36 +0000 (12:34 +0200)
Current FreeBSD has increased size of cpuset. Match it to not break the
build on newer FreeBSD.

Patch by John F. Carr

Fixes: https://github.com/llvm/llvm-project/issues/63485

compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h

index b6be60e..b119f05 100644 (file)
@@ -717,7 +717,11 @@ extern unsigned struct_fstab_sz;
 extern unsigned struct_StringList_sz;
 
 struct __sanitizer_cpuset {
+#if __FreeBSD_version >= 1400090
+  long __bits[(1024 + (sizeof(long) * 8) - 1) / (sizeof(long) * 8)];
+#else
   long __bits[(256 + (sizeof(long) * 8) - 1) / (sizeof(long) * 8)];
+#endif
 };
 
 typedef struct __sanitizer_cpuset __sanitizer_cpuset_t;