authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-08-14 01:00:30+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-08-14 01:00:30+02:00
log27d6614f81dfddcbd05b2a0b4afb8db83eaafb0b
tree73ddf3bea763c5de29ef497d6e4319acd82fab36
parentb87b9586878a95c281bf76c4cefc75a9a81f1865
parentb7602a17f847ec9f24cfe0b6a1c458b13e04c6f6
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #24825 from alexrp/freebsd-fixes


4 files changed, 3 insertions(+), 41 deletions(-)

lib/libtsan/sanitizer_common/sanitizer_platform_limits_freebsd.cpp-22
...@@ -70,14 +70,8 @@...@@ -70,14 +70,8 @@
70#include <semaphore.h>70#include <semaphore.h>
71#include <signal.h>71#include <signal.h>
72#include <stddef.h>72#include <stddef.h>
73#include <md5.h>
74#include <sha224.h>
75#include <sha256.h>
76#include <sha384.h>
77#include <sha512.h>
78#include <stdio.h>73#include <stdio.h>
79#include <stringlist.h>74#include <stringlist.h>
80#include <term.h>
81#include <termios.h>75#include <termios.h>
82#include <time.h>76#include <time.h>
83#include <ttyent.h>77#include <ttyent.h>
...@@ -378,22 +372,6 @@ const int si_SEGV_MAPERR = SEGV_MAPERR;...@@ -378,22 +372,6 @@ const int si_SEGV_MAPERR = SEGV_MAPERR;
378const int si_SEGV_ACCERR = SEGV_ACCERR;372const int si_SEGV_ACCERR = SEGV_ACCERR;
379const int unvis_valid = UNVIS_VALID;373const int unvis_valid = UNVIS_VALID;
380const int unvis_validpush = UNVIS_VALIDPUSH;374const int unvis_validpush = UNVIS_VALIDPUSH;
381
382const unsigned MD5_CTX_sz = sizeof(MD5_CTX);
383const unsigned MD5_return_length = MD5_DIGEST_STRING_LENGTH;
384
385#define SHA2_CONST(LEN) \
386 const unsigned SHA##LEN##_CTX_sz = sizeof(SHA##LEN##_CTX); \
387 const unsigned SHA##LEN##_return_length = SHA##LEN##_DIGEST_STRING_LENGTH; \
388 const unsigned SHA##LEN##_block_length = SHA##LEN##_BLOCK_LENGTH; \
389 const unsigned SHA##LEN##_digest_length = SHA##LEN##_DIGEST_LENGTH
390
391SHA2_CONST(224);
392SHA2_CONST(256);
393SHA2_CONST(384);
394SHA2_CONST(512);
395
396#undef SHA2_CONST
397} // namespace __sanitizer375} // namespace __sanitizer
398376
399using namespace __sanitizer;377using namespace __sanitizer;
lib/libtsan/sanitizer_common/sanitizer_platform_limits_freebsd.h-16
...@@ -708,22 +708,6 @@ extern unsigned IOCTL_KDSKBMODE;...@@ -708,22 +708,6 @@ extern unsigned IOCTL_KDSKBMODE;
708extern const int si_SEGV_MAPERR;708extern const int si_SEGV_MAPERR;
709extern const int si_SEGV_ACCERR;709extern const int si_SEGV_ACCERR;
710710
711extern const unsigned MD5_CTX_sz;
712extern const unsigned MD5_return_length;
713
714#define SHA2_EXTERN(LEN) \
715 extern const unsigned SHA##LEN##_CTX_sz; \
716 extern const unsigned SHA##LEN##_return_length; \
717 extern const unsigned SHA##LEN##_block_length; \
718 extern const unsigned SHA##LEN##_digest_length
719
720SHA2_EXTERN(224);
721SHA2_EXTERN(256);
722SHA2_EXTERN(384);
723SHA2_EXTERN(512);
724
725#undef SHA2_EXTERN
726
727struct __sanitizer_cap_rights {711struct __sanitizer_cap_rights {
728 u64 cr_rights[2];712 u64 cr_rights[2];
729};713};
src/Compilation.zig+1-1
...@@ -6921,7 +6921,7 @@ pub fn addCCArgs(...@@ -6921,7 +6921,7 @@ pub fn addCCArgs(
6921 // We don't currently respect the minor and patch components. This wouldn't be particularly6921 // We don't currently respect the minor and patch components. This wouldn't be particularly
6922 // helpful because our abilists file only tracks major FreeBSD releases, so the link-time stub6922 // helpful because our abilists file only tracks major FreeBSD releases, so the link-time stub
6923 // symbols would be inconsistent with header declarations.6923 // symbols would be inconsistent with header declarations.
6924 min_ver.major * 100_000,6924 min_ver.major * 100_000 + 500,
6925 }));6925 }));
6926 } else if (target.isNetBSDLibC()) {6926 } else if (target.isNetBSDLibC()) {
6927 const min_ver = target.os.version_range.semver.min;6927 const min_ver = target.os.version_range.semver.min;
src/libs/freebsd.zig+2-2
...@@ -81,7 +81,6 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre...@@ -81,7 +81,6 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
81 "-O2",81 "-O2",
82 "-fno-common",82 "-fno-common",
83 "-std=gnu99",83 "-std=gnu99",
84 "-DPIC",
85 "-w", // Disable all warnings.84 "-w", // Disable all warnings.
86 });85 });
8786
...@@ -93,11 +92,12 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre...@@ -93,11 +92,12 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
93 try acflags.appendSlice(&.{92 try acflags.appendSlice(&.{
94 "-DLOCORE",93 "-DLOCORE",
95 // See `Compilation.addCCArgs`.94 // See `Compilation.addCCArgs`.
96 try std.fmt.allocPrint(arena, "-D__FreeBSD_version={d}", .{target.os.version_range.semver.min.major * 100_000}),95 try std.fmt.allocPrint(arena, "-D__FreeBSD_version={d}", .{target.os.version_range.semver.min.major * 100_000 + 500}),
97 });96 });
9897
99 inline for (.{ &cflags, &acflags }) |flags| {98 inline for (.{ &cflags, &acflags }) |flags| {
100 try flags.appendSlice(&.{99 try flags.appendSlice(&.{
100 "-DPIC",
101 "-DSTRIP_FBSDID",101 "-DSTRIP_FBSDID",
102 "-I",102 "-I",
103 try includePath(comp, arena, try std.fmt.allocPrint(arena, "{s}-{s}-{s}", .{103 try includePath(comp, arena, try std.fmt.allocPrint(arena, "{s}-{s}-{s}", .{