Skip to content

Commit 003fe25

Browse files
committedDec 20, 2016
Fix build breakage on FreeBSD after rL289878/rL289881
Summary: After rL289878/rL289881, the build on FreeBSD is broken, because sanitizer_platform_limits_posix.cc attempts to include <utmp.h> and use `struct utmp`, neither of which are supported anymore on FreeBSD. Fix this by adding `&& !SANITIZER_FREEBSD` in a few places, and stop intercepting utmp functions altogether for FreeBSD. Reviewers: kubabrecka, emaste, eugenis, ed Subscribers: ed, llvm-commits Differential Revision: https://reviews.llvm.org/D27902 llvm-svn: 290167
1 parent 543f1ac commit 003fe25

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed
 

‎compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
#define SANITIZER_INTERCEPT___LXSTAT SANITIZER_INTERCEPT___XSTAT
314314
#define SANITIZER_INTERCEPT___LXSTAT64 SI_LINUX_NOT_ANDROID
315315

316-
#define SANITIZER_INTERCEPT_UTMP SI_NOT_WINDOWS && !SI_MAC
316+
#define SANITIZER_INTERCEPT_UTMP SI_NOT_WINDOWS && !SI_MAC && !SI_FREEBSD
317317
#define SANITIZER_INTERCEPT_UTMPX SI_LINUX_NOT_ANDROID || SI_MAC || SI_FREEBSD
318318

319319
#endif // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H

‎compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#include <termios.h>
5252
#include <time.h>
5353
#include <wchar.h>
54-
#if !SANITIZER_MAC
54+
#if !SANITIZER_MAC && !SANITIZER_FREEBSD
5555
#include <utmp.h>
5656
#endif
5757

@@ -288,7 +288,7 @@ namespace __sanitizer {
288288
int shmctl_shm_stat = (int)SHM_STAT;
289289
#endif
290290

291-
#if !SANITIZER_MAC
291+
#if !SANITIZER_MAC && !SANITIZER_FREEBSD
292292
unsigned struct_utmp_sz = sizeof(struct utmp);
293293
#endif
294294
#if !SANITIZER_ANDROID

‎compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h

+2
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,9 @@ namespace __sanitizer {
862862
extern int shmctl_shm_stat;
863863
#endif
864864

865+
#if !SANITIZER_MAC && !SANITIZER_FREEBSD
865866
extern unsigned struct_utmp_sz;
867+
#endif
866868
#if !SANITIZER_ANDROID
867869
extern unsigned struct_utmpx_sz;
868870
#endif

0 commit comments

Comments
 (0)