Module Name:    src
Committed By:   mrg
Date:           Fri Oct  4 08:51:33 UTC 2019

Modified Files:
        src/external/gpl3/gcc: README.gcc8
        src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64-netbsd.h
        src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_allocator.cc
            lsan_allocator.h
        src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
            sanitizer_platform_limits_netbsd.h
            sanitizer_stoptheworld_linux_libcdep.cc
        src/external/gpl3/gcc/dist/libsanitizer/ubsan: ubsan_handlers_cxx.cc
        src/external/gpl3/gcc/lib/libsupc++: Makefile.common
        src/external/gpl3/gcc/lib/libubsan: Makefile
        src/external/gpl3/gcc/usr.bin/gcc/arch/aarch64: configargs.h

Log Message:
- update README.gcc8 to include current status
- netbsd/arm64 uses 64 byte malloc alignment
- make lsan compile on sparc*, mips*, ppc and arm64 again
- add missing sparc, alpha and i386 abi compat for struct __sanitizer_addrinfo
- avoid linux includes on arm64
- avoid multiply defined __ubsan_handle_cfi_bad_type when UBSAN_CAN_USE_CXXABI
  isn't defined, and, undefine it
- bad_array_length.cc and bad_array_new.cc lose special build rules
- regen arm64 mknative


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gcc/README.gcc8
cvs rdiff -u -r1.3 -r1.4 \
    src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h
cvs rdiff -u -r1.5 -r1.6 \
    src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc
cvs rdiff -u -r1.1.1.2 -r1.2 \
    src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h
cvs rdiff -u -r1.1.1.1 -r1.2 \
    
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h
cvs rdiff -u -r1.9 -r1.10 \
    
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
cvs rdiff -u -r1.1.1.4 -r1.2 \
    src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_handlers_cxx.cc
cvs rdiff -u -r1.14 -r1.15 \
    src/external/gpl3/gcc/lib/libsupc++/Makefile.common
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gcc/lib/libubsan/Makefile
cvs rdiff -u -r1.11 -r1.12 \
    src/external/gpl3/gcc/usr.bin/gcc/arch/aarch64/configargs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/README.gcc8
diff -u src/external/gpl3/gcc/README.gcc8:1.1 src/external/gpl3/gcc/README.gcc8:1.2
--- src/external/gpl3/gcc/README.gcc8:1.1	Wed Oct  2 04:23:58 2019
+++ src/external/gpl3/gcc/README.gcc8	Fri Oct  4 08:51:32 2019
@@ -1,4 +1,4 @@
-$NetBSD: README.gcc8,v 1.1 2019/10/02 04:23:58 mrg Exp $
+$NetBSD: README.gcc8,v 1.2 2019/10/04 08:51:32 mrg Exp $
 
 new stuff:
 	cc1objcplus
@@ -21,43 +21,43 @@ switched:	has port switched?  y (yes), n
 
 architecture	tools	kernels	libgcc	native-gcc	make release	runs	atf	switched
 ------------	-----	-------	------	----------	------------	----	---	--------
-aarch64		?	?	?	?		?		?	?	?
-alpha		?	?	?	?		?		?	?	?
-arm		?	?	?	?		?		?	?	?
-armeb		?	?	?	?		?		?	?	?
-earmv4		?	?	?	?		?		?	?	?
-earmv4eb	?	?	?	?		?		?	?	?
-earm		?	?	?	?		?		?	?	?
-earmeb		?	?	?	?		?		?	?	?
-earmhf		?	?	?	?		?		?	?	?
-earmhfeb	?	?	?	?		?		?	?	?
-earmv6		?	?	?	?		?		?	?	?
-earmv6eb	?	?	?	?		?		?	?	?
-earmv6hf	?	?	?	?		?		?	?	?
-earmv6hfeb	?	?	?	?		?		?	?	?
-earmv7		?	?	?	?		?		?	?	?
-earmv7eb	?	?	?	?		?		?	?	?
-earmv7hf	?	?	?	?		?		?	?	?
-earmv7hfeb	?	?	?	?		?		?	?	?
-hppa		?	?	?	?		?		?	?	?
-i386		?	?	?	?		?		?	?	?
-ia64		?	?	?	?		?		?	?	?
-m68000		?	?	?	?		?		?	?	?
-m68k		?	?	?	?		?		?	?	?
-mipseb		?	?	?	?		?		?	?	?
-mipsel		?	?	?	?		?		?	?	?
-mips64eb	?	?	?	?		?		?	?	?
-mips64el	?	?	?	?		?		?	?	?
-powerpc		?	?	?	?		?		?	?	?
-powerpc64	?	?	?	?		?		?	?	?
-sh3eb		?	?	?	?		?		?	?	?
-sh3el		?	?	?	?		?		?	?	?
-sparc		?	?	?	?		?		?	?	?
-sparc64		?	?	?	?		?		?	?	?
-vax		?	?	?	?		?		?	?	?
-x86_64		?	?	?	?		?		?	?	?
-riscv32		?	?	?	?		?		?	?	?	
-riscv64		?	?	?	?		?		?	?	?
+aarch64		y	y	y	y		?		?	?	?
+alpha		y	?	?	y		?		?	?	?
+arm		y	?	?	y		?		?	?	?
+armeb		y	?	?	y		?		?	?	?
+earmv4		y	?	?	y		?		?	?	?
+earmv4eb	y	?	?	y		?		?	?	?
+earm		y	?	?	y		?		?	?	?
+earmeb		y	?	?	y		?		?	?	?
+earmhf		y	?	?	y		?		?	?	?
+earmhfeb	y	?	?	y		?		?	?	?
+earmv6		y	?	?	y		?		?	?	?
+earmv6eb	y	?	?	y		?		?	?	?
+earmv6hf	y	?	?	y		?		?	?	?
+earmv6hfeb	y	?	?	y		?		?	?	?
+earmv7		y	?	?	y		?		?	?	?
+earmv7eb	y	?	?	y		?		?	?	?
+earmv7hf	y	?	?	y		?		?	?	?
+earmv7hfeb	y	?	?	y		?		?	?	?
+hppa		y	?	?	y		?		?	?	?
+i386		y	?	?	y		?		?	?	?
+ia64		y	?	?	y		?		?	?	?
+m68000		y	?	?	y		?		?	?	?
+m68k		y	?	?	y		?		?	?	?
+mipseb		y	?	?	y		?		?	?	?
+mipsel		y	?	?	y		?		?	?	?
+mips64eb	y	?	?	y		?		?	?	?
+mips64el	y	?	?	y		?		?	?	?
+powerpc		y	?	?	y		?		?	?	?
+powerpc64	y	?	?	y		?		?	?	?
+sh3eb		y	?	?	y		?		?	?	?
+sh3el		y	?	?	y		?		?	?	?
+sparc		y	y	y	y		y		y	?	?
+sparc64		y	?	?	y		?		?	?	?
+vax		y	?	?	y		?		?	?	?
+x86_64		y	y	y	y		y		y	?	?
+riscv32		y	?	?	y		?		?	?	?	
+riscv64		y	?	?	y		?		?	?	?
 --
 coldfire	?	N/A	?	?		?		N/A	N/A
 ------------	-----	-------	------	----------	------------	----	---

Index: src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.3 src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.4
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.3	Mon Jul 16 00:04:47 2018
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h	Fri Oct  4 08:51:32 2019
@@ -20,6 +20,10 @@
 #ifndef GCC_AARCH64_NETBSD_H
 #define GCC_AARCH64_NETBSD_H
 
+/* NetBSD malloc(3) does 64, not 128 bytes. */
+#undef MALLOC_ABI_ALIGNMENT
+#define MALLOC_ABI_ALIGNMENT  64
+
 #define TARGET_LINKER_BIG_EMULATION "aarch64nbsdb"
 #define TARGET_LINKER_LITTLE_EMULATION "aarch64nbsd"
 

Index: src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc:1.5 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc:1.6
--- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc:1.5	Wed Oct  2 05:04:58 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc	Fri Oct  4 08:51:33 2019
@@ -24,7 +24,7 @@
 extern "C" void *memset(void *ptr, int value, uptr num);
 
 namespace __lsan {
-#if defined(__i386__) || defined(__arm__)
+#if defined(__i386__) || defined(__arm__) || ((defined(__sparc__) || defined(__powerpc__)) && !defined(_LP64))
 static const uptr kMaxAllowedMallocSize = 1UL << 30;
 #elif defined(__mips64) || defined(__aarch64__)
 static const uptr kMaxAllowedMallocSize = 4UL << 30;

Index: src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.1.1.2 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.1.1.2	Tue Oct  1 09:36:38 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h	Fri Oct  4 08:51:33 2019
@@ -48,8 +48,10 @@ struct ChunkMetadata {
   u32 stack_trace_id;
 };
 
-#if defined(__mips64) || defined(__aarch64__) || defined(__i386__) || \
-    defined(__arm__)
+#if defined(__aarch64__) || defined(__i386__) || defined(__arm__) || \
+    ((defined(__sparc__) || \
+      defined(__powerpc__) || \
+      defined(__mips__)) && !defined(_LP64))
 static const uptr kRegionSizeLog = 20;
 static const uptr kNumRegions = SANITIZER_MMAP_RANGE_SIZE >> kRegionSizeLog;
 typedef TwoLevelByteMap<(kNumRegions >> 12), 1 << 12> ByteMap;
@@ -65,7 +67,8 @@ struct AP32 {
   static const uptr kFlags = 0;
 };
 typedef SizeClassAllocator32<AP32> PrimaryAllocator;
-#elif defined(__x86_64__) || defined(__powerpc64__)
+#elif defined(__x86_64__) || defined(__powerpc64__) || defined(__sparc64__) || \
+      (defined(__mips64) && defined(_LP64))
 struct AP64 {  // Allocator64 parameters. Deliberately using a short name.
   static const uptr kSpaceBeg = 0x600000000000ULL;
   static const uptr kSpaceSize =  0x40000000000ULL; // 4T.
@@ -76,6 +79,8 @@ struct AP64 {  // Allocator64 parameters
 };
 
 typedef SizeClassAllocator64<AP64> PrimaryAllocator;
+#else
+#error "unsupported lsan platform"
 #endif
 typedef SizeClassAllocatorLocalCache<PrimaryAllocator> AllocatorCache;
 

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h:1.1.1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h:1.1.1.1	Tue Oct  1 09:36:38 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h	Fri Oct  4 08:51:33 2019
@@ -262,7 +262,13 @@ struct __sanitizer_addrinfo {
   int ai_family;
   int ai_socktype;
   int ai_protocol;
+#if defined(__sparc__) && defined(_LP64)
+  int __ai_pad0;      /* ABI compatibility */
+#endif  
   unsigned ai_addrlen;
+#if defined(__alpha__) || (defined(__i386__) && defined(_LP64))
+  int __ai_pad0;      /* ABI compatibility */
+#endif  
   char *ai_canonname;
   void *ai_addr;
   struct __sanitizer_addrinfo *ai_next;

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.9 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.10
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.9	Wed Oct  2 05:04:59 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc	Fri Oct  4 08:51:33 2019
@@ -33,7 +33,7 @@
 #include <sys/types.h> // for pid_t
 #include <sys/uio.h> // for iovec
 #include <elf.h> // for NT_PRSTATUS
-#if defined(__aarch64__) && !SANITIZER_ANDROID
+#if defined(__aarch64__) && !(SANITIZER_ANDROID || SANITIZER_NETBSD)
 // GLIBC 2.20+ sys/user does not include asm/ptrace.h
 # include <asm/ptrace.h>
 #endif

Index: src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_handlers_cxx.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_handlers_cxx.cc:1.1.1.4 src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_handlers_cxx.cc:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_handlers_cxx.cc:1.1.1.4	Tue Oct  1 09:36:38 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_handlers_cxx.cc	Fri Oct  4 08:51:33 2019
@@ -92,6 +92,7 @@ void __ubsan::__ubsan_handle_dynamic_typ
     Die();
 }
 
+#ifdef UBSAN_CAN_USE_CXXABI
 namespace __ubsan {
 void __ubsan_handle_cfi_bad_type(CFICheckFailData *Data, ValueHandle Vtable,
                                  bool ValidVtable, ReportOptions Opts) {
@@ -142,5 +143,6 @@ void __ubsan_handle_cfi_bad_type(CFIChec
   }
 }
 }  // namespace __ubsan
+#endif
 
 #endif // CAN_SANITIZE_UB

Index: src/external/gpl3/gcc/lib/libsupc++/Makefile.common
diff -u src/external/gpl3/gcc/lib/libsupc++/Makefile.common:1.14 src/external/gpl3/gcc/lib/libsupc++/Makefile.common:1.15
--- src/external/gpl3/gcc/lib/libsupc++/Makefile.common:1.14	Wed Oct  2 06:51:59 2019
+++ src/external/gpl3/gcc/lib/libsupc++/Makefile.common	Fri Oct  4 08:51:33 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.common,v 1.14 2019/10/02 06:51:59 mrg Exp $
+#	$NetBSD: Makefile.common,v 1.15 2019/10/04 08:51:33 mrg Exp $
 
 DIST=		${GCCDIST}
 GNUHOSTDIST=	${DIST}
@@ -35,8 +35,6 @@ COPTS.${_f}+=	-std=gnu++98
 .endfor
 
 STD_GNU11=	\
-		bad_array_length.cc \
-		bad_array_new.cc \
 		eh_aux_runtime.cc \
 		eh_ptr.cc \
 		eh_terminate.cc \

Index: src/external/gpl3/gcc/lib/libubsan/Makefile
diff -u src/external/gpl3/gcc/lib/libubsan/Makefile:1.13 src/external/gpl3/gcc/lib/libubsan/Makefile:1.14
--- src/external/gpl3/gcc/lib/libubsan/Makefile:1.13	Wed Oct  2 06:51:59 2019
+++ src/external/gpl3/gcc/lib/libubsan/Makefile	Fri Oct  4 08:51:33 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2019/10/02 06:51:59 mrg Exp $
+#	$NetBSD: Makefile,v 1.14 2019/10/04 08:51:33 mrg Exp $
 
 UNSUPPORTED_COMPILER.clang=	# defined
 LIBISCXX = yes
@@ -31,6 +31,6 @@ COPTS.ubsan_handlers_cxx.cc+= -Wno-error
 LIB=	ubsan
 SRCS+=	${UBSAN_SRCS}
 LIBDPLIBS+= rt ${NETBSDSRCDIR}/lib/librt
-CPPFLAGS+=-DCAN_SANITIZE_UB=1 -DUBSAN_CAN_USE_CXXABI=1
+CPPFLAGS+=-DCAN_SANITIZE_UB=1
 
 .include <bsd.lib.mk>

Index: src/external/gpl3/gcc/usr.bin/gcc/arch/aarch64/configargs.h
diff -u src/external/gpl3/gcc/usr.bin/gcc/arch/aarch64/configargs.h:1.11 src/external/gpl3/gcc/usr.bin/gcc/arch/aarch64/configargs.h:1.12
--- src/external/gpl3/gcc/usr.bin/gcc/arch/aarch64/configargs.h:1.11	Wed Oct  2 07:15:01 2019
+++ src/external/gpl3/gcc/usr.bin/gcc/arch/aarch64/configargs.h	Fri Oct  4 08:51:33 2019
@@ -3,7 +3,7 @@
 /* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp  */
 
 /* Generated automatically. */
-static const char configuration_arguments[] = "/usr/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=aarch64--netbsd --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/support/send-pr.html --with-pkgversion='NetBSD nb1 20190930' --with-system-zlib --without-isl --enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads --with-diagnostics-color=auto-if-env --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419 --with-default-libstdcxx-abi=new --with-mpc-lib=/var/obj/mknative/evbarm-aarch64/usr/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/evbarm-aarch64/usr/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/evbarm-aarch64/usr/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/src/external/lgpl3/gmp/lib/libgmp/arch/aarch64 --enable-tls --disable-multilib --disable-libst
 dcxx-pch --build=aarch64--netbsd --host=aarch64--netbsd --with-sysroot=/var/obj/mknative/evbarm-aarch64/usr/src/destdir.evbarm : (reconfigured) ";
+static const char configuration_arguments[] = "/usr/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=aarch64--netbsd --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/support/send-pr.html --with-pkgversion='NetBSD nb1 20190930' --with-system-zlib --without-isl --enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads --with-diagnostics-color=auto-if-env --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419 --with-default-libstdcxx-abi=new --with-mpc-lib=/var/obj/mknative/evbarm-aarch64/usr/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/evbarm-aarch64/usr/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/evbarm-aarch64/usr/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/src/external/lgpl3/gmp/lib/libgmp/arch/aarch64 --enable-tls --disable-multilib --disable-libst
 dcxx-pch --build=aarch64--netbsd --host=aarch64--netbsd --with-sysroot=/var/obj/mknative/evbarm-aarch64/usr/src/destdir.evbarm";
 static const char thread_model[] = "posix";
 
 static const struct {

Reply via email to