Skip to content

Commit 27d6614

Browse files
authored
Merge pull request #24825 from alexrp/freebsd-fixes
2 parents b87b958 + b7602a1 commit 27d6614

File tree

4 files changed

+3
-41
lines changed

4 files changed

+3
-41
lines changed

lib/libtsan/sanitizer_common/sanitizer_platform_limits_freebsd.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,8 @@
7070
#include <semaphore.h>
7171
#include <signal.h>
7272
#include <stddef.h>
73-
#include <md5.h>
74-
#include <sha224.h>
75-
#include <sha256.h>
76-
#include <sha384.h>
77-
#include <sha512.h>
7873
#include <stdio.h>
7974
#include <stringlist.h>
80-
#include <term.h>
8175
#include <termios.h>
8276
#include <time.h>
8377
#include <ttyent.h>
@@ -378,22 +372,6 @@ const int si_SEGV_MAPERR = SEGV_MAPERR;
378372
const int si_SEGV_ACCERR = SEGV_ACCERR;
379373
const int unvis_valid = UNVIS_VALID;
380374
const int unvis_validpush = UNVIS_VALIDPUSH;
381-
382-
const unsigned MD5_CTX_sz = sizeof(MD5_CTX);
383-
const 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-
391-
SHA2_CONST(224);
392-
SHA2_CONST(256);
393-
SHA2_CONST(384);
394-
SHA2_CONST(512);
395-
396-
#undef SHA2_CONST
397375
} // namespace __sanitizer
398376

399377
using namespace __sanitizer;

lib/libtsan/sanitizer_common/sanitizer_platform_limits_freebsd.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -708,22 +708,6 @@ extern unsigned IOCTL_KDSKBMODE;
708708
extern const int si_SEGV_MAPERR;
709709
extern const int si_SEGV_ACCERR;
710710

711-
extern const unsigned MD5_CTX_sz;
712-
extern 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-
720-
SHA2_EXTERN(224);
721-
SHA2_EXTERN(256);
722-
SHA2_EXTERN(384);
723-
SHA2_EXTERN(512);
724-
725-
#undef SHA2_EXTERN
726-
727711
struct __sanitizer_cap_rights {
728712
u64 cr_rights[2];
729713
};

src/Compilation.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6921,7 +6921,7 @@ pub fn addCCArgs(
69216921
// We don't currently respect the minor and patch components. This wouldn't be particularly
69226922
// helpful because our abilists file only tracks major FreeBSD releases, so the link-time stub
69236923
// symbols would be inconsistent with header declarations.
6924-
min_ver.major * 100_000,
6924+
min_ver.major * 100_000 + 500,
69256925
}));
69266926
} else if (target.isNetBSDLibC()) {
69276927
const min_ver = target.os.version_range.semver.min;

src/libs/freebsd.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
8181
"-O2",
8282
"-fno-common",
8383
"-std=gnu99",
84-
"-DPIC",
8584
"-w", // Disable all warnings.
8685
});
8786

@@ -93,11 +92,12 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
9392
try acflags.appendSlice(&.{
9493
"-DLOCORE",
9594
// 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}),
9796
});
9897

9998
inline for (.{ &cflags, &acflags }) |flags| {
10099
try flags.appendSlice(&.{
100+
"-DPIC",
101101
"-DSTRIP_FBSDID",
102102
"-I",
103103
try includePath(comp, arena, try std.fmt.allocPrint(arena, "{s}-{s}-{s}", .{

0 commit comments

Comments
 (0)