Page MenuHomePhabricator

Fix build breakage on FreeBSD after rL289878/rL289881

Authored by dim on Dec 18 2016, 12:05 PM.



After rL289878/rL289881, the build on FreeBSD is broken, because attempts to include <utmp.h> and use
struct utmp, neither of which are supported anymore on FreeBSD.

Fix this by adding && !SANITIZER_FREEBSD in two places.

Diff Detail


Event Timeline

dim updated this revision to Diff 81887.Dec 18 2016, 12:05 PM
dim retitled this revision from to Fix build breakage on FreeBSD after rL289878/rL289881.
dim updated this object.
dim added reviewers: eugenis, kubamracek, emaste.
dim added a subscriber: llvm-commits.
eugenis accepted this revision.Dec 18 2016, 12:48 PM
eugenis edited edge metadata.

If there is no getutent, you probably want to disable the interceptor in sanitizer_platform_interceptors.h.
Add an ifdef around the declaration of struct_utmp_sz as well.

This revision is now accepted and ready to land.Dec 18 2016, 12:48 PM
dim updated this revision to Diff 81889.Dec 18 2016, 1:07 PM
dim edited edge metadata.

Updated to cover some more cases:

  • Don't declare struct_utmp_sz on macOS and FreeBSD
  • Don't intercept utmp functions on FreeBSD either
ed accepted this revision.Dec 18 2016, 1:12 PM
ed added a reviewer: ed.
ed added a subscriber: ed.

I'm the author of FreeBSD's utmpx. LGTM!

This revision was automatically updated to reflect the committed changes.