This is an archive of the discontinued LLVM Phabricator instance.

Add NetBSD specific version of sanitizer_platform_limits_posix
ClosedPublic

Authored by krytarowski on Aug 27 2017, 5:38 AM.

Details

Summary

NetBSD is an Open-Source POSIX-like BSD Operating System.

Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas.

Sponsored by <The NetBSD Foundation>

Diff Detail

Repository
rL LLVM

Event Timeline

krytarowski created this revision.Aug 27 2017, 5:38 AM
kcc added inline comments.Aug 28 2017, 9:28 AM
lib/sanitizer_common/sanitizer_common_interceptors.inc
4117 ↗(On Diff #112820)

can you use if (SANITIZER_NETBSD) here?

lib/sanitizer_common/sanitizer_linux.h
21

No like this.
Instead, please guard the entire file if #if SANITIZER_NETBSD and then include the file w/o #if

krytarowski added inline comments.Aug 28 2017, 10:59 AM
lib/sanitizer_common/sanitizer_common_interceptors.inc
4117 ↗(On Diff #112820)

No, as variables like shmctl_shm_info are absent.

  • replace LP64 check with SANITIZER_WORDSIZE
  • restrict sanitizer_platform_limits_netbsd.h to NetBSD with the internal ifdef
kcc added inline comments.Aug 28 2017, 12:52 PM
lib/sanitizer_common/sanitizer_common_interceptors.inc
4117 ↗(On Diff #112820)

Please find a way to avoid this #if.

lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc
2

fix the comment.

g/c:

struct_shm_info_sz;
extern int shmctl_ipc_stat;
extern int shmctl_ipc_info;
extern int shmctl_shm_info;
extern int shmctl_shm_stat;

Rename in comments sanitizer_platform_limits_posix.* to sanitizer_platform_limits_netbsd.*

Fix the patch, it was accidentally partitioned.

krytarowski marked 2 inline comments as done.Aug 28 2017, 1:02 PM
krytarowski added inline comments.Aug 28 2017, 1:11 PM
lib/sanitizer_common/sanitizer_common_interceptors.inc
4117 ↗(On Diff #112820)

I will do it.

  • correct shmctl(2) interception on NetBSD
  • remove ifdef in generic code, define unknown values to -1

@kcc removed that ifdef (file disappeared as empty diff)

kcc accepted this revision.Aug 28 2017, 1:34 PM

LGTM, thanks!

This revision is now accepted and ready to land.Aug 28 2017, 1:34 PM
krytarowski closed this revision.Aug 28 2017, 2:04 PM