[compiler-rt] r325345 - Add initial XRay support for NetBSD
Kamil Rytarowski via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 16 06:45:20 PST 2018
Author: kamil
Date: Fri Feb 16 06:45:20 2018
New Revision: 325345
URL: http://llvm.org/viewvc/llvm-project?rev=325345&view=rev
Log:
Add initial XRay support for NetBSD
Summary:
Reuse the existing FreeBSD code as it is.
Sponsored by <The NetBSD Foundation>
Reviewers: dberris, rnk, vitalybuka
Reviewed By: dberris
Subscribers: mclow.lists, emaste, mgorny, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D43370
Modified:
compiler-rt/trunk/cmake/config-ix.cmake
compiler-rt/trunk/lib/xray/xray_x86_64.cc
compiler-rt/trunk/test/xray/lit.cfg
Modified: compiler-rt/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/config-ix.cmake?rev=325345&r1=325344&r2=325345&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/config-ix.cmake (original)
+++ compiler-rt/trunk/cmake/config-ix.cmake Fri Feb 16 06:45:20 2018
@@ -597,7 +597,7 @@ else()
endif()
if (COMPILER_RT_HAS_SANITIZER_COMMON AND XRAY_SUPPORTED_ARCH AND
- OS_NAME MATCHES "Darwin|Linux|FreeBSD")
+ OS_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD")
set(COMPILER_RT_HAS_XRAY TRUE)
else()
set(COMPILER_RT_HAS_XRAY FALSE)
Modified: compiler-rt/trunk/lib/xray/xray_x86_64.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/xray_x86_64.cc?rev=325345&r1=325344&r2=325345&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/xray_x86_64.cc (original)
+++ compiler-rt/trunk/lib/xray/xray_x86_64.cc Fri Feb 16 06:45:20 2018
@@ -3,7 +3,8 @@
#include "xray_defs.h"
#include "xray_interface_internal.h"
-#if SANITIZER_FREEBSD
+#if SANITIZER_FREEBSD || SANITIZER_NETBSD
+#include <sys/types.h>
#include <sys/sysctl.h>
#endif
@@ -76,7 +77,7 @@ uint64_t getTSCFrequency() XRAY_NEVER_IN
}
return TSCFrequency == -1 ? 0 : static_cast<uint64_t>(TSCFrequency);
}
-#elif SANITIZER_FREEBSD
+#elif SANITIZER_FREEBSD || SANITIZER_NETBSD
uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
long long TSCFrequency = -1;
size_t tscfreqsz = sizeof(TSCFrequency);
Modified: compiler-rt/trunk/test/xray/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/xray/lit.cfg?rev=325345&r1=325344&r2=325345&view=diff
==============================================================================
--- compiler-rt/trunk/test/xray/lit.cfg (original)
+++ compiler-rt/trunk/test/xray/lit.cfg Fri Feb 16 06:45:20 2018
@@ -45,7 +45,7 @@ config.substitutions.append(
# Default test suffixes.
config.suffixes = ['.c', '.cc', '.cpp']
-if config.host_os not in ['FreeBSD', 'Linux']:
+if config.host_os not in ['FreeBSD', 'Linux', 'NetBSD']:
config.unsupported = True
elif '64' not in config.host_arch:
if 'arm' in config.host_arch:
More information about the llvm-commits
mailing list