[PATCH] A patch for sanitizers' syscalls on FreeBSD

Viktor Kutuzov vkutuzov at accesssoftek.com
Wed Mar 5 09:34:05 PST 2014

Comment at: lib/sanitizer_common/sanitizer_linux.cc:127
@@ -103,3 +126,3 @@
 uptr internal_open(const char *filename, int flags) {
-  return internal_syscall(__NR_openat, AT_FDCWD, (uptr)filename, flags);
+  return internal_syscall(SYSCALL(openat), AT_FDCWD, (uptr)filename, flags);
Alexey Samsonov wrote:
> Can we instead make sure that SANITIZER_USES_CANONICAL_LINUX_SYSCALLS is 0 on FreeBSD?
Sounds reasonable. Will do.

Comment at: lib/sanitizer_common/sanitizer_linux.cc:263
@@ +262,3 @@
+  internal_syscall(SYSCALL(exit), exitcode);
Alexey Samsonov wrote:
> Is there no exit_group on FreeBSD?
No, there's no one. We should probably address potential issues in another diff, since there's no trivial solution?

Comment at: lib/sanitizer_common/sanitizer_linux.cc:696
@@ -630,2 +695,3 @@
   typedef ElfW(Phdr) Elf_Phdr;
   typedef ElfW(Ehdr) Elf_Ehdr;
Alexey Samsonov wrote:
> Where do these defs come from on FreeBSD?
##<sys/elf_generic.h>## defines them via macro stuff similar to the Linux one:
  #define __ElfType(x) typedef __ElfN(x) CONCAT(Elf_,x)


More information about the llvm-commits mailing list