[compiler-rt] r260046 - Fix build on FreeBSD after r259741.

Dimitry Andric via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 7 09:40:45 PST 2016


Author: dim
Date: Sun Feb  7 11:40:45 2016
New Revision: 260046

URL: http://llvm.org/viewvc/llvm-project?rev=260046&view=rev
Log:
Fix build on FreeBSD after r259741.

On FreeBSD, the uc_mcontext member of ucontext_t has a member called
mc_err, which corresponds to the Linux member gregs[REG_ERR].

Reviewed by:	rdivacky at FreeBSD.org

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc?rev=260046&r1=260045&r2=260046&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Sun Feb  7 11:40:45 2016
@@ -1158,7 +1158,11 @@ void internal_join_thread(void *th) {}
 bool GetSigContextWriteFlag(void *context) {
 #if defined(__x86_64__) || defined(__i386__)
   ucontext_t *ucontext = (ucontext_t*)context;
+#if SANITIZER_FREEBSD
+  return ucontext->uc_mcontext.mc_err & 2;
+#else
   return ucontext->uc_mcontext.gregs[REG_ERR] & 2;
+#endif
 #else
   return false;  // FIXME: Implement.
 #endif




More information about the llvm-commits mailing list