summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-01-08 22:40:56 +0000
committerdim <dim@FreeBSD.org>2015-01-08 22:40:56 +0000
commitcfd5b20c8bb6e3677ef84152d28058c0ead0de39 (patch)
tree10a31b9de36569ab1fe8db3a634523f537786570
parent69eebc007b1de201e785d92a4cf26b250bf0e93c (diff)
downloadFreeBSD-src-cfd5b20c8bb6e3677ef84152d28058c0ead0de39.zip
FreeBSD-src-cfd5b20c8bb6e3677ef84152d28058c0ead0de39.tar.gz
Now compiler-rt has been updated in r276851, bring in the various
sanitizer libraries that already work on FreeBSD: * asan: Address Sanitizer * ubsan: Undefined Behavior Sanitizer * profile: Profile Guided Optimization support Please note that these libraries are *experimental* at this stage, so the main Makefile is not yet connected to the build. Since I didn't want to needlessly edit BSD.usr.dist, you will also have to create the install directory /usr/lib/clang/3.5.0/lib/freebsd manually for now.
-rw-r--r--lib/libclang_rt/Makefile10
-rw-r--r--lib/libclang_rt/Makefile.inc25
-rw-r--r--lib/libclang_rt/asan/Makefile78
-rw-r--r--lib/libclang_rt/asan_cxx/Makefile11
-rw-r--r--lib/libclang_rt/profile/Makefile17
-rw-r--r--lib/libclang_rt/san/Makefile48
-rw-r--r--lib/libclang_rt/ubsan/Makefile17
-rw-r--r--lib/libclang_rt/ubsan_cxx/Makefile14
8 files changed, 220 insertions, 0 deletions
diff --git a/lib/libclang_rt/Makefile b/lib/libclang_rt/Makefile
new file mode 100644
index 0000000..d238fa3
--- /dev/null
+++ b/lib/libclang_rt/Makefile
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+SUBDIR= asan\
+ asan_cxx\
+ profile\
+ san\
+ ubsan\
+ ubsan_cxx
+
+.include <bsd.subdir.mk>
diff --git a/lib/libclang_rt/Makefile.inc b/lib/libclang_rt/Makefile.inc
new file mode 100644
index 0000000..b0ddd28
--- /dev/null
+++ b/lib/libclang_rt/Makefile.inc
@@ -0,0 +1,25 @@
+# $FreeBSD$
+
+.include <src.opts.mk>
+
+CRTARCH=${MACHINE_CPUARCH:C/amd64/x86_64/}
+CRTSRC=${.CURDIR}/../../../contrib/compiler-rt
+
+LIBDIR=/usr/lib/clang/3.5.0/lib/freebsd
+
+NO_PIC=
+MK_PROFILE=no
+
+WARNS?=0
+
+SSP_CFLAGS=
+CFLAGS+=-DNDEBUG
+CFLAGS+=${PICFLAG}
+CFLAGS+=-fno-builtin
+CFLAGS+=-fno-exceptions
+CFLAGS+=-fno-rtti
+CFLAGS+=-fno-stack-protector
+CFLAGS+=-funwind-tables
+CFLAGS+=-fvisibility-inlines-hidden
+CFLAGS+=-fvisibility=hidden
+CFLAGS+=-I${CRTSRC}/lib
diff --git a/lib/libclang_rt/asan/Makefile b/lib/libclang_rt/asan/Makefile
new file mode 100644
index 0000000..9d9622c
--- /dev/null
+++ b/lib/libclang_rt/asan/Makefile
@@ -0,0 +1,78 @@
+# $FreeBSD$
+
+.include <bsd.init.mk>
+
+LIB= clang_rt.asan-${CRTARCH}
+
+.PATH: ${CRTSRC}/lib/asan\
+ ${CRTSRC}/lib/interception\
+ ${CRTSRC}/lib/sanitizer_common\
+ ${CRTSRC}/lib/lsan
+
+SRCS= asan_preinit.cc\
+ asan_allocator2.cc\
+ asan_activation.cc\
+ asan_debugging.cc\
+ asan_fake_stack.cc\
+ asan_globals.cc\
+ asan_interceptors.cc\
+ asan_linux.cc\
+ asan_mac.cc\
+ asan_malloc_linux.cc\
+ asan_malloc_mac.cc\
+ asan_malloc_win.cc\
+ asan_poisoning.cc\
+ asan_posix.cc\
+ asan_report.cc\
+ asan_rtl.cc\
+ asan_stack.cc\
+ asan_stats.cc\
+ asan_suppressions.cc\
+ asan_thread.cc\
+ asan_win.cc\
+ interception_linux.cc\
+ interception_mac.cc\
+ interception_win.cc\
+ interception_type_test.cc\
+ sanitizer_allocator.cc\
+ sanitizer_common.cc\
+ sanitizer_deadlock_detector1.cc\
+ sanitizer_deadlock_detector2.cc\
+ sanitizer_flags.cc\
+ sanitizer_libc.cc\
+ sanitizer_libignore.cc\
+ sanitizer_linux.cc\
+ sanitizer_mac.cc\
+ sanitizer_persistent_allocator.cc\
+ sanitizer_platform_limits_linux.cc\
+ sanitizer_platform_limits_posix.cc\
+ sanitizer_posix.cc\
+ sanitizer_printf.cc\
+ sanitizer_procmaps_common.cc\
+ sanitizer_procmaps_freebsd.cc\
+ sanitizer_procmaps_linux.cc\
+ sanitizer_procmaps_mac.cc\
+ sanitizer_stackdepot.cc\
+ sanitizer_stacktrace.cc\
+ sanitizer_stacktrace_printer.cc\
+ sanitizer_suppressions.cc\
+ sanitizer_symbolizer.cc\
+ sanitizer_symbolizer_libbacktrace.cc\
+ sanitizer_symbolizer_win.cc\
+ sanitizer_tls_get_addr.cc\
+ sanitizer_thread_registry.cc\
+ sanitizer_win.cc\
+ sanitizer_common_libcdep.cc\
+ sanitizer_coverage_libcdep.cc\
+ sanitizer_coverage_mapping_libcdep.cc\
+ sanitizer_linux_libcdep.cc\
+ sanitizer_posix_libcdep.cc\
+ sanitizer_stacktrace_libcdep.cc\
+ sanitizer_stoptheworld_linux_libcdep.cc\
+ sanitizer_symbolizer_libcdep.cc\
+ sanitizer_symbolizer_posix_libcdep.cc\
+ sanitizer_unwind_posix_libcdep.cc\
+ lsan_common.cc\
+ lsan_common_linux.cc
+
+.include <bsd.lib.mk>
diff --git a/lib/libclang_rt/asan_cxx/Makefile b/lib/libclang_rt/asan_cxx/Makefile
new file mode 100644
index 0000000..9763c16
--- /dev/null
+++ b/lib/libclang_rt/asan_cxx/Makefile
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+.include <bsd.init.mk>
+
+LIB= clang_rt.asan_cxx-${CRTARCH}
+
+.PATH: ${CRTSRC}/lib/asan
+
+SRCS= asan_new_delete.cc
+
+.include <bsd.lib.mk>
diff --git a/lib/libclang_rt/profile/Makefile b/lib/libclang_rt/profile/Makefile
new file mode 100644
index 0000000..058a8f1
--- /dev/null
+++ b/lib/libclang_rt/profile/Makefile
@@ -0,0 +1,17 @@
+# $FreeBSD$
+
+.include <bsd.init.mk>
+
+LIB= clang_rt.profile-${CRTARCH}
+
+.PATH: ${CRTSRC}/lib/profile
+
+SRCS= GCDAProfiling.c\
+ InstrProfiling.c\
+ InstrProfilingBuffer.c\
+ InstrProfilingFile.c\
+ InstrProfilingPlatformDarwin.c\
+ InstrProfilingPlatformOther.c\
+ InstrProfilingRuntime.cc\
+
+.include <bsd.lib.mk>
diff --git a/lib/libclang_rt/san/Makefile b/lib/libclang_rt/san/Makefile
new file mode 100644
index 0000000..9926252
--- /dev/null
+++ b/lib/libclang_rt/san/Makefile
@@ -0,0 +1,48 @@
+# $FreeBSD$
+
+.include <bsd.init.mk>
+
+LIB= clang_rt.san-${CRTARCH}
+
+.PATH: ${CRTSRC}/lib/sanitizer_common\
+
+SRCS= sanitizer_allocator.cc\
+ sanitizer_common.cc\
+ sanitizer_deadlock_detector1.cc\
+ sanitizer_deadlock_detector2.cc\
+ sanitizer_flags.cc\
+ sanitizer_libc.cc\
+ sanitizer_libignore.cc\
+ sanitizer_linux.cc\
+ sanitizer_mac.cc\
+ sanitizer_persistent_allocator.cc\
+ sanitizer_platform_limits_linux.cc\
+ sanitizer_platform_limits_posix.cc\
+ sanitizer_posix.cc\
+ sanitizer_printf.cc\
+ sanitizer_procmaps_common.cc\
+ sanitizer_procmaps_freebsd.cc\
+ sanitizer_procmaps_linux.cc\
+ sanitizer_procmaps_mac.cc\
+ sanitizer_stackdepot.cc\
+ sanitizer_stacktrace.cc\
+ sanitizer_stacktrace_printer.cc\
+ sanitizer_suppressions.cc\
+ sanitizer_symbolizer.cc\
+ sanitizer_symbolizer_libbacktrace.cc\
+ sanitizer_symbolizer_win.cc\
+ sanitizer_tls_get_addr.cc\
+ sanitizer_thread_registry.cc\
+ sanitizer_win.cc\
+ sanitizer_common_libcdep.cc\
+ sanitizer_coverage_libcdep.cc\
+ sanitizer_coverage_mapping_libcdep.cc\
+ sanitizer_linux_libcdep.cc\
+ sanitizer_posix_libcdep.cc\
+ sanitizer_stacktrace_libcdep.cc\
+ sanitizer_stoptheworld_linux_libcdep.cc\
+ sanitizer_symbolizer_libcdep.cc\
+ sanitizer_symbolizer_posix_libcdep.cc\
+ sanitizer_unwind_posix_libcdep.cc
+
+.include <bsd.lib.mk>
diff --git a/lib/libclang_rt/ubsan/Makefile b/lib/libclang_rt/ubsan/Makefile
new file mode 100644
index 0000000..34bca81
--- /dev/null
+++ b/lib/libclang_rt/ubsan/Makefile
@@ -0,0 +1,17 @@
+# $FreeBSD$
+
+.include <bsd.init.mk>
+
+LIB= clang_rt.ubsan-${CRTARCH}
+
+.PATH: ${CRTSRC}/lib/ubsan
+
+SRCS= ubsan_diag.cc\
+ ubsan_init.cc\
+ ubsan_flags.cc\
+ ubsan_handlers.cc\
+ ubsan_value.cc
+
+.include <bsd.lib.mk>
+
+
diff --git a/lib/libclang_rt/ubsan_cxx/Makefile b/lib/libclang_rt/ubsan_cxx/Makefile
new file mode 100644
index 0000000..e577a15
--- /dev/null
+++ b/lib/libclang_rt/ubsan_cxx/Makefile
@@ -0,0 +1,14 @@
+# $FreeBSD$
+
+.include <bsd.init.mk>
+
+LIB= clang_rt.ubsan_cxx-${CRTARCH}
+
+CXXFLAGS+=-frtti
+
+.PATH: ${CRTSRC}/lib/ubsan
+
+SRCS= ubsan_handlers_cxx.cc\
+ ubsan_type_hash.cc
+
+.include <bsd.lib.mk>
OpenPOWER on IntegriCloud