diff --git a/lib/libtsan/sanitizer_common/sanitizer_platform_limits_freebsd.cpp b/lib/libtsan/sanitizer_common/sanitizer_platform_limits_freebsd.cpp index 4940062eeae4..dd8d40eac0e4 100644 --- a/lib/libtsan/sanitizer_common/sanitizer_platform_limits_freebsd.cpp +++ b/lib/libtsan/sanitizer_common/sanitizer_platform_limits_freebsd.cpp @@ -70,14 +70,8 @@ #include #include #include -#include -#include -#include -#include -#include #include #include -#include #include #include #include @@ -378,22 +372,6 @@ const int si_SEGV_MAPERR = SEGV_MAPERR; const int si_SEGV_ACCERR = SEGV_ACCERR; const int unvis_valid = UNVIS_VALID; const int unvis_validpush = UNVIS_VALIDPUSH; - -const unsigned MD5_CTX_sz = sizeof(MD5_CTX); -const unsigned MD5_return_length = MD5_DIGEST_STRING_LENGTH; - -#define SHA2_CONST(LEN) \ - const unsigned SHA##LEN##_CTX_sz = sizeof(SHA##LEN##_CTX); \ - const unsigned SHA##LEN##_return_length = SHA##LEN##_DIGEST_STRING_LENGTH; \ - const unsigned SHA##LEN##_block_length = SHA##LEN##_BLOCK_LENGTH; \ - const unsigned SHA##LEN##_digest_length = SHA##LEN##_DIGEST_LENGTH - -SHA2_CONST(224); -SHA2_CONST(256); -SHA2_CONST(384); -SHA2_CONST(512); - -#undef SHA2_CONST } // namespace __sanitizer using namespace __sanitizer; diff --git a/lib/libtsan/sanitizer_common/sanitizer_platform_limits_freebsd.h b/lib/libtsan/sanitizer_common/sanitizer_platform_limits_freebsd.h index 8ce73f206fd8..cc6558f72419 100644 --- a/lib/libtsan/sanitizer_common/sanitizer_platform_limits_freebsd.h +++ b/lib/libtsan/sanitizer_common/sanitizer_platform_limits_freebsd.h @@ -708,22 +708,6 @@ extern unsigned IOCTL_KDSKBMODE; extern const int si_SEGV_MAPERR; extern const int si_SEGV_ACCERR; -extern const unsigned MD5_CTX_sz; -extern const unsigned MD5_return_length; - -#define SHA2_EXTERN(LEN) \ - extern const unsigned SHA##LEN##_CTX_sz; \ - extern const unsigned SHA##LEN##_return_length; \ - extern const unsigned SHA##LEN##_block_length; \ - extern const unsigned SHA##LEN##_digest_length - -SHA2_EXTERN(224); -SHA2_EXTERN(256); -SHA2_EXTERN(384); -SHA2_EXTERN(512); - -#undef SHA2_EXTERN - struct __sanitizer_cap_rights { u64 cr_rights[2]; }; diff --git a/src/Compilation.zig b/src/Compilation.zig index 9e7e2dd89ca5..9e0872c54282 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -6921,7 +6921,7 @@ pub fn addCCArgs( // We don't currently respect the minor and patch components. This wouldn't be particularly // helpful because our abilists file only tracks major FreeBSD releases, so the link-time stub // symbols would be inconsistent with header declarations. - min_ver.major * 100_000, + min_ver.major * 100_000 + 500, })); } else if (target.isNetBSDLibC()) { const min_ver = target.os.version_range.semver.min; diff --git a/src/libs/freebsd.zig b/src/libs/freebsd.zig index 29a0c3097886..37d6736acb8e 100644 --- a/src/libs/freebsd.zig +++ b/src/libs/freebsd.zig @@ -81,7 +81,6 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre "-O2", "-fno-common", "-std=gnu99", - "-DPIC", "-w", // Disable all warnings. }); @@ -93,11 +92,12 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre try acflags.appendSlice(&.{ "-DLOCORE", // See `Compilation.addCCArgs`. - try std.fmt.allocPrint(arena, "-D__FreeBSD_version={d}", .{target.os.version_range.semver.min.major * 100_000}), + try std.fmt.allocPrint(arena, "-D__FreeBSD_version={d}", .{target.os.version_range.semver.min.major * 100_000 + 500}), }); inline for (.{ &cflags, &acflags }) |flags| { try flags.appendSlice(&.{ + "-DPIC", "-DSTRIP_FBSDID", "-I", try includePath(comp, arena, try std.fmt.allocPrint(arena, "{s}-{s}-{s}", .{