Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl3/gcc/lib Add ubsan (not enabled, not tested, co...
details: https://anonhg.NetBSD.org/src/rev/9aa3ea18772c
branches: trunk
changeset: 345615:9aa3ea18772c
user: christos <christos%NetBSD.org@localhost>
date: Wed Jun 01 22:48:55 2016 +0000
description:
Add ubsan (not enabled, not tested, compiling)
Update tsan (not enable, not tested, not compiling)
Merge common infrastructure.
XXX: Perhaps the common code should be made into a separate library?
Or always require asan?
diffstat:
external/gpl3/gcc/lib/Makefile.sanitizer | 76 ++++++++++++++++++++++++
external/gpl3/gcc/lib/libasan/Makefile | 71 +---------------------
external/gpl3/gcc/lib/libtsan/Makefile | 86 +++++++++------------------
external/gpl3/gcc/lib/libubsan/Makefile | 23 +++++++
external/gpl3/gcc/lib/libubsan/shlib_version | 2 +
5 files changed, 135 insertions(+), 123 deletions(-)
diffs (truncated from 308 to 300 lines):
diff -r f7e4422627f2 -r 9aa3ea18772c external/gpl3/gcc/lib/Makefile.sanitizer
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/gpl3/gcc/lib/Makefile.sanitizer Wed Jun 01 22:48:55 2016 +0000
@@ -0,0 +1,76 @@
+# $NetBSD: Makefile.sanitizer,v 1.1 2016/06/01 22:48:55 christos Exp $
+
+SANITIZER=${GCCDIST}/libsanitizer
+.PATH: ${SANITIZER}/interception ${SANITIZER}/sanitizer_common
+
+INTERCEPTION_SRCS= \
+interception_linux.cc \
+interception_mac.cc \
+interception_type_test.cc \
+interception_win.cc
+
+SANITIZER_SRCS= \
+sanitizer_allocator.cc \
+sanitizer_common.cc \
+sanitizer_common_libcdep.cc \
+sanitizer_coverage_libcdep.cc \
+sanitizer_coverage_mapping_libcdep.cc \
+sanitizer_deadlock_detector1.cc \
+sanitizer_deadlock_detector2.cc \
+sanitizer_flags.cc \
+sanitizer_libc.cc \
+sanitizer_libignore.cc \
+sanitizer_linux.cc \
+sanitizer_linux_libcdep.cc \
+sanitizer_mac.cc \
+sanitizer_persistent_allocator.cc \
+sanitizer_platform_limits_linux.cc \
+sanitizer_platform_limits_posix.cc \
+sanitizer_posix.cc \
+sanitizer_posix_libcdep.cc \
+sanitizer_printf.cc \
+sanitizer_procmaps_common.cc \
+sanitizer_procmaps_netbsd.cc \
+sanitizer_procmaps_freebsd.cc \
+sanitizer_procmaps_linux.cc \
+sanitizer_procmaps_mac.cc \
+sanitizer_stackdepot.cc \
+sanitizer_stacktrace.cc \
+sanitizer_stacktrace_libcdep.cc \
+sanitizer_stacktrace_printer.cc \
+sanitizer_stoptheworld_linux_libcdep.cc \
+sanitizer_suppressions.cc \
+sanitizer_symbolizer.cc \
+sanitizer_symbolizer_libbacktrace.cc \
+sanitizer_symbolizer_libcdep.cc \
+sanitizer_symbolizer_posix_libcdep.cc \
+sanitizer_symbolizer_win.cc \
+sanitizer_thread_registry.cc \
+sanitizer_tls_get_addr.cc \
+sanitizer_unwind_posix_libcdep.cc \
+sanitizer_win.cc
+
+# The linux build does this to avoid preinit sections on shared libraries
+CSHLIBFLAGS+= -DPIC
+
+SRCS+= ${INTERCEPTION_SRCS} ${SANITIZER_SRCS}
+CPPFLAGS+=-I${SANITIZER}/include -I${SANITIZER}
+CPPFLAGS.sanitizer_netbsd.cc+=-I${GCCDIST}/gcc/ginclude
+CPPFLAGS+=-D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
+CPPFLAGS+=-D__STDC_LIMIT_MACROS -DSANITIZER_HAS_EXCEPTIONS=1
+CPPFLAGS+=-DSANITIZER_FLEXIBLE_MAPPING_AND_OFFSET=0 -DSANITIZER_NEEDS_SEGV=1
+
+LIBDPLIBS+= stdc++ ${.CURDIR}/../libstdc++-v3
+LIBDPLIBS+= pthread ${.CURDIR}/../../../../../lib/libpthread
+COPTS+=-std=gnu++11 -fsized-deallocation -fvisibility=hidden
+COPTS+=-fno-builtin -fno-exceptions -fno-rtti -funwind-tables
+
+# Can't profile without it`
+#-fomit-frame-pointer
+
+.if ${MACHINE_ARCH} == "vax"
+COPTS.sanitizer_mac.cc += -O1
+COPTS.sanitizer_netbsd.cc += -O1
+COPTS.sanitizer_printf.cc += -O1
+COPTS.sanitizer_stackdepot.cc += -O1
+.endif
diff -r f7e4422627f2 -r 9aa3ea18772c external/gpl3/gcc/lib/libasan/Makefile
--- a/external/gpl3/gcc/lib/libasan/Makefile Wed Jun 01 22:27:49 2016 +0000
+++ b/external/gpl3/gcc/lib/libasan/Makefile Wed Jun 01 22:48:55 2016 +0000
@@ -1,10 +1,11 @@
+# $NetBSD: Makefile,v 1.16 2016/06/01 22:48:55 christos Exp $
.include <bsd.own.mk>
.include "../Makefile.inc"
+.include "../Makefile.sanitizer"
-ASAN=${GCCDIST}/libsanitizer
-.PATH: ${ASAN}/asan ${ASAN}/interception ${ASAN}/sanitizer_common
+.PATH: ${SANITIZER}/asan
ASAN_SRCS= \
asan_activation.cc \
@@ -30,75 +31,11 @@
asan_win_dll_thunk.cc \
asan_win_dynamic_runtime_thunk.cc
-INTERCEPTION_SRCS= \
-interception_linux.cc \
-interception_mac.cc \
-interception_type_test.cc \
-interception_win.cc
-
-SANITIZER_SRCS= \
-sanitizer_allocator.cc \
-sanitizer_common.cc \
-sanitizer_common_libcdep.cc \
-sanitizer_coverage_libcdep.cc \
-sanitizer_coverage_mapping_libcdep.cc \
-sanitizer_deadlock_detector1.cc \
-sanitizer_deadlock_detector2.cc \
-sanitizer_flags.cc \
-sanitizer_libc.cc \
-sanitizer_libignore.cc \
-sanitizer_linux.cc \
-sanitizer_linux_libcdep.cc \
-sanitizer_mac.cc \
-sanitizer_persistent_allocator.cc \
-sanitizer_platform_limits_linux.cc \
-sanitizer_platform_limits_posix.cc \
-sanitizer_posix.cc \
-sanitizer_posix_libcdep.cc \
-sanitizer_printf.cc \
-sanitizer_procmaps_common.cc \
-sanitizer_procmaps_netbsd.cc \
-sanitizer_procmaps_freebsd.cc \
-sanitizer_procmaps_linux.cc \
-sanitizer_procmaps_mac.cc \
-sanitizer_stackdepot.cc \
-sanitizer_stacktrace.cc \
-sanitizer_stacktrace_libcdep.cc \
-sanitizer_stacktrace_printer.cc \
-sanitizer_stoptheworld_linux_libcdep.cc \
-sanitizer_suppressions.cc \
-sanitizer_symbolizer.cc \
-sanitizer_symbolizer_libbacktrace.cc \
-sanitizer_symbolizer_libcdep.cc \
-sanitizer_symbolizer_posix_libcdep.cc \
-sanitizer_symbolizer_win.cc \
-sanitizer_thread_registry.cc \
-sanitizer_tls_get_addr.cc \
-sanitizer_unwind_posix_libcdep.cc \
-sanitizer_win.cc
-
-# The linux build does this to avoid preinit sections on shared libraries
-CSHLIBFLAGS+= -DPIC
-
LIB= asan
-SRCS= ${ASAN_SRCS} ${INTERCEPTION_SRCS} ${SANITIZER_SRCS}
-CPPFLAGS+=-I${ASAN}/include -I${ASAN}
-CPPFLAGS.sanitizer_netbsd.cc+=-I${GCCDIST}/gcc/ginclude
-CPPFLAGS+=-D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DASAN_HAS_EXCEPTIONS=1 -DASAN_FLEXIBLE_MAPPING_AND_OFFSET=0 -DASAN_NEEDS_SEGV=1
-
-LIBDPLIBS+= stdc++ ${.CURDIR}/../libstdc++-v3
-LIBDPLIBS+= pthread ${.CURDIR}/../../../../../lib/libpthread
-COPTS+=-std=gnu++11 -fsized-deallocation -fvisibility=hidden
-COPTS+=-fno-builtin -fno-exceptions -fno-rtti -funwind-tables
-# Can't profile without it`
-#-fomit-frame-pointer
+SRCS+= ${ASAN_SRCS}
.if ${MACHINE_ARCH} == "vax"
COPTS.asan_allocator2.cc += -O1
-COPTS.sanitizer_mac.cc += -O1
-COPTS.sanitizer_netbsd.cc += -O1
-COPTS.sanitizer_printf.cc += -O1
-COPTS.sanitizer_stackdepot.cc += -O1
.endif
.include <bsd.lib.mk>
diff -r f7e4422627f2 -r 9aa3ea18772c external/gpl3/gcc/lib/libtsan/Makefile
--- a/external/gpl3/gcc/lib/libtsan/Makefile Wed Jun 01 22:27:49 2016 +0000
+++ b/external/gpl3/gcc/lib/libtsan/Makefile Wed Jun 01 22:48:55 2016 +0000
@@ -1,67 +1,41 @@
-# $NetBSD: Makefile,v 1.3 2016/01/05 13:07:46 christos Exp $
+# $NetBSD: Makefile,v 1.4 2016/06/01 22:48:55 christos Exp $
.include <bsd.own.mk>
.include "../Makefile.inc"
+.include "../Makefile.sanitizer"
-TSAN=${GCCDIST}/libsanitizer
-.PATH: ${TSAN}/tsan ${TSAN}/interception ${TSAN}/sanitizer_common
+.PATH: ${SANITIZER}/tsan
TSAN_SRCS= \
- tsan_clock.cc \
- tsan_fd.cc \
- tsan_flags.cc \
- tsan_interceptors.cc \
- tsan_interface.cc \
- tsan_interface_ann.cc \
- tsan_interface_atomic.cc \
- tsan_interface_java.cc \
- tsan_md5.cc \
- tsan_mman.cc \
- tsan_mutex.cc \
- tsan_mutexset.cc \
- tsan_platform_linux.cc \
- tsan_platform_mac.cc \
- tsan_report.cc \
- tsan_rtl.cc \
- tsan_rtl_amd64.S \
- tsan_rtl_mutex.cc \
- tsan_rtl_report.cc \
- tsan_rtl_thread.cc \
- tsan_stat.cc \
- tsan_suppressions.cc \
- tsan_symbolize.cc \
- tsan_symbolize_addr2line_linux.cc \
- tsan_sync.cc
-
-INTERCEPTION_SRCS= \
- interception_linux.cc \
- interception_type_test.cc
-
-SANITIZER_SRCS= \
- sanitizer_allocator.cc \
- sanitizer_common.cc \
- sanitizer_flags.cc \
- sanitizer_libc.cc \
- sanitizer_netbsd.cc \
- sanitizer_mac.cc \
- sanitizer_posix.cc \
- sanitizer_platform_limits_posix.cc \
- sanitizer_printf.cc \
- sanitizer_stackdepot.cc \
- sanitizer_stacktrace.cc \
- sanitizer_symbolizer.cc \
- sanitizer_symbolizer_linux.cc \
- sanitizer_win.cc
-
-# The linux build does this to avoid preinit sections on shared libraries
-CSHLIBFLAGS+= -DPIC
+tsan_clock.o \
+tsan_fd.o \
+tsan_flags.o \
+tsan_ignoreset.o \
+tsan_interceptors.o \
+tsan_interface.o \
+tsan_interface_ann.o \
+tsan_interface_atomic.o \
+tsan_interface_java.o \
+tsan_md5.o \
+tsan_mman.o \
+tsan_mutex.o \
+tsan_mutexset.o \
+tsan_platform_linux.o \
+tsan_platform_mac.o \
+tsan_platform_windows.o \
+tsan_report.o \
+tsan_rtl.o \
+tsan_rtl_mutex.o \
+tsan_rtl_report.o \
+tsan_rtl_thread.o \
+tsan_stack_trace.o \
+tsan_stat.o \
+tsan_suppressions.o \
+tsan_symbolize.o \
+tsan_sync.o
LIB= tsan
-SRCS= ${TSAN_SRCS} ${INTERCEPTION_SRCS} ${SANITIZER_SRCS}
-CPPFLAGS+=-I${TSAN}/include -I${TSAN}
-
-LIBDPLIBS+= stdc++ ${.CURDIR}/../libstdc++-v3 \
- pthread ${NETBSDSRCDIR}/lib/libpthread
+SRCS+= ${TSAN_SRCS}
.include <bsd.lib.mk>
diff -r f7e4422627f2 -r 9aa3ea18772c external/gpl3/gcc/lib/libubsan/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/gpl3/gcc/lib/libubsan/Makefile Wed Jun 01 22:48:55 2016 +0000
@@ -0,0 +1,23 @@
+# $NetBSD: Makefile,v 1.1 2016/06/01 22:48:55 christos Exp $
+.include <bsd.own.mk>
+
+.include "../Makefile.inc"
+.include "../Makefile.sanitizer"
+
+.PATH: ${SANITIZER}/ubsan
+
+UBSAN_SRCS= \
+ubsan_diag.o \
+ubsan_flags.o \
+ubsan_handlers.o \
+ubsan_handlers_cxx.o \
+ubsan_init.o \
+ubsan_type_hash.o \
+ubsan_value.o
+
+COPTS.ubsan_type_hash.cc+=-frtti
+
+LIB= ubsan
+SRCS+= ${UBSAN_SRCS}
Home |
Main Index |
Thread Index |
Old Index