Skip to content

Commit 5abec20

Browse files
authored
[compiler-rt] Remove leftovers of FreeBSD md5/sha2 interceptors (llvm#153351)
This code was added in 18a7ebd, but was not properly reverted in d0b9c2c. Removing this code makes it possible to cross-compile TSan for FreeBSD with `zig cc` which does not provide libcrypt when cross-compiling. I also removed a `term.h` include (ncurses) which appeared to be unnecessary and likewise prevented cross-compilation with `zig cc` from working.
1 parent 13bccde commit 5abec20

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,8 @@
7171
#include <semaphore.h>
7272
#include <signal.h>
7373
#include <stddef.h>
74-
#include <md5.h>
75-
#include <sha224.h>
76-
#include <sha256.h>
77-
#include <sha384.h>
78-
#include <sha512.h>
7974
#include <stdio.h>
8075
#include <stringlist.h>
81-
#include <term.h>
8276
#include <termios.h>
8377
#include <time.h>
8478
#include <ttyent.h>
@@ -370,22 +364,6 @@ const int si_SEGV_MAPERR = SEGV_MAPERR;
370364
const int si_SEGV_ACCERR = SEGV_ACCERR;
371365
const int unvis_valid = UNVIS_VALID;
372366
const int unvis_validpush = UNVIS_VALIDPUSH;
373-
374-
const unsigned MD5_CTX_sz = sizeof(MD5_CTX);
375-
const unsigned MD5_return_length = MD5_DIGEST_STRING_LENGTH;
376-
377-
#define SHA2_CONST(LEN) \
378-
const unsigned SHA##LEN##_CTX_sz = sizeof(SHA##LEN##_CTX); \
379-
const unsigned SHA##LEN##_return_length = SHA##LEN##_DIGEST_STRING_LENGTH; \
380-
const unsigned SHA##LEN##_block_length = SHA##LEN##_BLOCK_LENGTH; \
381-
const unsigned SHA##LEN##_digest_length = SHA##LEN##_DIGEST_LENGTH
382-
383-
SHA2_CONST(224);
384-
SHA2_CONST(256);
385-
SHA2_CONST(384);
386-
SHA2_CONST(512);
387-
388-
#undef SHA2_CONST
389367
} // namespace __sanitizer
390368

391369
using namespace __sanitizer;

compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h

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

713-
extern const unsigned MD5_CTX_sz;
714-
extern const unsigned MD5_return_length;
715-
716-
#define SHA2_EXTERN(LEN) \
717-
extern const unsigned SHA##LEN##_CTX_sz; \
718-
extern const unsigned SHA##LEN##_return_length; \
719-
extern const unsigned SHA##LEN##_block_length; \
720-
extern const unsigned SHA##LEN##_digest_length
721-
722-
SHA2_EXTERN(224);
723-
SHA2_EXTERN(256);
724-
SHA2_EXTERN(384);
725-
SHA2_EXTERN(512);
726-
727-
#undef SHA2_EXTERN
728-
729713
struct __sanitizer_cap_rights {
730714
u64 cr_rights[2];
731715
};

0 commit comments

Comments
 (0)