CVS commit: src/external/gpl3/gcc/dist/gcc/ginclude

2021-07-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul 17 16:31:51 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/ginclude: stddef.h

Log Message:
provide an equivalent alignment for __float128 for clang and i386 that
does not have it. Idea from mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc/dist/gcc/ginclude/stddef.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/dist/gcc/ginclude/stddef.h
diff -u src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h:1.10 src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h:1.11
--- src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h:1.10	Wed Jul 14 09:24:58 2021
+++ src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h	Sat Jul 17 12:31:51 2021
@@ -420,9 +420,14 @@ typedef struct {
  use __float128 here; that is only available on some
  architectures, but only on i386 is extra alignment needed for
  __float128.  */
-#if defined(__i386__) && !defined(__clang__)
+#if defined(__i386__)
+#ifdef __clang__
+  // 16 is the gcc alignment for __float128
+  long long __max_align_128 __attribute__((__aligned__(16)));
+#else
   __float128 __max_align_f128 __attribute__((__aligned__(__alignof(__float128;
 #endif
+#endif
 } max_align_t;
 #endif
 #endif /* C11 or C++11.  */



CVS commit: src/external/gpl3/gcc/dist/gcc/ginclude

2021-07-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jul 14 13:24:59 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/ginclude: stddef.h

Log Message:
clang does not support __float128 in our configuration and i386


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gcc/dist/gcc/ginclude/stddef.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/dist/gcc/ginclude/stddef.h
diff -u src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h:1.9 src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h:1.10
--- src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h:1.9	Sat Apr 10 20:02:17 2021
+++ src/external/gpl3/gcc/dist/gcc/ginclude/stddef.h	Wed Jul 14 09:24:58 2021
@@ -420,7 +420,7 @@ typedef struct {
  use __float128 here; that is only available on some
  architectures, but only on i386 is extra alignment needed for
  __float128.  */
-#ifdef __i386__
+#if defined(__i386__) && !defined(__clang__)
   __float128 __max_align_f128 __attribute__((__aligned__(__alignof(__float128;
 #endif
 } max_align_t;



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2021-07-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jul 13 06:56:24 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64-netbsd.h

Log Message:
Fix a comment


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.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/dist/gcc/config/aarch64/aarch64-netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.5 src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.6
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.5	Sat Apr 24 06:44:24 2021
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h	Tue Jul 13 06:56:24 2021
@@ -20,7 +20,7 @@
 #ifndef GCC_AARCH64_NETBSD_H
 #define GCC_AARCH64_NETBSD_H
 
-/* NetBSD malloc(3) does 64, not 128 bytes. */
+/* NetBSD malloc(3) does 64, not 128 bits. */
 #undef MALLOC_ABI_ALIGNMENT
 #define MALLOC_ABI_ALIGNMENT  64
 



CVS commit: src/external/gpl3/gcc/dist/gcc/config/pa

2021-07-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jul 13 06:56:09 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/pa: pa-netbsd.h

Log Message:
Fix a comment


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc/dist/gcc/config/pa/pa-netbsd.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/dist/gcc/config/pa/pa-netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/pa/pa-netbsd.h:1.6 src/external/gpl3/gcc/dist/gcc/config/pa/pa-netbsd.h:1.7
--- src/external/gpl3/gcc/dist/gcc/config/pa/pa-netbsd.h:1.6	Sun Nov  3 01:03:30 2019
+++ src/external/gpl3/gcc/dist/gcc/config/pa/pa-netbsd.h	Tue Jul 13 06:56:09 2021
@@ -131,7 +131,7 @@ along with GCC; see the file COPYING3.  
 #undef PTRDIFF_TYPE
 #define PTRDIFF_TYPE "long int"
 
-/* NetBSD always uses 128 byte alignment.  */
+/* NetBSD always uses 128 bits / 16 byte alignment.  */
 #undef MALLOC_ABI_ALIGNMENT
 #define MALLOC_ABI_ALIGNMENT 128
 



CVS commit: src/external/gpl3/gcc/dist/gcc/config/i386

2021-07-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jul 11 22:41:39 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/i386: i386.c i386.h netbsd-elf.h
netbsd64.h

Log Message:
define a X86_32_ASAN_BIT_OFFSET macro that defaults differently on
netbsd/i386 than other x86-32 targets.

fixes PR#56280.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/external/gpl3/gcc/dist/gcc/config/i386/i386.c
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gcc/dist/gcc/config/i386/i386.h \
src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h \
src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.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/dist/gcc/config/i386/i386.c
diff -u src/external/gpl3/gcc/dist/gcc/config/i386/i386.c:1.24 src/external/gpl3/gcc/dist/gcc/config/i386/i386.c:1.25
--- src/external/gpl3/gcc/dist/gcc/config/i386/i386.c:1.24	Sun Apr 11 00:02:13 2021
+++ src/external/gpl3/gcc/dist/gcc/config/i386/i386.c	Sun Jul 11 22:41:38 2021
@@ -1399,7 +1399,7 @@ ix86_asan_shadow_offset (void)
 {
   return TARGET_LP64 ? (TARGET_MACHO ? (HOST_WIDE_INT_1 << 44)
  : HOST_WIDE_INT_C (0x7fff8000))
-		 : (HOST_WIDE_INT_1 << 29);
+		 : (HOST_WIDE_INT_1 << X86_32_ASAN_BIT_OFFSET);
 }
 
 /* Argument support functions.  */

Index: src/external/gpl3/gcc/dist/gcc/config/i386/i386.h
diff -u src/external/gpl3/gcc/dist/gcc/config/i386/i386.h:1.14 src/external/gpl3/gcc/dist/gcc/config/i386/i386.h:1.15
--- src/external/gpl3/gcc/dist/gcc/config/i386/i386.h:1.14	Sun Apr 11 00:02:14 2021
+++ src/external/gpl3/gcc/dist/gcc/config/i386/i386.h	Sun Jul 11 22:41:39 2021
@@ -2975,6 +2975,9 @@ extern enum attr_cpu ix86_schedule;
 #define NUM_X86_64_MS_CLOBBERED_REGS 12
 #endif
 
+/* Standard location for 32-bit ASAN shadow map.  */
+#define X86_32_ASAN_BIT_OFFSET 29
+
 /*
 Local variables:
 version-control: t
Index: src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h:1.14 src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h:1.15
--- src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h:1.14	Sun Apr 11 00:02:14 2021
+++ src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h	Sun Jul 11 22:41:39 2021
@@ -129,3 +129,7 @@ along with GCC; see the file COPYING3.  
 /* Preserve i386 psABI  */
 #undef PREFERRED_STACK_BOUNDARY_DEFAULT
 #define PREFERRED_STACK_BOUNDARY_DEFAULT MIN_STACK_BOUNDARY
+
+/* NetBSD/x86 on 32-bit places the ASAN shadow map at 0x4000.  */
+#undef X86_32_ASAN_BIT_OFFSET
+#define X86_32_ASAN_BIT_OFFSET 30
Index: src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h:1.14 src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h:1.15
--- src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h:1.14	Sun Apr 11 00:02:14 2021
+++ src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h	Sun Jul 11 22:41:39 2021
@@ -73,3 +73,7 @@ along with GCC; see the file COPYING3.  
   ((TARGET_64BIT || TARGET_SSE) ? 128 : 32)
 
 #define HAVE_ENABLE_EXECUTE_STACK
+
+/* NetBSD/x86 on 32-bit places the ASAN shadow map at 0x4000.  */
+#undef X86_32_ASAN_BIT_OFFSET
+#define X86_32_ASAN_BIT_OFFSET 30



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/asan

2021-07-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Jul 10 22:39:56 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_linux.cc

Log Message:
remove an old #if 0'd section.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
src/external/gpl3/gcc/dist/libsanitizer/asan/asan_linux.cc

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/dist/libsanitizer/asan/asan_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/asan/asan_linux.cc:1.15 src/external/gpl3/gcc/dist/libsanitizer/asan/asan_linux.cc:1.16
--- src/external/gpl3/gcc/dist/libsanitizer/asan/asan_linux.cc:1.15	Sun Apr 11 23:54:25 2021
+++ src/external/gpl3/gcc/dist/libsanitizer/asan/asan_linux.cc	Sat Jul 10 22:39:56 2021
@@ -234,139 +234,6 @@ void AsanCheckIncompatibleRT() {
 }
 #endif // SANITIZER_ANDROID
 
-#if 0 // was in old netbsd / gcc 5 sanitizer stuff
-void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {
-#ifdef __NetBSD__
-# define __UC_MACHINE_FP(ucontext, r) \
-(ucontext)->uc_mcontext.__gregs[(r)]
-/*
- * Unfortunately we don't have a portable frame pointer (yet)
- */
-# if defined(__alpha__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_S6)
-# elif defined(__arm__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_FP)
-# elif defined(__x86_64__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_RBP)
-# elif defined(__i386__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_EBP)
-# elif defined(__m68k__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_A6)
-# elif defined(__mips__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_S8)
-# elif defined(__powerpc__) || defined(__powerpc64__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_R1)
-# elif defined(__riscv__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_S0)
-# elif defined(__sparc__)
-#  define _UC_MACHINE_FP(ucontext) sp[15]
-# elif defined(__sh3__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_R14)
-# elif defined(__vax__)
-#  define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_FP)
-# else
-#  define _UC_MACHINE_FP(ucontext) 0
-# endif
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = _UC_MACHINE_PC(ucontext);
-  *sp = _UC_MACHINE_SP(ucontext);
-  *bp = _UC_MACHINE_FP(ucontext);
-#elif ASAN_ANDROID
-  *pc = *sp = *bp = 0;
-#elif defined(__arm__)
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.arm_pc;
-  *bp = ucontext->uc_mcontext.arm_fp;
-  *sp = ucontext->uc_mcontext.arm_sp;
-#elif defined(__aarch64__)
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.pc;
-  *bp = ucontext->uc_mcontext.regs[29];
-  *sp = ucontext->uc_mcontext.sp;
-#elif defined(__hppa__)
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.sc_iaoq[0];
-  /* GCC uses %r3 whenever a frame pointer is needed.  */
-  *bp = ucontext->uc_mcontext.sc_gr[3];
-  *sp = ucontext->uc_mcontext.sc_gr[30];
-#elif defined(__x86_64__)
-# if SANITIZER_FREEBSD
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.mc_rip;
-  *bp = ucontext->uc_mcontext.mc_rbp;
-  *sp = ucontext->uc_mcontext.mc_rsp;
-# elif SANITIZER_NETBSD
-  *pc = ucontext->uc_mcontext.__gregs[_REG_RIP];
-  *bp = ucontext->uc_mcontext.__gregs[_REG_RBP];
-  *sp = ucontext->uc_mcontext.__gregs[_REG_RSP];
-# else
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.gregs[REG_RIP];
-  *bp = ucontext->uc_mcontext.gregs[REG_RBP];
-  *sp = ucontext->uc_mcontext.gregs[REG_RSP];
-# endif
-#elif defined(__i386__)
-# if SANITIZER_FREEBSD
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.mc_eip;
-  *bp = ucontext->uc_mcontext.mc_ebp;
-  *sp = ucontext->uc_mcontext.mc_esp;
-# elif SANITIZER_FREEBSD
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.__gregs[_REG_EIP];
-  *bp = ucontext->uc_mcontext.__gregs[_REG_EBP];
-  *sp = ucontext->uc_mcontext.__gregs[_REG_ESP];
-# else
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.gregs[REG_EIP];
-  *bp = ucontext->uc_mcontext.gregs[REG_EBP];
-  *sp = ucontext->uc_mcontext.gregs[REG_ESP];
-# endif
-#elif defined(__powerpc__) || defined(__powerpc64__)
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.regs->nip;
-  *sp = ucontext->uc_mcontext.regs->gpr[PT_R1];
-  // The powerpc{,64}-linux ABIs do not specify r31 as the frame
-  // pointer, but GCC always uses r31 when we need a frame pointer.
-  *bp = ucontext->uc_mcontext.regs->gpr[PT_R31];
-#elif defined(__riscv__)
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.gregs[REG_PC];
-  *bp = ucontext->uc_mcontext.gregs[REG_S0];
-  *sp = ucontext->uc_

CVS commit: src/external/gpl3/gcc/dist/gcc

2021-06-28 Thread Chris Pinnock
Module Name:src
Committed By:   cjep
Date:   Mon Jun 28 09:13:11 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.host

Log Message:
PR toolchain/56180. Add configuration so that gcc can find the LTO
plugin when cross-building NetBSD from OpenBSD hosts. Discussed with mrg.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc/dist/gcc/config.host

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/dist/gcc/config.host
diff -u src/external/gpl3/gcc/dist/gcc/config.host:1.10 src/external/gpl3/gcc/dist/gcc/config.host:1.11
--- src/external/gpl3/gcc/dist/gcc/config.host:1.10	Sun Apr 11 00:02:11 2021
+++ src/external/gpl3/gcc/dist/gcc/config.host	Mon Jun 28 09:13:10 2021
@@ -277,6 +277,7 @@ case ${host} in
   *-*-openbsd*)
 out_host_hook_obj=host-openbsd.o
 host_xmake_file="${host_xmake_file} x-openbsd"
+host_lto_plugin_soname=liblto_plugin.so.0.0
 ;;
   *-*-netbsd*)
 out_host_hook_obj=host-netbsd.o



CVS commit: src/external/gpl3/gcc/dist/gcc

2021-06-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jun 15 08:22:23 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
Fix GCC10 for arm.

Include order of bpapi.h and netbsd-elf.h was swapped when official
support for arm*--netbsdelf-eabi{,hf} was added to GCC10. This seems to
cause critical inconsistencies, which results in SIGSEGV for as(1) on
earmv6hf{,eb} and some other regressions for many arm variants.

With this fix, everything work just fine as far as I can see.

Thanks skrll and mrg for discussion!


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/external/gpl3/gcc/dist/gcc/config.gcc

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/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.69 src/external/gpl3/gcc/dist/gcc/config.gcc:1.70
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.69	Sun Apr 25 23:12:53 2021
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Tue Jun 15 08:22:23 2021
@@ -1280,7 +1280,7 @@ arm*-*-netbsdelf*)
 	esac
 	case ${target} in
 	arm*-*-netbsdelf-*eabi*)
-	tm_file="${tm_file} arm/bpabi.h arm/netbsd-elf.h arm/netbsd-eabi.h"
+	tm_file="${tm_file} arm/netbsd-elf.h arm/bpabi.h arm/netbsd-eabi.h"
 	# GCC 7 vs NetBSD/eabi -> avoid arm unwinder
 	#tmake_file="$tmake_file arm/t-bpabi"
 	tmake_file="$tmake_file arm/t-netbsdeabi"
@@ -1288,7 +1288,7 @@ arm*-*-netbsdelf*)
 	default_use_cxa_atexit=yes
 	;;
 	*)
-	tm_file="$tm_file arm/bpabi.h arm/netbsd-elf.h"
+	tm_file="$tm_file arm/netbsd-elf.h arm/bpabi.h"
 	#tmake_file="$tmake_file arm/t-bpabi arm/t-netbsdeabi"
 	tmake_file="$tmake_file arm/t-netbsd"
 	;;



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2021-05-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue May 11 01:47:21 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: rs6000.c

Log Message:
Cherry-pick upstream fix for GCC10 regression to -misel option.

Assembler codes generated by GCC are identical with that of our local
fix in rev 1.26 for 32-bit processors, and no significant changes for
64-bit processors also.

master: https://gcc.gnu.org/g:6156df483fa50a08f561b6c248819f2992aa380d
gcc-10: https://gcc.gnu.org/g:5f665c1ca452673e9812cd92b07bd31441c0ac5b
(diffs are same)

commit r12-9-g6156df483fa50a08f561b6c248819f2992aa380d
Author: Segher Boessenkool 
Date:   Tue Apr 20 12:00:50 2021 +

rs6000: Fix cpu selection w/ isel (PR100108)

There are various non-IBM CPUs with isel as well, so it is easiest if we
just don't consider that flag here (it is not needed).

2021-04-20  Segher Boessenkool  

PR target/100108
* config/rs6000/rs6000.c (rs6000_machine_from_flags): Do not 
consider
OPTION_MASK_ISEL.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c

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/dist/gcc/config/rs6000/rs6000.c
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.28 src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.29
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.28	Tue May 11 01:39:09 2021
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c	Tue May 11 01:47:20 2021
@@ -5550,7 +5550,7 @@ rs6000_machine_from_flags (void)
   HOST_WIDE_INT flags = rs6000_isa_flags;
 
   /* Disable the flags that should never influence the .machine selection.  */
-  flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT);
+  flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ISEL);
 
   if ((flags & (ISA_3_1_MASKS_SERVER & ~ISA_3_0_MASKS_SERVER)) != 0)
 return "power10";



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2021-05-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue May 11 01:39:09 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: rs6000.c

Log Message:
In preparation to import upstream fix, revert our local fix in rev 1.26:

http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c#rev1.26

> Fix regression introduced to GCC10, where it wrongly recognizes 32-bit
> processors as POWER9 if -misel flag is specified.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c

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/dist/gcc/config/rs6000/rs6000.c
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.27 src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.28
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.27	Fri Apr 16 02:33:28 2021
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c	Tue May 11 01:39:09 2021
@@ -5552,8 +5552,6 @@ rs6000_machine_from_flags (void)
   /* Disable the flags that should never influence the .machine selection.  */
   flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT);
 
-  if ((flags & OPTION_MASK_POWERPC64) == 0)
-return "ppc";
   if ((flags & (ISA_3_1_MASKS_SERVER & ~ISA_3_0_MASKS_SERVER)) != 0)
 return "power10";
   if ((flags & (ISA_3_0_MASKS_SERVER & ~ISA_2_7_MASKS_SERVER)) != 0)
@@ -5568,7 +5566,9 @@ rs6000_machine_from_flags (void)
 return "power5";
   if ((flags & ISA_2_1_MASKS) != 0)
 return "power4";
-  return "ppc64";
+  if ((flags & OPTION_MASK_POWERPC64) != 0)
+return "ppc64";
+  return "ppc";
 }
 
 void



CVS commit: src/external/gpl3/gcc/dist/gcc/config/arm

2021-04-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Apr 29 01:51:40 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/arm: arm.h bpabi.h netbsd-eabi.h
netbsd-elf.h

Log Message:
netbsd-eabi.h was never merged from the now present upstream version.
reduce diffs to upstream here and in other files in this subdir.

remove unused ARM_EABI_UNWIND_TABLES and __UNWIND_TABLES__.

clang defines __UNWIND_TABLES__, but doing this in GCC triggers the
need for more libgcc / libc unwind functionality to be added, and this
code has never been enabled for netbsd/earm.  (could potentially clean
up unused code in libc now, or, revive this once the full support has
been implemented..)


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/gpl3/gcc/dist/gcc/config/arm/arm.h
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gcc/dist/gcc/config/arm/bpabi.h
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.h
cvs rdiff -u -r1.17 -r1.18 \
src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-elf.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/dist/gcc/config/arm/arm.h
diff -u src/external/gpl3/gcc/dist/gcc/config/arm/arm.h:1.22 src/external/gpl3/gcc/dist/gcc/config/arm/arm.h:1.23
--- src/external/gpl3/gcc/dist/gcc/config/arm/arm.h:1.22	Sun Apr 11 00:02:13 2021
+++ src/external/gpl3/gcc/dist/gcc/config/arm/arm.h	Thu Apr 29 01:51:39 2021
@@ -963,8 +963,8 @@ extern const int arm_arch_cde_coproc_bit
 /* ttype entries (the only interesting data references used)
use TARGET2 relocations.  */
 #define ASM_PREFERRED_EH_DATA_FORMAT(code, data) \
-(((code) == 0 && (data) == 1 && ARM_UNWIND_INFO) ? ARM_TARGET2_DWARF_FORMAT \
- : DW_EH_PE_absptr)
+  (((code) == 0 && (data) == 1 && ARM_UNWIND_INFO) ? ARM_TARGET2_DWARF_FORMAT \
+			   : DW_EH_PE_absptr)
 #endif
 
 /* The native (Norcroft) Pascal compiler for the ARM passes the static chain

Index: src/external/gpl3/gcc/dist/gcc/config/arm/bpabi.h
diff -u src/external/gpl3/gcc/dist/gcc/config/arm/bpabi.h:1.12 src/external/gpl3/gcc/dist/gcc/config/arm/bpabi.h:1.13
--- src/external/gpl3/gcc/dist/gcc/config/arm/bpabi.h:1.12	Sun Apr 11 00:02:13 2021
+++ src/external/gpl3/gcc/dist/gcc/config/arm/bpabi.h	Thu Apr 29 01:51:39 2021
@@ -28,12 +28,9 @@
 #define ARM_DEFAULT_ABI ARM_ABI_AAPCS
 
 /* Assume that AAPCS ABIs should adhere to the full BPABI.  */
-//#undef TARGET_BPABI
 #define TARGET_BPABI (TARGET_AAPCS_BASED)
 
 /* BPABI targets use EABI frame unwinding tables.  */
-#undef ARM_EABI_UNWIND_TABLES
-#define ARM_EABI_UNWIND_TABLES 1
 #undef ARM_UNWIND_INFO
 #define ARM_UNWIND_INFO 1
 

Index: src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.h
diff -u src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.h:1.16 src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.h:1.17
--- src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.h:1.16	Tue Dec  1 02:39:08 2020
+++ src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.h	Thu Apr 29 01:51:39 2021
@@ -1,5 +1,5 @@
 /* Definitions of target machine for GNU compiler, NetBSD/arm ELF version.
-   Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002-2020 Free Software Foundation, Inc.
Contributed by Wasabi Systems, Inc.
 
This file is part of GCC.
@@ -22,10 +22,16 @@
 #undef MULTILIB_DEFAULTS
 #define MULTILIB_DEFAULTS { "mabi=aapcs-linux" }
 
-#define TARGET_LINKER_EABI_SUFFIX \
-(TARGET_DEFAULT_FLOAT_ABI == ARM_FLOAT_ABI_SOFT \
- ? "%{!mabi=apcs-gnu:%{!mabi=atpcs:%{mfloat-abi=hard:_eabihf;:_eabi}}}" \
- : "%{!mabi=apcs-gnu:%{!mabi=atpcs:%{mfloat-abi=soft:_eabi;:_eabihf}}}")
+#define TARGET_LINKER_EABI_SUFFIX_SOFT \
+  "%{!mabi=apcs-gnu:%{!mabi=atpcs:%{mfloat-abi=hard:_eabihf;:_eabi}}}"
+#define TARGET_LINKER_EABI_SUFFIX_HARD \
+  "%{!mabi=apcs-gnu:%{!mabi=atpcs:%{mfloat-abi=soft:_eabi;:_eabihf}}}"
+
+#define TARGET_LINKER_EABI_SUFFIX			\
+  (TARGET_DEFAULT_FLOAT_ABI == ARM_FLOAT_ABI_SOFT	\
+   ? TARGET_LINKER_EABI_SUFFIX_SOFT			\
+   : TARGET_LINKER_EABI_SUFFIX_HARD)
+
 #define TARGET_LINKER_BIG_EMULATION "armelfb_nbsd%(linker_eabi_suffix)"
 #define TARGET_LINKER_LITTLE_EMULATION "armelf_nbsd%(linker_eabi_suffix)"
 
@@ -41,8 +47,6 @@
 #undef ARM_DEFAULT_ABI
 #define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX
 
-#undef ARM_EABI_UNWIND_TABLES
-#define ARM_EABI_UNWIND_TABLES 0
 #undef ARM_UNWIND_INFO
 #define ARM_UNWIND_INFO 0
 #undef ARM_DWARF_UNWIND_TABLES
@@ -57,8 +61,6 @@
   NETBSD_OS_CPP_BUILTINS_ELF();		\
   if (ARM_DWARF_UNWIND_TABLES)		\
 	builtin_define ("__ARM_DWARF_EH__");	\
-  if (ARM_EABI_UNWIND_TABLES)		\
-	builtin_define ("__UNWIND_TABLES__");	\
 }		\
   while (0)
 
@@ -73,13 +75,15 @@
 
 #undef SIZE_TYPE
 #define SIZE_TYPE "long unsigned int"
- 
+
 #undef PTRDIFF_TYPE
 #define PTRDIFF_TYPE "long int"
 
 #undef SUBTARGET_EXTRA_ASM_SPEC
-#define SUB

CVS commit: src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly

2021-04-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 24 21:17:40 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly:
c_locale.cc c_locale.h

Log Message:
move the NetBSD version of:

   __convert_from_v(const __c_locale& __cloc, char* __out,
const int __size __attribute__ ((__unused__)),
const char* __fmt, ...)

from the .h file into the .cc file.

NetBSD version relies upon vasprintf_l() being defined and compile
contexts such as _XOPEN_SOURCE=600 or _POSIX_C_SOURCE < 200809 may
not provide the definition of it, cause compile time issues for
3rdparty applications in c++locale.h.  This ensure that all the
required definitions are present when this code is compiled.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly/c_locale.cc 
\
src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly/c_locale.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/dist/libstdc++-v3/config/locale/dragonfly/c_locale.cc
diff -u src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly/c_locale.cc:1.5 src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly/c_locale.cc:1.6
--- src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly/c_locale.cc:1.5	Sun Apr 11 00:02:24 2021
+++ src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly/c_locale.cc	Sat Apr 24 21:17:40 2021
@@ -28,6 +28,8 @@
 
 // Written by Benjamin Kosnik 
 // Modified for DragonFly by John Marino 
+// Modified for NetBSD by Christos Zoulas  and
+// matthew green 
 
 #include 
 #include 
@@ -191,6 +193,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 
+#ifdef __NetBSD__
+  int
+  __convert_from_v(const __c_locale& __cloc, char* __out,
+		   const int __size __attribute__ ((__unused__)),
+		   const char* __fmt, ...)
+  {
+__builtin_va_list __args;
+__builtin_va_start(__args, __fmt);
+
+const int __ret = vsnprintf_l(__out, __size, (struct _locale *)__cloc,
+  __fmt, __args);
+
+__builtin_va_end(__args);
+
+return __ret;
+  }
+#endif
+
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
Index: src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly/c_locale.h
diff -u src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly/c_locale.h:1.5 src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly/c_locale.h:1.6
--- src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly/c_locale.h:1.5	Sun Apr 11 00:02:24 2021
+++ src/external/gpl3/gcc/dist/libstdc++-v3/config/locale/dragonfly/c_locale.h	Sat Apr 24 21:17:40 2021
@@ -33,6 +33,8 @@
 
 // Written by Benjamin Kosnik 
 // Modified for DragonFly by John Marino 
+// Modified for NetBSD by Christos Zoulas  and
+// matthew green 
 
 #ifndef _GLIBCXX_CXX_LOCALE_H
 #define _GLIBCXX_CXX_LOCALE_H 1
@@ -54,6 +56,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   typedef int*			__c_locale;
 
+#ifndef __NetBSD__
   // Convert numeric value of type double and long double to string and
   // return length of string.  If vsnprintf is available use it, otherwise
   // fall back to the unsafe vsprintf which, in general, can be dangerous
@@ -63,30 +66,31 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 		   const int __size __attribute__ ((__unused__)),
 		   const char* __fmt, ...)
   {
-#ifndef __NetBSD__
 __c_locale __old = (__c_locale)uselocale((locale_t)__cloc);
-#endif
 
 __builtin_va_list __args;
 __builtin_va_start(__args, __fmt);
 
-#ifndef __NetBSD__
 #if _GLIBCXX_USE_C99_STDIO
 const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
 #else
 const int __ret = __builtin_vsprintf(__out, __fmt, __args);
 #endif
 
-uselocale((locale_t)__old);
-#else
-const int __ret = vsnprintf_l(__out, __size, (locale_t)__cloc, __fmt,
-	__args);
-#endif
-
 __builtin_va_end(__args);
 
+uselocale((locale_t)__old);
 return __ret;
   }
+#else
+  // NetBSD backend requires vasprintf_l() which may not be visible in
+  // all complation environments (eg, _XOPEN_SOURCE=600) so the backend
+  // lives in the library code, instead of this header.
+  int
+  __convert_from_v(const __c_locale& __cloc, char* __out,
+		   const int __size __attribute__ ((__unused__)),
+		   const char* __fmt, ...);
+#endif
 
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2021-04-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 24 06:45:56 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: t-aarch64-netbsd

Log Message:
remove diff to upstream.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/t-aarch64-netbsd

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/dist/gcc/config/aarch64/t-aarch64-netbsd
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/t-aarch64-netbsd:1.1 src/external/gpl3/gcc/dist/gcc/config/aarch64/t-aarch64-netbsd:1.2
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/t-aarch64-netbsd:1.1	Sat Jul 14 23:47:32 2018
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/t-aarch64-netbsd	Sat Apr 24 06:45:56 2021
@@ -1,5 +1,5 @@
 # Machine description for AArch64 architecture.
-#  Copyright (C) 2016-2017 Free Software Foundation, Inc.
+#  Copyright (C) 2016-2020 Free Software Foundation, Inc.
 #
 #  This file is part of GCC.
 #



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2021-04-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 24 06:44:24 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64-netbsd.h

Log Message:
reduce diffs to upstream.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.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/dist/gcc/config/aarch64/aarch64-netbsd.h
diff -u 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.5
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h:1.4	Fri Oct  4 08:51:32 2019
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-netbsd.h	Sat Apr 24 06:44:24 2021
@@ -1,5 +1,5 @@
 /* Definitions for AArch64 running NetBSD
-   Copyright (C) 2016-2017 Free Software Foundation, Inc.
+   Copyright (C) 2016-2020 Free Software Foundation, Inc.
 
This file is part of GCC.
 
@@ -38,32 +38,15 @@
 
 #define NETBSD_ENTRY_POINT "__start"
 
-#define NETBSD_TARGET_LINK_SPEC  "%{h*}			\
-   -X %{mbig-endian:-EB -m " TARGET_LINKER_BIG_EMULATION "} \
-   %{mlittle-endian:-EL -m " TARGET_LINKER_LITTLE_EMULATION "} \
-   %(netbsd_link_spec)"
-
-#if TARGET_FIX_ERR_A53_835769_DEFAULT
-#define CA53_ERR_835769_SPEC \
-  " %{!mno-fix-cortex-a53-835769:--fix-cortex-a53-835769}"
-#else
-#define CA53_ERR_835769_SPEC \
-  " %{mfix-cortex-a53-835769:--fix-cortex-a53-835769}"
-#endif
-
-#ifdef TARGET_FIX_ERR_A53_843419_DEFAULT
-#define CA53_ERR_843419_SPEC \
-  " %{!mno-fix-cortex-a53-843419:--fix-cortex-a53-843419}"
-#else
-#define CA53_ERR_843419_SPEC \
-  " %{mfix-cortex-a53-843419:--fix-cortex-a53-843419}"
-#endif
+#define NETBSD_TARGET_LINK_SPEC  "%{h*} "\
+  "-X %{mbig-endian:-EB -m " TARGET_LINKER_BIG_EMULATION "} "		\
+  "%{mlittle-endian:-EL -m " TARGET_LINKER_LITTLE_EMULATION "} "	\
+  "%(netbsd_link_spec)"
 
 #undef  LINK_SPEC
-#define LINK_SPEC NETBSD_LINK_SPEC_ELF 		\
+#define LINK_SPEC NETBSD_LINK_SPEC_ELF		\
 		  NETBSD_TARGET_LINK_SPEC	\
-  CA53_ERR_835769_SPEC		\
-  CA53_ERR_843419_SPEC
+		  AARCH64_ERRATA_LINK_SPEC
 
 #undef TARGET_OS_CPP_BUILTINS
 #define TARGET_OS_CPP_BUILTINS()		\
@@ -76,23 +59,6 @@
 #undef SUBTARGET_CPP_SPEC
 #define SUBTARGET_CPP_SPEC NETBSD_CPP_SPEC
 
-#if 0
-#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
-#endif
-
-#if 0
-/* Uninitialized common symbols in non-PIE executables, even with
-   strong definitions in dependent shared libraries, will resolve
-   to COPY relocated symbol in the executable.  See PR65780.  */
-#undef TARGET_BINDS_LOCAL_P
-#define TARGET_BINDS_LOCAL_P default_binds_local_p_2
-#endif
-
-#if 0
-#undef MCOUNT_NAME
-#define MCOUNT_NAME ".mcount"
-#endif
-
 #undef EXTRA_SPECS
 #define EXTRA_SPECS \
   { "asm_cpu_spec", ASM_CPU_SPEC }, \



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2021-04-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 24 06:44:01 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: driver-aarch64.c

Log Message:
make netbsd section more GNU-style.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c

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/dist/gcc/config/aarch64/driver-aarch64.c
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.12 src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.13
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.12	Sat Apr 17 10:19:09 2021
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c	Sat Apr 24 06:44:01 2021
@@ -246,7 +246,7 @@ contains_core_p (unsigned *arr, unsigned
in the spec.  */
 
 #ifdef __NetBSD__
-/* The NetBSD/arm64 platform does not export linux-style cpuinfo,
+/* The NetBSD/arm64 platform may not export linux-style /proc/cpuinfo,
but the data is available via a sysctl(3) interface.  */
 #include 
 #include 
@@ -440,78 +440,44 @@ host_detect_local_cpu (int argc, const c
 
 	  /* These are all the extensions from aarch64-option-extensions.def.  */
   if (__SHIFTOUT(id.ac_aa64pfr0, ID_AA64PFR0_EL1_FP) == ID_AA64PFR0_EL1_FP_IMPL)
-	{
-	  exts += "fp ";
-	}
+	exts += "fp ";
   if (__SHIFTOUT(id.ac_aa64pfr0, ID_AA64PFR0_EL1_ADVSIMD) == ID_AA64PFR0_EL1_ADV_SIMD_IMPL)
-	{
-	  exts += "asimd ";
-	}
+	exts += "asimd ";
 #ifdef ID_AA64ISAR0_EL1_RDM
   if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_RDM) == ID_AA64ISAR0_EL1_RDM_SQRDML)
-	{
-	  exts += "asimdrdm ";
-	}
+	exts += "asimdrdm ";
   if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_DP) == ID_AA64ISAR0_EL1_DP_UDOT)
-	{
-	  exts += "asimddp ";
-	}
+	exts += "asimddp ";
   if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_FHM) == ID_AA64ISAR0_EL1_FHM_FMLAL)
-	{
-	  exts += "asimdfml ";
-	}
+	exts += "asimdfml ";
 #endif
   if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_AES) == ID_AA64ISAR0_EL1_AES_AES)
-	{
-	  exts += "aes ";
-	}
+	exts += "aes ";
   if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_AES) == ID_AA64ISAR0_EL1_AES_PMUL)
-	{
-	  exts += "aes pmull ";
-	}
+	exts += "aes pmull ";
   if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_CRC32) == ID_AA64ISAR0_EL1_CRC32_CRC32X)
-	{
-	  exts += "crc32 ";
-	}
+	exts += "crc32 ";
 #ifdef ID_AA64ISAR0_EL1_ATOMIC
   if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_ATOMIC) == ID_AA64ISAR0_EL1_ATOMIC_SWP)
-	{
-	  exts += "atomics ";
-	}
+	exts += "atomics ";
 #endif
   if ((__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_SHA1) & ID_AA64ISAR0_EL1_SHA1_SHA1CPMHSU) != 0)
-	{
-	  exts += "sha1 ";
-	}
+	exts += "sha1 ";
   if ((__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_SHA2) & ID_AA64ISAR0_EL1_SHA2_SHA256HSU) != 0)
-	{
-	  exts += "sha2 ";
-	}
+	exts += "sha2 ";
 #ifdef ID_AA64ISAR0_EL1_SHA2_SHA512HSU
   if ((__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_SHA2) & ID_AA64ISAR0_EL1_SHA2_SHA512HSU) != 0)
-	{
-	  exts += "sha512 ";
-	}
+	exts += "sha512 ";
   if ((__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_SHA3) & ID_AA64ISAR0_EL1_SHA3_EOR3) != 0)
-	{
-	  exts += "sha3 ";
-	}
+	exts += "sha3 ";
   if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_SM3) == ID_AA64ISAR0_EL1_SM3_SM3)
-	{
-	  exts += "sm3 ";
-	}
+	exts += "sm3 ";
   if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_SM4) == ID_AA64ISAR0_EL1_SM4_SM4)
-	{
-	  exts += "sm4 ";
-	}
+	exts += "sm4 ";
   if (__SHIFTOUT(id.ac_aa64pfr0, ID_AA64PFR0_EL1_SVE) == ID_AA64PFR0_EL1_SVE_IMPL)
-	{
-	  exts += "sve ";
-	}
+	exts += "sve ";
   if (__SHIFTOUT(id.ac_aa64isar1, ID_AA64ISAR1_EL1_LRCPC) == ID_AA64ISAR1_EL1_LRCPC_PR)
-	{
-	  exts += "lrcpc ";
-	}
+	exts += "lrcpc ";
 #endif
 
   for (i = 0; i < num_exts; i++)



CVS commit: src/external/gpl3/gcc/dist/gcc/config

2021-04-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 24 06:32:09 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config: host-netbsd.c

Log Message:
reduce diffs to upstream.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc/dist/gcc/config/host-netbsd.c

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/dist/gcc/config/host-netbsd.c
diff -u src/external/gpl3/gcc/dist/gcc/config/host-netbsd.c:1.3 src/external/gpl3/gcc/dist/gcc/config/host-netbsd.c:1.4
--- src/external/gpl3/gcc/dist/gcc/config/host-netbsd.c:1.3	Sun Apr 11 00:02:12 2021
+++ src/external/gpl3/gcc/dist/gcc/config/host-netbsd.c	Sat Apr 24 06:32:09 2021
@@ -81,5 +81,5 @@ netbsd_gt_pch_use_address (void *base, s
   return addr == base ? 1 : -1;
 }
 
-
+
 const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2021-04-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr 20 10:39:59 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: aarch64-builtins.c

Log Message:
give a structure a name.

it makes GCC 10 less unhappy about building arm64 GCC 10.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.10 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-builtins.c

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/dist/gcc/config/aarch64/aarch64-builtins.c
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-builtins.c:1.1.1.10 src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-builtins.c:1.2
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-builtins.c:1.1.1.10	Sat Apr 10 22:09:46 2021
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/aarch64-builtins.c	Tue Apr 20 10:39:58 2021
@@ -1206,7 +1206,7 @@ aarch64_init_rng_builtins (void)
 }
 
 /* Initialize the memory tagging extension (MTE) builtins.  */
-struct
+struct aarch64_mte
 {
   tree ftype;
   enum insn_code icode;



CVS commit: src/external/gpl3/gcc/dist/libgcc

2021-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 17 10:53:18 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libgcc: config.host

Log Message:
remove double arm64 netbsd target.  add t-lse, though we don't
pull this out with mknative currently.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/external/gpl3/gcc/dist/libgcc/config.host

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/dist/libgcc/config.host
diff -u src/external/gpl3/gcc/dist/libgcc/config.host:1.29 src/external/gpl3/gcc/dist/libgcc/config.host:1.30
--- src/external/gpl3/gcc/dist/libgcc/config.host:1.29	Sun Apr 11 00:02:18 2021
+++ src/external/gpl3/gcc/dist/libgcc/config.host	Sat Apr 17 10:53:18 2021
@@ -377,6 +377,7 @@ aarch64*-*-freebsd*)
 aarch64*-*-netbsd*)
 	extra_parts="$extra_parts crtfastmath.o"
 	tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
+	tmake_file="${tmake_file} ${cpu_type}/t-lse t-slibgcc-libgcc"
 	tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
 	md_unwind_header=aarch64/aarch64-unwind.h
 	;;
@@ -385,12 +386,6 @@ aarch64*-*-fuchsia*)
 	tmake_file="${tmake_file} ${cpu_type}/t-lse t-slibgcc-libgcc"
 	tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp"
 	;;
-aarch64*-*-netbsd*)
-	extra_parts="$extra_parts crtfastmath.o"
-	tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
-	tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
-	md_unwind_header=aarch64/aarch64-unwind.h
-	;;
 aarch64*-*-linux*)
 	extra_parts="$extra_parts crtfastmath.o"
 	md_unwind_header=aarch64/linux-unwind.h



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2021-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 17 10:19:09 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: driver-aarch64.c

Log Message:
port the -mnative support in GCC 10 to netbsd.  (much simpler than 8->9!)


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c

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/dist/gcc/config/aarch64/driver-aarch64.c
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.11 src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.12
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.11	Sun Apr 11 00:02:13 2021
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c	Sat Apr 17 10:19:09 2021
@@ -514,9 +514,6 @@ host_detect_local_cpu (int argc, const c
 	}
 #endif
 
-	  strncpy(buf, exts.c_str(), sizeof(buf) - 1);
-	  buf[sizeof(buf) - 1] = '\0';
-
   for (i = 0; i < num_exts; i++)
 {
 	  const char *p = aarch64_extensions[i].feat_string;
@@ -530,13 +527,13 @@ host_detect_local_cpu (int argc, const c
 
 	  /* This may be a multi-token feature string.  We need
 		 to match all parts, which could be in any order.  */
-	  size_t len = strlen (buf);
+	  size_t len = strlen (exts.c_str());
 	  do
 		{
 		  const char *end = strchr (p, ' ');
 		  if (end == NULL)
 		end = strchr (p, '\0');
-		  if (memmem (buf, len, p, end - p) == NULL)
+		  if (memmem (exts.c_str(), len, p, end - p) == NULL)
 		{
 		  /* Failed to match this token.  Turn off the
 			 features we'd otherwise enable.  */



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2021-04-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 16 02:33:28 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: rs6000.c

Log Message:
Restore our local change to remove GNU_STACK program header:


http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c#rev1.13

This was removed accidentally when merging GCC10 into our tree.

Note that some firmwares, e.g., Explora, refuse to execute ELF
kernel image if this program header is present.

Now, GCC10 becomes just fine for all three powerpc sub-archs, i.e.,
oea, booke, and ibm4xx, as far as I can see. No regressions are
observed for ATF.

OK mrg


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c

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/dist/gcc/config/rs6000/rs6000.c
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.26 src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.27
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.26	Fri Apr 16 02:26:43 2021
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c	Fri Apr 16 02:33:28 2021
@@ -20284,7 +20284,7 @@ rs6000_elf_file_end (void)
 		 aix_struct_return ? 2 : 1);
 }
 #endif
-#if defined (POWERPC_LINUX) || defined (POWERPC_FREEBSD) || defined(POWERPC_NETBSD)
+#if defined (POWERPC_LINUX) || defined (POWERPC_FREEBSD)
   if (TARGET_32BIT || DEFAULT_ABI == ABI_ELFv2)
 file_end_indicate_exec_stack ();
 #endif



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2021-04-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 16 02:26:43 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: rs6000.c

Log Message:
Fix regression introduced to GCC10, where it wrongly recognizes 32-bit
processors as POWER9 if -misel flag is specified.

rs6000_machine_from_flags() assumes ISEL instructions are supported only
for POWER9 and successors. However, ISEL is also implemented for 32-bit
booke processors.

Since our kernel for booke is compiled with -misel, this regression
completely breaks it.

As a fix, check whether CPU is 64-bit capable or not, before checking
-misel flag.

The problem has been reported as 100108 to upstream:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100108

OK mrg


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c

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/dist/gcc/config/rs6000/rs6000.c
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.25 src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.26
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.25	Fri Apr 16 02:18:04 2021
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c	Fri Apr 16 02:26:43 2021
@@ -5552,6 +5552,8 @@ rs6000_machine_from_flags (void)
   /* Disable the flags that should never influence the .machine selection.  */
   flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT);
 
+  if ((flags & OPTION_MASK_POWERPC64) == 0)
+return "ppc";
   if ((flags & (ISA_3_1_MASKS_SERVER & ~ISA_3_0_MASKS_SERVER)) != 0)
 return "power10";
   if ((flags & (ISA_3_0_MASKS_SERVER & ~ISA_2_7_MASKS_SERVER)) != 0)
@@ -5566,9 +5568,7 @@ rs6000_machine_from_flags (void)
 return "power5";
   if ((flags & ISA_2_1_MASKS) != 0)
 return "power4";
-  if ((flags & OPTION_MASK_POWERPC64) != 0)
-return "ppc64";
-  return "ppc";
+  return "ppc64";
 }
 
 void



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2021-04-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr 16 02:18:04 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: rs6000.c

Log Message:
Fix regression introduced to GCC10, by which inline assembler codes for
403/405 are miscompiled.

Redundant .machine directive introduced by upstream commit
2d94f7dea9c73ef3c116a0ddc722724578a860fe:


https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=2d94f7dea9c73ef3c116a0ddc722724578a860fe

clobbers CPU flags passed to assembler. This results in miscompile for
inline assembler codes specific to 403/405 processors, at least.

Therefore, revert this commit locally.

The problem has been reported as 100107 to upstream:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100107

OK mrg


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c

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/dist/gcc/config/rs6000/rs6000.c
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.24 src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.25
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.24	Mon Apr 12 07:23:06 2021
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c	Fri Apr 16 02:18:04 2021
@@ -5644,7 +5644,9 @@ rs6000_file_start (void)
 
 #ifdef USING_ELFOS_H
   rs6000_machine = rs6000_machine_from_flags ();
-  emit_asm_machine ();
+  if (!(rs6000_default_cpu && rs6000_default_cpu[0])
+	&& !global_options_set.x_rs6000_cpu_index)
+emit_asm_machine ();
 #endif
 
   if (DEFAULT_ABI == ABI_ELFv2)



CVS commit: src/external/gpl3/gcc/dist/libgcc

2021-04-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr 13 08:06:11 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libgcc: emutls.c

Log Message:
make this match the builtin prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9 -r1.2 src/external/gpl3/gcc/dist/libgcc/emutls.c

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/dist/libgcc/emutls.c
diff -u src/external/gpl3/gcc/dist/libgcc/emutls.c:1.1.1.9 src/external/gpl3/gcc/dist/libgcc/emutls.c:1.2
--- src/external/gpl3/gcc/dist/libgcc/emutls.c:1.1.1.9	Sat Apr 10 22:09:58 2021
+++ src/external/gpl3/gcc/dist/libgcc/emutls.c	Tue Apr 13 08:06:11 2021
@@ -50,8 +50,8 @@ struct __emutls_array
   void **data[];
 };
 
-void *__emutls_get_address (struct __emutls_object *);
-void __emutls_register_common (struct __emutls_object *, word, word, void *);
+void *__emutls_get_address (void *);
+void __emutls_register_common (void *, word, word, void *);
 
 #ifdef __GTHREADS
 #ifdef __GTHREAD_MUTEX_INIT
@@ -124,8 +124,10 @@ emutls_alloc (struct __emutls_object *ob
 }
 
 void *
-__emutls_get_address (struct __emutls_object *obj)
+__emutls_get_address (void *vobj)
 {
+  struct __emutls_object *obj = vobj;
+
   if (! __gthread_active_p ())
 {
   if (__builtin_expect (obj->loc.ptr == NULL, 0))
@@ -188,9 +190,11 @@ __emutls_get_address (struct __emutls_ob
 }
 
 void
-__emutls_register_common (struct __emutls_object *obj,
+__emutls_register_common (void *vobj,
 			  word size, word align, void *templ)
 {
+  struct __emutls_object *obj = vobj;
+
   if (obj->size < size)
 {
   obj->size = size;



CVS commit: src/external/gpl3/gcc/dist/gcc

2021-04-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Apr 12 09:03:39 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
arm/netbsd-elf.h is necessary for eabi targets.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/external/gpl3/gcc/dist/gcc/config.gcc

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/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.67 src/external/gpl3/gcc/dist/gcc/config.gcc:1.68
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.67	Sun Apr 11 01:37:18 2021
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Mon Apr 12 09:03:39 2021
@@ -1280,7 +1280,7 @@ arm*-*-netbsdelf*)
 	esac
 	case ${target} in
 	arm*-*-netbsdelf-*eabi*)
-	tm_file="${tm_file} arm/bpabi.h arm/netbsd-eabi.h"
+	tm_file="${tm_file} arm/bpabi.h arm/netbsd-elf.h arm/netbsd-eabi.h"
 	# GCC 7 vs NetBSD/eabi -> avoid arm unwinder
 	#tmake_file="$tmake_file arm/t-bpabi"
 	tmake_file="$tmake_file arm/t-netbsdeabi"
@@ -1288,7 +1288,7 @@ arm*-*-netbsdelf*)
 	default_use_cxa_atexit=yes
 	;;
 	*)
-	tm_file="$tm_file arm/bpabi.h arm/netbsd-elf.h arm/netbsd-eabi.h"
+	tm_file="$tm_file arm/bpabi.h arm/netbsd-elf.h"
 	#tmake_file="$tmake_file arm/t-bpabi arm/t-netbsdeabi"
 	tmake_file="$tmake_file arm/t-netbsd"
 	;;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer

2021-04-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Apr 11 23:54:29 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer: ChangeLog LOCAL_PATCHES MERGE
Makefile.in aclocal.m4 configure configure.ac configure.tgt
merge.sh
src/external/gpl3/gcc/dist/libsanitizer/asan: Makefile.am Makefile.in
asan_activation.h asan_activation_flags.inc asan_allocator.h
asan_descriptions.h asan_errors.h asan_fake_stack.h asan_flags.h
asan_flags.inc asan_init_version.h asan_interceptors.h
asan_interceptors_memintrinsics.h asan_interface.inc
asan_interface_internal.h asan_internal.h asan_malloc_local.h
asan_mapping.h asan_mapping_myriad.h asan_mapping_sparc64.h
asan_poisoning.h asan_premap_shadow.h asan_report.h
asan_scariness_score.h asan_stack.h asan_stats.h
asan_suppressions.h asan_thread.h libtool-version
src/external/gpl3/gcc/dist/libsanitizer/builtins: assembly.h
src/external/gpl3/gcc/dist/libsanitizer/include/sanitizer:
allocator_interface.h asan_interface.h common_interface_defs.h
coverage_interface.h dfsan_interface.h hwasan_interface.h
linux_syscall_hooks.h lsan_interface.h msan_interface.h
scudo_interface.h tsan_interface.h tsan_interface_atomic.h
src/external/gpl3/gcc/dist/libsanitizer/interception: Makefile.am
Makefile.in interception.h interception_linux.h interception_mac.h
interception_win.h
src/external/gpl3/gcc/dist/libsanitizer/libbacktrace: Makefile.in
src/external/gpl3/gcc/dist/libsanitizer/lsan: Makefile.am Makefile.in
libtool-version lsan.h lsan_common.h lsan_flags.inc lsan_thread.h
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: Makefile.am
Makefile.in sancov_flags.h sancov_flags.inc sanitizer_addrhashmap.h
sanitizer_allocator.h sanitizer_allocator_bytemap.h
sanitizer_allocator_checks.h sanitizer_allocator_combined.h
sanitizer_allocator_interface.h sanitizer_allocator_internal.h
sanitizer_allocator_local_cache.h sanitizer_allocator_primary32.h
sanitizer_allocator_primary64.h sanitizer_allocator_report.h
sanitizer_allocator_secondary.h
sanitizer_allocator_size_class_map.h sanitizer_allocator_stats.h
sanitizer_asm.h sanitizer_atomic.h sanitizer_atomic_clang.h
sanitizer_atomic_clang_mips.h sanitizer_atomic_clang_other.h
sanitizer_atomic_clang_x86.h sanitizer_atomic_msvc.h
sanitizer_bitvector.h sanitizer_bvgraph.h sanitizer_common.h
sanitizer_common_interceptors.inc
sanitizer_common_interceptors_format.inc
sanitizer_common_interceptors_ioctl.inc
sanitizer_common_interface.inc sanitizer_common_interface_posix.inc
sanitizer_common_syscalls.inc sanitizer_coverage_interface.inc
sanitizer_dbghelp.h sanitizer_deadlock_detector.h
sanitizer_deadlock_detector_interface.h sanitizer_errno.h
sanitizer_errno_codes.h sanitizer_file.h sanitizer_flag_parser.h
sanitizer_flags.h sanitizer_flags.inc sanitizer_freebsd.h
sanitizer_fuchsia.h sanitizer_getauxval.h
sanitizer_interceptors_ioctl_netbsd.inc
sanitizer_interface_internal.h sanitizer_internal_defs.h
sanitizer_lfstack.h sanitizer_libc.h sanitizer_libignore.h
sanitizer_linux.h sanitizer_list.h sanitizer_mac.h
sanitizer_malloc_mac.inc sanitizer_mutex.h
sanitizer_persistent_allocator.h sanitizer_placement_new.h
sanitizer_platform.h sanitizer_platform_interceptors.h
sanitizer_platform_limits_netbsd.h
sanitizer_platform_limits_openbsd.h
sanitizer_platform_limits_solaris.h sanitizer_posix.h
sanitizer_procmaps.h sanitizer_quarantine.h
sanitizer_report_decorator.h sanitizer_ring_buffer.h
sanitizer_rtems.h sanitizer_signal_interceptors.inc
sanitizer_stackdepot.h sanitizer_stackdepotbase.h
sanitizer_stacktrace.h sanitizer_stacktrace_printer.h
sanitizer_stoptheworld.h sanitizer_suppressions.h
sanitizer_symbolizer.h sanitizer_symbolizer_fuchsia.h
sanitizer_symbolizer_internal.h sanitizer_symbolizer_libbacktrace.h
sanitizer_symbolizer_mac.h sanitizer_symbolizer_rtems.h
sanitizer_syscall_generic.inc sanitizer_syscall_linux_aarch64.inc
sanitizer_syscall_linux_arm.inc sanitizer_syscall_linux_x86_64.inc
sanitizer_syscalls_netbsd.inc sanitizer_thread_registry.h
sanitizer_tls_get_addr.h sanitizer_vector.h sanitizer_win.h
sanitizer_win_defs.h sanitizer_win_dll_thunk.h
sanitizer_win_weak_interception.h
src/external/gpl3/gcc/dis

CVS commit: src/external/gpl3/gcc/dist/libgomp

2021-04-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Apr 11 01:38:40 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libgomp: configure

Log Message:
disable testsuite components.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/dist/libgomp/configure

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/dist/libgomp/configure
diff -u src/external/gpl3/gcc/dist/libgomp/configure:1.11 src/external/gpl3/gcc/dist/libgomp/configure:1.12
--- src/external/gpl3/gcc/dist/libgomp/configure:1.11	Sun Apr 11 00:02:20 2021
+++ src/external/gpl3/gcc/dist/libgomp/configure	Sun Apr 11 01:38:39 2021
@@ -17056,7 +17056,7 @@ ac_config_files="$ac_config_files Makefi
 
 #ac_config_files="$ac_config_files testsuite/libgomp-test-support.pt.exp:testsuite/libgomp-test-support.exp.in"
 
-ac_config_files="$ac_config_files testsuite/libgomp-site-extra.exp"
+#ac_config_files="$ac_config_files testsuite/libgomp-site-extra.exp"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure



CVS commit: src/external/gpl3/gcc/dist/gcc/config/vax

2021-04-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Apr 11 01:38:05 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/vax: vax.md

Log Message:
revert a local change that i can't figure out how to port
makes vax-gcc10 tools build.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/gpl3/gcc/dist/gcc/config/vax/vax.md

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/dist/gcc/config/vax/vax.md
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/vax.md:1.16 src/external/gpl3/gcc/dist/gcc/config/vax/vax.md:1.17
--- src/external/gpl3/gcc/dist/gcc/config/vax/vax.md:1.16	Sun Apr 11 00:02:15 2021
+++ src/external/gpl3/gcc/dist/gcc/config/vax/vax.md	Sun Apr 11 01:38:05 2021
@@ -216,27 +216,29 @@
   ""
   "
 {
+#if 0
   if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) <= 48)
 {
-  emit_insn (gen_movmemsi1_2 (operands[0], operands[1], operands[2]));
+  emit_insn (gen_cpymemsi1_2 (operands[0], operands[1], operands[2]));
   DONE;
 }
+#endif
   emit_insn (gen_cpymemhi1 (operands[0], operands[1], operands[2]));
   DONE;
 }")
 
+;;(define_insn "cpymemsi1_2"
+;;  [(set (match_operand:BLK 0 "memory_operand" "=B")
+;;	(match_operand:BLK 1 "memory_operand" "B"))
+;;   (use (match_operand:SI 2 "const_int_operand" "g"))]
+;;  "INTVAL (operands[2]) <= 48"
+;;  "* return vax_output_cpymemsi (insn, operands);")
+
 ;; The definition of this insn does not really explain what it does,
 ;; but it should suffice
 ;; that anything generated as this insn will be recognized as one
 ;; and that it won't successfully combine with anything.
 
-(define_insn "movmemsi1_2"
-  [(set (match_operand:BLK 0 "memory_operand" "=B")
-	(match_operand:BLK 1 "memory_operand" "B"))
-   (use (match_operand:SI 2 "const_int_operand" "g"))]
-  "INTVAL (operands[2]) <= 48"
-  "* return vax_output_movmemsi (insn, operands);")
-
 (define_insn "cpymemhi1"
   [(set (match_operand:BLK 0 "memory_operand" "=o")
 	(match_operand:BLK 1 "memory_operand" "o"))



CVS commit: src/external/gpl3/gcc/dist/gcc

2021-04-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Apr 11 01:37:18 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
reduce diffs to upstream slightly.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/external/gpl3/gcc/dist/gcc/config.gcc

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/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.66 src/external/gpl3/gcc/dist/gcc/config.gcc:1.67
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.66	Sun Apr 11 00:02:11 2021
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Sun Apr 11 01:37:18 2021
@@ -1272,8 +1272,8 @@ arm*-*-freebsd*)# ARM Fr
 	with_tls=${with_tls:-gnu}
 	;;
 arm*-*-netbsdelf*)
-	tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h"
 	tmake_file="${tmake_file} arm/t-arm"
+	tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h"
 	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
 	case ${target} in
 	arm*eb-*) tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" ;;



CVS commit: src/external/gpl3/gcc/dist/gcc

2021-04-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Apr 11 00:26:04 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc: Makefile.in

Log Message:
re-disable selftests


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/gpl3/gcc/dist/gcc/Makefile.in

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/dist/gcc/Makefile.in
diff -u src/external/gpl3/gcc/dist/gcc/Makefile.in:1.22 src/external/gpl3/gcc/dist/gcc/Makefile.in:1.23
--- src/external/gpl3/gcc/dist/gcc/Makefile.in:1.22	Sun Apr 11 00:02:11 2021
+++ src/external/gpl3/gcc/dist/gcc/Makefile.in	Sun Apr 11 00:26:04 2021
@@ -1733,7 +1733,7 @@ $(FULL_DRIVER_NAME): ./xgcc
 #
 # SELFTEST_DEPS need to be set before including language makefile fragments.
 # Otherwise $(SELFTEST_DEPS) is empty when used from /Make-lang.in.
-SELFTEST_DEPS = $(GCC_PASSES) stmp-int-hdrs $(srcdir)/testsuite/selftests
+SELFTEST_DEPS = $(GCC_PASSES) stmp-int-hdrs
 
 # Language makefile fragments.
 



CVS commit: src/external/gpl3/gcc/dist

2021-04-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Apr 11 00:02:27 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist: LAST_UPDATED MD5SUMS NEWS config.guess
config.sub configure configure.ac
src/external/gpl3/gcc/dist/INSTALL: binaries.html build.html
configure.html download.html finalinstall.html gfdl.html index.html
old.html prerequisites.html specific.html test.html
src/external/gpl3/gcc/dist/config: tls.m4
src/external/gpl3/gcc/dist/gcc: ChangeLog Makefile.in alias.c
auto-profile.c builtins.c cfgexpand.c common.opt config.gcc
config.host configure configure.ac cppbuiltin.c cppdefault.c
debug.h diagnostic.c dse.c dwarf2out.c except.c expr.c
file-prefix-map.c file-prefix-map.h final.c fold-const.c gcc.c
gcc.h genattrtab.c genemit.c genmultilib genrecog.c ggc-common.c
gimplify.c graphite-isl-ast-to-gimple.c graphite.h hwint.h
ipa-inline.c ira-color.c opts-global.c opts.c output.h reload.c
reload1.c rtlanal.c system.h target-def.h targhooks.c toplev.c
tree-cfg.c tree-ssa-ccp.c tree.c tree.h var-tracking.c varasm.c
src/external/gpl3/gcc/dist/gcc/c: Make-lang.in
src/external/gpl3/gcc/dist/gcc/c-family: c-cppbuiltin.c c-format.c
c-format.h c-opts.c c.opt
src/external/gpl3/gcc/dist/gcc/common/config/aarch64: aarch64-common.c
src/external/gpl3/gcc/dist/gcc/common/config/arm: arm-common.c
src/external/gpl3/gcc/dist/gcc/common/config/or1k: or1k-common.c
src/external/gpl3/gcc/dist/gcc/common/config/riscv: riscv-common.c
src/external/gpl3/gcc/dist/gcc/config: freebsd-spec.h host-netbsd.c
netbsd-elf.h netbsd-stdint.h netbsd.h t-linux t-netbsd
src/external/gpl3/gcc/dist/gcc/config/aarch64: driver-aarch64.c
t-aarch64
src/external/gpl3/gcc/dist/gcc/config/alpha: alpha.h elf.h netbsd.h
t-alpha
src/external/gpl3/gcc/dist/gcc/config/arc: arc-modes.def arc-protos.h
arc.c arc.h arc.md arc.opt t-arc
src/external/gpl3/gcc/dist/gcc/config/arm: arm.c arm.h arm.md bpabi.h
elf.h freebsd.h netbsd-elf.h t-arm t-rtems thumb2.md
src/external/gpl3/gcc/dist/gcc/config/i386: constraints.md cpuid.h
driver-i386.c i386-opts.h i386-protos.h i386.c i386.h i386.md
i386.opt netbsd-elf.h netbsd64.h pmm_malloc.h predicates.md
src/external/gpl3/gcc/dist/gcc/config/m68k: constraints.md m68k.c
m68k.md netbsd-elf.h
src/external/gpl3/gcc/dist/gcc/config/mips: mips.c netbsd.h t-mips
src/external/gpl3/gcc/dist/gcc/config/or1k: constraints.md elf.h
or1k-protos.h or1k.c or1k.h or1k.md or1k.opt predicates.md t-or1k
src/external/gpl3/gcc/dist/gcc/config/pa: pa.c pa.h
src/external/gpl3/gcc/dist/gcc/config/riscv: constraints.md elf.h
generic.md linux.h peephole.md predicates.md riscv-ftypes.def
riscv-modes.def riscv-protos.h riscv.c riscv.h riscv.md riscv.opt
sync.md
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd.h ppc-asm.h
sysv4.h t-netbsd t-rs6000 vxworksae.h
src/external/gpl3/gcc/dist/gcc/config/sh: netbsd-elf.h sh.c t-sh
src/external/gpl3/gcc/dist/gcc/config/sparc: constraints.md
netbsd-elf.h predicates.md sparc.md sync.md
src/external/gpl3/gcc/dist/gcc/config/vax: builtins.md constraints.md
elf.h netbsd-elf.h predicates.md vax-protos.h vax.c vax.h vax.md
src/external/gpl3/gcc/dist/gcc/cp: Make-lang.in cfns.gperf cfns.h
decl.c except.c
src/external/gpl3/gcc/dist/gcc/doc: cpp.1 cpp.info cpp.texi cppenv.texi
cppinternals.info cppopts.texi extend.texi fsf-funding.7 g++.1
gcc.1 gcc.info gccinstall.info gccint.info gcov-tool.1 gcov.1
gcov.texi gfdl.7 gfortran.1 gpl.7 invoke.texi
src/external/gpl3/gcc/dist/gcc/ginclude: stddef.h unwind-arm-common.h
src/external/gpl3/gcc/dist/gcc/objc: Make-lang.in
src/external/gpl3/gcc/dist/gcc/objcp: Make-lang.in
src/external/gpl3/gcc/dist/include: objalloc.h
src/external/gpl3/gcc/dist/intl: configure
src/external/gpl3/gcc/dist/libbacktrace: configure
src/external/gpl3/gcc/dist/libcpp: Makefile.in configure files.c init.c
internal.h lex.c macro.c
src/external/gpl3/gcc/dist/libcpp/include: cpplib.h
src/external/gpl3/gcc/dist/libgcc: Makefile.in config.host configure
gthr-posix.h unwind-compat.c unwind-dw2-fde-dip.c unwind-dw2-fde.c
unwind-dw2.c unwind-generic.h unwind-seh.c unwind-sjlj.c
src/external/gpl3/gcc/dist/libgcc/config/alpha: qrnnd.S
src/external/gpl3/gcc/dist/libgcc/config/arm: pr-support.c
src/external/gpl3/gcc/dist/libgcc/config/c6x: pr-support.c
src/external/gpl3/gcc/di

CVS commit: src/external/gpl3/gcc/dist/gcc/config/mips

2021-03-28 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Mar 29 01:33:12 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/mips: mips.c netbsd.h netbsd64.h

Log Message:
Don't override TARGET_ASM_OUTPUT_SOURCE_FILENAME on MIPS for NetBSD -
use the default which includes a '.file "filename"' as the first name so
that the FILE symbols type is set to the real source file name.  Needed
to make ctfconvert work.

OK mrg@.
XXX needs to be fed back to GNU.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/dist/gcc/config/mips/mips.c
cvs rdiff -u -r1.14 -r1.15 \
src/external/gpl3/gcc/dist/gcc/config/mips/netbsd.h
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc/dist/gcc/config/mips/netbsd64.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/dist/gcc/config/mips/mips.c
diff -u src/external/gpl3/gcc/dist/gcc/config/mips/mips.c:1.11 src/external/gpl3/gcc/dist/gcc/config/mips/mips.c:1.12
--- src/external/gpl3/gcc/dist/gcc/config/mips/mips.c:1.11	Sat Sep  5 09:12:26 2020
+++ src/external/gpl3/gcc/dist/gcc/config/mips/mips.c	Mon Mar 29 01:33:12 2021
@@ -9488,7 +9488,7 @@ mips_output_external (FILE *file, tree d
 
 /* Implement TARGET_ASM_OUTPUT_SOURCE_FILENAME.  */
 
-static void
+static void ATTRIBUTE_UNUSED
 mips_output_filename (FILE *stream, const char *name)
 {
   /* If we are emitting DWARF-2, let dwarf2out handle the ".file"
@@ -22744,8 +22744,10 @@ mips_starting_frame_offset (void)
 #undef TARGET_TRAMPOLINE_INIT
 #define TARGET_TRAMPOLINE_INIT mips_trampoline_init
 
+#ifndef MIPS_USE_GCC_DEFAULT_OUTPUT_SOURCE_FILENAME
 #undef TARGET_ASM_OUTPUT_SOURCE_FILENAME
 #define TARGET_ASM_OUTPUT_SOURCE_FILENAME mips_output_filename
+#endif	/* MIPS_USE_GCC_DEFAULT_OUTPUT_SOURCE_FILENAME */
 
 #undef TARGET_SHIFT_TRUNCATION_MASK
 #define TARGET_SHIFT_TRUNCATION_MASK mips_shift_truncation_mask

Index: src/external/gpl3/gcc/dist/gcc/config/mips/netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/mips/netbsd.h:1.14 src/external/gpl3/gcc/dist/gcc/config/mips/netbsd.h:1.15
--- src/external/gpl3/gcc/dist/gcc/config/mips/netbsd.h:1.14	Sat Sep  5 09:12:26 2020
+++ src/external/gpl3/gcc/dist/gcc/config/mips/netbsd.h	Mon Mar 29 01:33:12 2021
@@ -229,3 +229,5 @@ along with GCC; see the file COPYING3.  
 
 #undef TARGET_WRITABLE_EH_FRAME
 #define TARGET_WRITABLE_EH_FRAME 0
+
+#define	MIPS_USE_GCC_DEFAULT_OUTPUT_SOURCE_FILENAME

Index: src/external/gpl3/gcc/dist/gcc/config/mips/netbsd64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/mips/netbsd64.h:1.4 src/external/gpl3/gcc/dist/gcc/config/mips/netbsd64.h:1.5
--- src/external/gpl3/gcc/dist/gcc/config/mips/netbsd64.h:1.4	Sat Mar  1 09:44:50 2014
+++ src/external/gpl3/gcc/dist/gcc/config/mips/netbsd64.h	Mon Mar 29 01:33:12 2021
@@ -45,3 +45,5 @@ Boston, MA 02110-1301, USA.  */
%{mips32} %{mips32r2} %{mips64} %{mips64r2} \
%{bestGnum} %{call_shared} %{no_archive} %{exact_version} \
%(netbsd_link_spec)"
+
+#define	MIPS_USE_GCC_DEFAULT_OUTPUT_SOURCE_FILENAME



CVS commit: src/external/gpl3/gcc/dist/gcc/config/arm

2020-11-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Dec  1 02:39:09 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/arm: netbsd-eabi.h

Log Message:
Switch earmv6{,hf}eb from BE32 (deprecated) to BE8 (new), which enables

- binary compatibility with earmv7{,hf}eb and later, as well as
  COMPAT_NETBSD32 on aarch64eb
- unaligned memory access

whereas compatibility with earmv5{,hf}eb and prior is lost.

As we have never released kernel and userland for earmv6{,hf}eb yet,
this does not causes any compatibility problems.

Discussed on port-arm and tech-toolchain.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.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/dist/gcc/config/arm/netbsd-eabi.h
diff -u src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.h:1.15 src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.h:1.16
--- src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.h:1.15	Fri Aug 19 05:11:09 2016
+++ src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.h	Tue Dec  1 02:39:08 2020
@@ -34,8 +34,6 @@
 #undef  TARGET_LINKER_EMULATION
 #if TARGET_BIG_ENDIAN_DEFAULT
 #define TARGET_LINKER_EMULATION TARGET_LINKER_BIG_EMULATION
-#undef BE8_LINK_SPEC
-#define BE8_LINK_SPEC " %{!mlittle-endian:%{march=armv7-a|mcpu=cortex-a5|mcpu=cortex-a8|mcpu=cortex-a9:%{!r:--be8}}}" 
 #else
 #define TARGET_LINKER_EMULATION TARGET_LINKER_LITTLE_EMULATION
 #endif



CVS commit: src/external/gpl3/gcc/dist/gcc

2020-11-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Nov 14 21:24:03 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc: file-prefix-map.c

Log Message:
PR/55802: Andreas Gustafsson: Unbreak reproducible builds.

For reproducible builds to work we need to have a consistent command
line (because the command line gets recorded in dwarf). So we can't
do:

-ffile-prefix-map=/joe/random/src=/usr/src

because then /joe/random/src gets recorded. We do instead:

-ffile-prefix-map=\$NETBSDSRCDIR=/usr/src

The patch restores the environment variable parsing that got lost
in the last 2 gcc upgrades.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gcc/dist/gcc/file-prefix-map.c

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/dist/gcc/file-prefix-map.c
diff -u src/external/gpl3/gcc/dist/gcc/file-prefix-map.c:1.4 src/external/gpl3/gcc/dist/gcc/file-prefix-map.c:1.5
--- src/external/gpl3/gcc/dist/gcc/file-prefix-map.c:1.4	Sat Sep  5 05:12:23 2020
+++ src/external/gpl3/gcc/dist/gcc/file-prefix-map.c	Sat Nov 14 16:24:03 2020
@@ -40,7 +40,8 @@ static void
 add_prefix_map (file_prefix_map *&maps, const char *arg, const char *opt)
 {
   file_prefix_map *map;
-  const char *p;
+  const char *p, *old;
+  size_t oldlen;
 
   /* Note: looking for the last '='. The thinking is we can control the paths
  inside our projects but not where the users build them.  */
@@ -50,9 +51,28 @@ add_prefix_map (file_prefix_map *&maps, 
   error ("invalid argument %qs to %qs", arg, opt);
   return;
 }
+  if (*arg == '$')
+{
+  char *env = xstrndup (arg + 1, p - (arg + 1));
+  old = getenv(env);
+  if (!old)
+	{
+	  warning (0, "environment variable %qs not set in argument to "
+		   "%s", env, opt);
+	  free(env);
+	  return;
+	}
+  oldlen = strlen(old);
+  free(env);
+}
+  else
+{
+  old = xstrndup (arg, p - arg);
+  oldlen = p - arg;
+}
   map = XNEW (file_prefix_map);
-  map->old_prefix = xstrndup (arg, p - arg);
-  map->old_len = p - arg;
+  map->old_prefix = old;
+  map->old_len = oldlen;
   p++;
   map->new_prefix = xstrdup (p);
   map->new_len = strlen (p);



CVS commit: src/external/gpl3/gcc/dist/libcpp

2020-10-19 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Oct 19 07:44:52 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libcpp: macro.c

Log Message:
Remove unused local diff. Pointed out by htodd.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/dist/libcpp/macro.c

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/dist/libcpp/macro.c
diff -u src/external/gpl3/gcc/dist/libcpp/macro.c:1.11 src/external/gpl3/gcc/dist/libcpp/macro.c:1.12
--- src/external/gpl3/gcc/dist/libcpp/macro.c:1.11	Sat Sep  5 09:12:29 2020
+++ src/external/gpl3/gcc/dist/libcpp/macro.c	Mon Oct 19 07:44:52 2020
@@ -406,33 +406,6 @@ add_cpp_remap_path (const char *arg)
 	++remap_pairs;
 }
 
-static const char *
-cpp_remap_file (const char *arg, char **tmp_name)
-{
-	char *result;
-	size_t i, len;
-
-	for (i = 0; i < remap_pairs; ++i) {
-		len = strlen (remap_src[i]);
-		if (strncmp (remap_src[i], arg, len))
-			continue;
-		if (arg[len] == '\0')
-			return remap_dst[i];
-		if (arg[len] != '/')
-			continue;
-		arg += len;
-		len = strlen (remap_dst[i]);
-		result = (char *) xmalloc (len + strlen (arg) + 1);
-		memcpy(result, remap_dst[i], len);
-		strcpy(result + len, arg);
-		*tmp_name = result;
-
-		return result;
-	}
-
-	return arg;
-}
-
 /* Helper function for builtin_macro.  Returns the text generated by
a builtin macro. */
 const uchar *



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2020-10-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Oct 13 07:12:00 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: driver-aarch64.c

Log Message:
Reduce diff with upstream a bit.
No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c

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/dist/gcc/config/aarch64/driver-aarch64.c
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.9 src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.10
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.9	Sat Sep  5 09:12:25 2020
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c	Tue Oct 13 07:12:00 2020
@@ -177,19 +177,19 @@ host_detect_local_cpu (int argc, const c
   const char *res = NULL;
   static const int num_exts = ARRAY_SIZE (aarch64_extensions);
   char buf[128];
+  FILE *f = NULL;
   bool arch = false;
   bool tune = false;
   bool cpu = false;
   unsigned int i = 0;
+  unsigned char imp = INVALID_IMP;
   unsigned int cores[2] = { INVALID_CORE, INVALID_CORE };
   unsigned int n_cores = 0;
   unsigned int variants[2] = { ALL_VARIANTS, ALL_VARIANTS };
   unsigned int n_variants = 0;
-  unsigned char imp = INVALID_IMP;
   bool processed_exts = false;
   unsigned long extension_flags = 0;
   unsigned long default_flags = 0;
-  FILE *f = NULL;
 
   gcc_assert (argc);
 



CVS commit: src/external/gpl3/gcc/dist/gcc

2020-10-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct  4 14:44:48 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc: builtins.c fold-const.c tree.c tree.h

Log Message:
Apply by hand a patch to fix http://r6.ca/blog/20200929T023701Z.html
aka "the memcmp bug", from a patch for gcc-10 in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189
Tested on x86_64 by running a full build, install and running it.
Testing that the problem has been fixed with one of the unit tests provided.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/gpl3/gcc/dist/gcc/builtins.c
cvs rdiff -u -r1.1.1.19 -r1.2 src/external/gpl3/gcc/dist/gcc/fold-const.c
cvs rdiff -u -r1.1.1.14 -r1.2 src/external/gpl3/gcc/dist/gcc/tree.c
cvs rdiff -u -r1.1.1.12 -r1.2 src/external/gpl3/gcc/dist/gcc/tree.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/dist/gcc/builtins.c
diff -u src/external/gpl3/gcc/dist/gcc/builtins.c:1.16 src/external/gpl3/gcc/dist/gcc/builtins.c:1.17
--- src/external/gpl3/gcc/dist/gcc/builtins.c:1.16	Sat Sep  5 05:12:23 2020
+++ src/external/gpl3/gcc/dist/gcc/builtins.c	Sun Oct  4 10:44:47 2020
@@ -118,7 +118,7 @@ static rtx expand_builtin_next_arg (void
 static rtx expand_builtin_va_start (tree);
 static rtx expand_builtin_va_end (tree);
 static rtx expand_builtin_va_copy (tree);
-static rtx inline_expand_builtin_string_cmp (tree, rtx);
+static rtx inline_expand_builtin_bytecmp (tree, rtx);
 static rtx expand_builtin_strcmp (tree, rtx);
 static rtx expand_builtin_strncmp (tree, rtx, machine_mode);
 static rtx builtin_memcpy_read_str (void *, HOST_WIDE_INT, scalar_int_mode);
@@ -3199,20 +3199,18 @@ expand_builtin_strnlen (tree exp, rtx ta
 }
 
 /* Callback routine for store_by_pieces.  Read GET_MODE_BITSIZE (MODE)
-   bytes from constant string DATA + OFFSET and return it as target
-   constant.  */
+   bytes from bytes at DATA + OFFSET and return it reinterpreted as
+   a target constant.  */
 
 static rtx
 builtin_memcpy_read_str (void *data, HOST_WIDE_INT offset,
 			 scalar_int_mode mode)
 {
-  const char *str = (const char *) data;
+  /* The REPresentation pointed to by DATA need not be a nul-terminated
+ string but the caller guarantees it's large enough for MODE.  */
+  const char *rep = (const char *) data;
 
-  gcc_assert (offset >= 0
-	  && ((unsigned HOST_WIDE_INT) offset + GET_MODE_SIZE (mode)
-		  <= strlen (str) + 1));
-
-  return c_readstr (str + offset, mode);
+  return c_readstr (rep + offset, mode, /*nul_terminated=*/false);
 }
 
 /* LEN specify length of the block of memcpy/memset operation.
@@ -3829,7 +3827,6 @@ static rtx
 expand_builtin_memory_copy_args (tree dest, tree src, tree len,
  rtx target, tree exp, memop_ret retmode)
 {
-  const char *src_str;
   unsigned int src_align = get_pointer_alignment (src);
   unsigned int dest_align = get_pointer_alignment (dest);
   rtx dest_mem, src_mem, dest_addr, len_rtx;
@@ -3859,21 +3856,29 @@ expand_builtin_memory_copy_args (tree de
   len_rtx = expand_normal (len);
   determine_block_size (len, len_rtx, &min_size, &max_size,
 			&probable_max_size);
-  src_str = c_getstr (src);
 
-  /* If SRC is a string constant and block move would be done
- by pieces, we can avoid loading the string from memory
- and only stored the computed constants.  */
-  if (src_str
+  /* Try to get the byte representation of the constant SRC points to,
+ with its byte size in NBYTES.  */
+  unsigned HOST_WIDE_INT nbytes;
+  const char *rep = c_getstr (src, &nbytes);
+
+  /* If the function's constant bound LEN_RTX is less than or equal
+ to the byte size of the representation of the constant argument,
+ and if block move would be done by pieces, we can avoid loading
+ the bytes from memory and only store the computed constant.
+ This works in the overlap (memmove) case as well because
+ store_by_pieces just generates a series of stores of constants
+ from the representation returned by c_getstr().  */
+  if (rep
   && CONST_INT_P (len_rtx)
-  && (unsigned HOST_WIDE_INT) INTVAL (len_rtx) <= strlen (src_str) + 1
+  && (unsigned HOST_WIDE_INT) INTVAL (len_rtx) <= nbytes
   && can_store_by_pieces (INTVAL (len_rtx), builtin_memcpy_read_str,
-			  CONST_CAST (char *, src_str),
+			  CONST_CAST (char *, rep),
 			  dest_align, false))
 {
   dest_mem = store_by_pieces (dest_mem, INTVAL (len_rtx),
   builtin_memcpy_read_str,
-  CONST_CAST (char *, src_str),
+  CONST_CAST (char *, rep),
   dest_align, false, retmode);
   dest_mem = force_operand (XEXP (dest_mem, 0), target);
   dest_mem = convert_memory_address (ptr_mode, dest_mem);
@@ -3889,11 +3894,9 @@ expand_builtin_memory_copy_args (tree de
   && (retmode == RETURN_BEGIN || target == const0_rtx))
 method = BLOCK_OP_TAILCALL;
   if (retmode == RETURN_END && target !=

CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-10-02 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Oct  2 14:36:54 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux_libcdep.cc

Log Message:
Do not assume that _lwp_getprivate() returns unbiased private pointer

Cherry-pick and adapt:

>From 2a9ce60de98e53198047daaeeec3cf09ece4e693 Mon Sep 17 00:00:00 2001
From: Kamil Rytarowski 
Date: Fri, 2 Oct 2020 16:13:09 +0200
Subject: [PATCH] [compiler-rt] [netbsd] Improve the portability of
 ThreadSelfTlsTcb

Use __lwp_gettcb_fast() and __lwp_getprivate_fast(), as _lwp_getprivate()
can be a biased pointer and invalid for use in this function on all CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.16 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.17
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.16	Thu Sep 10 12:53:05 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc	Fri Oct  2 14:36:54 2020
@@ -25,6 +25,10 @@
 #include "sanitizer_placement_new.h"
 #include "sanitizer_procmaps.h"
 
+#if SANITIZER_NETBSD
+#define _RTLD_SOURCE  // for __lwp_gettcb_fast() / __lwp_getprivate_fast()
+#endif
+
 #include   // for dlsym()
 #include 
 #include 
@@ -418,7 +422,13 @@ uptr ThreadSelf() {
 
 #if SANITIZER_NETBSD
 static struct tls_tcb * ThreadSelfTlsTcb() {
-  return (struct tls_tcb *)_lwp_getprivate();
+  struct tls_tcb *tcb = nullptr;
+#ifdef __HAVE___LWP_GETTCB_FAST
+  tcb = (struct tls_tcb *)__lwp_gettcb_fast();
+#elif defined(__HAVE___LWP_GETPRIVATE_FAST)
+  tcb = (struct tls_tcb *)__lwp_getprivate_fast();
+#endif
+  return tcb;
 }
 
 uptr ThreadSelf() {



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-17 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Sep 17 15:43:24 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_stoptheworld_netbsd_libcdep.cc

Log Message:
Use internal_ptrace() instead of ptrace()

Cherry-pick:

commit 0008fb343704bafc3469703be930b8a65d7c47fa
Author: Kamil Rytarowski 
Date:   Mon Sep 14 10:10:49 2020 +0200

[compiler-rt] [netbsd] Use internal_ptrace() instead of ptrace()


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.4 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.5
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.4	Thu Sep 17 15:42:17 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc	Thu Sep 17 15:43:24 2020
@@ -131,7 +131,7 @@ bool ThreadSuspender::SuspendAllThreads(
   pl.pl_lwpid = 0;
 
   int val;
-  while ((val = ptrace(op, pid_, (void *)&pl, sizeof(pl))) != -1 &&
+  while ((val = internal_ptrace(op, pid_, (void *)&pl, sizeof(pl))) != -1 &&
  pl.pl_lwpid != 0) {
 suspended_threads_list_.Append(pl.pl_lwpid);
 VReport(2, "Appended thread %d in process %d.\n", pl.pl_lwpid, pid_);



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-17 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Sep 17 15:42:17 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_stoptheworld_netbsd_libcdep.cc

Log Message:
Undo setting _KERNTYPES

The sparc ptrace(2) headers were fixed to work without defined _KERNTYPES.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.3 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.3	Sun Sep 13 08:51:58 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc	Thu Sep 17 15:42:17 2020
@@ -18,7 +18,6 @@
 
 #if SANITIZER_NETBSD
 
-#define _KERNTYPES	/* we want register_t for some ptrace functions */
 #include "sanitizer_stoptheworld.h"
 
 #include "sanitizer_atomic.h"



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2020-09-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Sep 15 05:06:56 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd64.h

Log Message:
merge generic changes in eg rs6000/freebsd64.h into netbsd64.h


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.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/dist/gcc/config/rs6000/netbsd64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.26 src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.27
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.26	Mon Sep  7 22:21:55 2020
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h	Tue Sep 15 05:06:56 2020
@@ -20,6 +20,10 @@
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.  */
 
+/* Undef gnu-user.h macros we don't want.  */
+#undef CPLUSPLUS_CPP_SPEC
+#undef LINK_GCC_C_SEQUENCE_SPEC
+
 #ifndef RS6000_BI_ARCH
 
 #undef	DEFAULT_ABI
@@ -105,7 +109,7 @@ extern int dot_symbols;
 	{			\
 	  rs6000_current_abi = ABI_ELFv2;			\
 	  if (dot_symbols)	\
-		error ("-mcall-aixdesc incompatible with -mabi=elfv2"); \
+		error ("%<-mcall-aixdesc%> incompatible with %<-mabi=elfv2%>"); \
 	}			\
 	  if (rs6000_isa_flags & OPTION_MASK_RELOCATABLE)	\
 	{			\
@@ -131,14 +135,14 @@ extern int dot_symbols;
 	  if ((rs6000_isa_flags & OPTION_MASK_POWERPC64) == 0)	\
 	{			\
 	  rs6000_isa_flags |= OPTION_MASK_POWERPC64;	\
-	  error ("-m64 requires a PowerPC64 cpu");		\
+	  error ("%<-m64%> requires a PowerPC64 cpu");	\
 	}			\
 	  if ((rs6000_isa_flags_explicit			\
 	   & OPTION_MASK_MINIMAL_TOC) != 0)			\
 	{			\
 	  if (global_options_set.x_rs6000_current_cmodel	\
 		  && rs6000_current_cmodel != CMODEL_SMALL)	\
-		error ("-mcmodel incompatible with other toc options"); \
+		error ("%<-mcmodel%> incompatible with other toc options"); \
 	  SET_CMODEL (CMODEL_SMALL);			\
 	}			\
 	  else			\
@@ -422,13 +426,13 @@ extern int dot_symbols;
 #undef  ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE)\
   (TARGET_TOC   \
-   && (GET_CODE (X) == SYMBOL_REF   \
+   && (SYMBOL_REF_P (X)			\
|| (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS  \
-   && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF)   \
+   && SYMBOL_REF_P (XEXP (XEXP (X, 0), 0)))			\
|| GET_CODE (X) == LABEL_REF \
-   || (GET_CODE (X) == CONST_INT\
+   || (CONST_INT_P (X)		\
&& GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode))  \
-   || (GET_CODE (X) == CONST_DOUBLE \
+   || (CONST_DOUBLE_P (X)		\
&& ((TARGET_64BIT\
 && (TARGET_MINIMAL_TOC  \
 || (SCALAR_FLOAT_MODE_P (GET_MODE (X))  \
@@ -542,6 +546,7 @@ extern int dot_symbols;
 #undef UINTMAX_TYPE
 #define UINTMAX_TYPE UINT64_TYPE
 
+#if 0
 /* Override rs6000.h definition.  */
 #undef  ASM_APP_ON
 #define ASM_APP_ON "#APP\n"
@@ -549,6 +554,7 @@ extern int dot_symbols;
 /* Override rs6000.h definition.  */
 #undef  ASM_APP_OFF
 #define ASM_APP_OFF "#NO_APP\n"
+#endif
 
 #undef  RS6000_MCOUNT
 #define RS6000_MCOUNT "_mcount"



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2020-09-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Sep 14 14:56:43 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl_amd64.S

Log Message:
Undo local patch adding GNU-stack

This is unneeded on NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S

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/dist/libsanitizer/tsan/tsan_rtl_amd64.S
diff -u src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S:1.8 src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S:1.9
--- src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S:1.8	Sat Sep  5 09:12:32 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S	Mon Sep 14 14:56:43 2020
@@ -397,7 +397,7 @@ ASM_SYMBOL_INTERCEPTOR(__sigsetjmp):
 ASM_SIZE(ASM_SYMBOL_INTERCEPTOR(__sigsetjmp))
 #endif  // !defined(__APPLE__) && !defined(__NetBSD__)
 
-#if defined(__FreeBSD__) || defined(__linux__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__linux__)
 /* We do not need executable stack.  */
 /* This note is not needed on NetBSD. */
 .section.note.GNU-stack,"",@progbits



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2020-09-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Sep 14 11:56:01 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_interceptors.cc

Log Message:
Catch unsupported LONG_JMP_SP_ENV_SLOT

A variation of this patch is pending upstream: https://reviews.llvm.org/D87602


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc

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/dist/libsanitizer/tsan/tsan_interceptors.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.11 src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.12
--- src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.11	Sat Sep 12 22:23:57 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc	Mon Sep 14 11:56:01 2020
@@ -497,12 +497,16 @@ static void SetJmp(ThreadState *thr, upt
 }
 
 static void LongJmp(ThreadState *thr, uptr *env) {
-#ifdef __powerpc__
+#if SANITIZER_NETBSD
+# ifdef __x86_64__
+  uptr mangled_sp = env[6];
+# else
+#  error Unsupported
+# endif
+#elif defined(__powerpc__)
   uptr mangled_sp = env[0];
 #elif SANITIZER_FREEBSD
   uptr mangled_sp = env[2];
-#elif SANITIZER_NETBSD
-  uptr mangled_sp = env[6];
 #elif SANITIZER_MAC
 # ifdef __aarch64__
   uptr mangled_sp =



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep 13 08:51:59 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_netbsd.cc
sanitizer_stoptheworld_netbsd_libcdep.cc

Log Message:
Add missing dkbad.h include and define _KERNTYPES so we get all internal
types (like register_t) that we need for ptrace.
Fixes the build on sparc64.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.5 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.6
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.5	Sat Sep 12 15:01:38 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc	Sun Sep 13 08:51:58 2020
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.3
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.2	Fri Sep 11 01:07:00 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc	Sun Sep 13 08:51:58 2020
@@ -18,6 +18,7 @@
 
 #if SANITIZER_NETBSD
 
+#define _KERNTYPES	/* we want register_t for some ptrace functions */
 #include "sanitizer_stoptheworld.h"
 
 #include "sanitizer_atomic.h"



CVS commit: src/external/gpl3/gcc/dist/libsanitizer

2020-09-12 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sun Sep 13 03:00:12 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/include/sanitizer:
netbsd_syscall_hooks.h
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_syscalls_netbsd.inc

Log Message:
Sync netbsd_syscall_hooks.h with LLVM r. 74760bb00fb9b78a

Update the syscall definitionss from a snapshot 2.5 years old to the
current one.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/include/sanitizer/netbsd_syscall_hooks.h
cvs rdiff -u -r1.1.1.1 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscalls_netbsd.inc

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/dist/libsanitizer/include/sanitizer/netbsd_syscall_hooks.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/include/sanitizer/netbsd_syscall_hooks.h:1.1.1.1 src/external/gpl3/gcc/dist/libsanitizer/include/sanitizer/netbsd_syscall_hooks.h:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/include/sanitizer/netbsd_syscall_hooks.h:1.1.1.1	Sat Sep  5 07:52:57 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/include/sanitizer/netbsd_syscall_hooks.h	Sun Sep 13 03:00:12 2020
@@ -1,7 +1,8 @@
 //===-- netbsd_syscall_hooks.h ===//
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===--===//
 //
@@ -19,8 +20,8 @@
 // DO NOT EDIT! THIS FILE HAS BEEN GENERATED!
 //
 // Generated with: generate_netbsd_syscalls.awk
-// Generated date: 2018-03-03
-// Generated from: syscalls.master,v 1.291 2018/01/06 16:41:23 kamil Exp
+// Generated date: 2020-09-10
+// Generated from: syscalls.master,v 1.306 2020/08/14 00:53:16 riastradh Exp
 //
 //===--===//
 #ifndef SANITIZER_NETBSD_SYSCALL_HOOKS_H
@@ -473,7 +474,12 @@
   __sanitizer_syscall_pre_impl_dup2((long long)(from), (long long)(to))
 #define __sanitizer_syscall_post_dup2(res, from, to)   \
   __sanitizer_syscall_post_impl_dup2(res, (long long)(from), (long long)(to))
-/* syscall 91 has been skipped */
+#define __sanitizer_syscall_pre_getrandom(buf, buflen, flags)  \
+  __sanitizer_syscall_pre_impl_getrandom(  \
+  (long long)(buf), (long long)(buflen), (long long)(flags))
+#define __sanitizer_syscall_post_getrandom(res, buf, buflen, flags)\
+  __sanitizer_syscall_post_impl_getrandom( \
+  res, (long long)(buf), (long long)(buflen), (long long)(flags))
 #define __sanitizer_syscall_pre_fcntl(fd, cmd, arg)\
   __sanitizer_syscall_pre_impl_fcntl((long long)(fd), (long long)(cmd),\
  (long long)(arg))
@@ -848,9 +854,31 @@
 #define __sanitizer_syscall_post_sysarch(res, op, parms)   \
   __sanitizer_syscall_post_impl_sysarch(res, (long long)(op),  \
 (long long)(parms))
-/* syscall 166 has been skipped */
-/* syscall 167 has been skipped */
-/* syscall 168 has been skipped */
+#define __sanitizer_syscall_pre___futex(uaddr, op, val, timeout, uaddr2, val2, \
+val3)  \
+  __sanitizer_syscall_pre_impl___futex((long long)(uaddr), (long long)(op),\
+   (long long)(val), (long long)(timeout), \
+   (long long)(uaddr2), (long long)(val2), \
+   (long long)(val3))
+#define __sanitizer_syscall_post___futex(res, uaddr, op, val, timeout, uaddr2, \
+ val2, val3)   \
+  __sanitizer_syscall_post_impl___futex(   \
+  res, (long long)(uaddr), (long long)(op), (long long)(val),  \
+  (long long)(timeout), (long long)(uaddr2), (long long)(val2),\
+  (long long)(val3))
+#define __sanitizer_syscall_pre___futex_set_robust_list(head, len) \
+  __sanitizer_syscall_pre_impl___futex_set_robust_list((long long)(head),  \
+   (long long)(len))
+#define __sanitizer_syscall_post___futex_set_robust_list(res, head, len)   \
+  __sanitizer_syscall_post_impl___futex_set_robust_list(   \
+  res, (long

CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-12 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Sep 12 22:52:24 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_posix_libcdep.cc

Log Message:
Disable GetNamedMappingFd for NetBSD

Analogous logic is in LLVM rev. 74760bb00fb9b78a2fe122.

Removes undefined symbol linkage to shm_unlink and shm_open.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:1.1.1.7 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:1.1.1.7	Sat Sep  5 07:52:57 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc	Sat Sep 12 22:52:24 2020
@@ -304,7 +304,7 @@ void PlatformPrepareForSandboxing(__sani
   MemoryMappingLayout::CacheMemoryMappings();
 }
 
-#if SANITIZER_ANDROID || SANITIZER_GO
+#if SANITIZER_ANDROID || SANITIZER_GO || SANITIZER_NETBSD
 int GetNamedMappingFd(const char *name, uptr size) {
   return -1;
 }



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2020-09-12 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Sep 12 22:23:57 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_interceptors.cc

Log Message:
Sync chunks of tsan_interceptors.cc with LLVM rev. 74760bb00fb9b78a2fe122

Sync tsan_interceptors.cc with upstream file tsan_interceptors_posix.cpp.

Changes:
 - define fileno_unlocked() for NetBSD
 - use defined __sanitizer_FILE for NetBSD
 - handle symbol indirection for vfork and nanosleep
 - delete sem_* API, currently moved to common code with sanitizers
 - undef SANITIZER_INTERCEPT_PTHREAD_SIGMASK to fix build
 - remove locally introduced SANITIZER_NETBSD

With these changes, TSan for GCC builds.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc

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/dist/libsanitizer/tsan/tsan_interceptors.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.10 src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.11
--- src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.10	Sat Sep 12 21:30:36 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc	Sat Sep 12 22:23:57 2020
@@ -40,17 +40,16 @@ using namespace __tsan;  // NOLINT
 
 #if SANITIZER_NETBSD
 #define dirfd(dirp) (*(int *)(dirp))
-#define fileno_unlocked fileno
+#define fileno_unlocked(fp)  \
+  (((__sanitizer_FILE *)fp)->_file == -1 \
+   ? -1  \
+   : (int)(unsigned short)(((__sanitizer_FILE *)fp)->_file))
 
-#if _LP64
-#define __sF_size 152
-#else
-#define __sF_size 88
-#endif
-
-#define stdout ((char*)&__sF + (__sF_size * 1))
-#define stderr ((char*)&__sF + (__sF_size * 2))
+#define stdout ((__sanitizer_FILE*)&__sF[1])
+#define stderr ((__sanitizer_FILE*)&__sF[2])
 
+#define nanosleep __nanosleep50
+#define vfork __vfork14
 #endif
 
 #if SANITIZER_ANDROID
@@ -92,8 +91,8 @@ DECLARE_REAL_AND_INTERCEPTOR(void *, mal
 DECLARE_REAL_AND_INTERCEPTOR(void, free, void *ptr)
 extern "C" void *pthread_self();
 extern "C" void _exit(int status);
-extern "C" int fileno_unlocked(void *stream);
 #if !SANITIZER_NETBSD
+extern "C" int fileno_unlocked(void *stream);
 extern "C" int dirfd(void *dirp);
 #endif
 #if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_NETBSD
@@ -1417,61 +1416,6 @@ TSAN_INTERCEPTOR(int, pthread_once, void
   return 0;
 }
 
-TSAN_INTERCEPTOR(int, sem_init, void *s, int pshared, unsigned value) {
-  SCOPED_TSAN_INTERCEPTOR(sem_init, s, pshared, value);
-  int res = REAL(sem_init)(s, pshared, value);
-  return res;
-}
-
-TSAN_INTERCEPTOR(int, sem_destroy, void *s) {
-  SCOPED_TSAN_INTERCEPTOR(sem_destroy, s);
-  int res = REAL(sem_destroy)(s);
-  return res;
-}
-
-TSAN_INTERCEPTOR(int, sem_wait, void *s) {
-  SCOPED_TSAN_INTERCEPTOR(sem_wait, s);
-  int res = BLOCK_REAL(sem_wait)(s);
-  if (res == 0) {
-Acquire(thr, pc, (uptr)s);
-  }
-  return res;
-}
-
-TSAN_INTERCEPTOR(int, sem_trywait, void *s) {
-  SCOPED_TSAN_INTERCEPTOR(sem_trywait, s);
-  int res = BLOCK_REAL(sem_trywait)(s);
-  if (res == 0) {
-Acquire(thr, pc, (uptr)s);
-  }
-  return res;
-}
-
-TSAN_INTERCEPTOR(int, sem_timedwait, void *s, void *abstime) {
-  SCOPED_TSAN_INTERCEPTOR(sem_timedwait, s, abstime);
-  int res = BLOCK_REAL(sem_timedwait)(s, abstime);
-  if (res == 0) {
-Acquire(thr, pc, (uptr)s);
-  }
-  return res;
-}
-
-TSAN_INTERCEPTOR(int, sem_post, void *s) {
-  SCOPED_TSAN_INTERCEPTOR(sem_post, s);
-  Release(thr, pc, (uptr)s);
-  int res = REAL(sem_post)(s);
-  return res;
-}
-
-TSAN_INTERCEPTOR(int, sem_getvalue, void *s, int *sval) {
-  SCOPED_TSAN_INTERCEPTOR(sem_getvalue, s, sval);
-  int res = REAL(sem_getvalue)(s, sval);
-  if (res == 0) {
-Acquire(thr, pc, (uptr)s);
-  }
-  return res;
-}
-
 #if SANITIZER_LINUX && !SANITIZER_ANDROID
 TSAN_INTERCEPTOR(int, __fxstat, int version, int fd, void *buf) {
   SCOPED_TSAN_INTERCEPTOR(__fxstat, version, fd, buf);
@@ -2236,6 +2180,7 @@ static void HandleRecvmsg(ThreadState *t
 #define NEED_TLS_GET_ADDR
 #endif
 #undef SANITIZER_INTERCEPT_TLS_GET_ADDR
+#undef SANITIZER_INTERCEPT_PTHREAD_SIGMASK
 
 #define COMMON_INTERCEPT_FUNCTION(name) INTERCEPT_FUNCTION(name)
 #define COMMON_INTERCEPT_FUNCTION_VER(name, ver)  \
@@ -2476,7 +2421,6 @@ static void syscall_fd_close(uptr pc, in
   TSAN_SYSCALL();
   FdClose(thr, pc, fd);
 }
-#endif
 
 static USED void syscall_fd_acquire(uptr pc, int fd) {
   TSAN_SYSCALL();
@@ -2490,7 +2434,6 @@ static USED void syscall_fd_release(uptr
   FdRelease(thr, pc, fd);
 }
 
-#if !SANITIZER_NETBSD
 static void syscall_pre_fork(uptr pc) {
   TSAN_SYSCALL();
   ForkBefore(thr, pc);



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2020-09-12 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Sep 12 21:30:36 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_interceptors.cc

Log Message:
Remove dead code block (from a local patch)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc

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/dist/libsanitizer/tsan/tsan_interceptors.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.9 src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.10
--- src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.9	Sat Sep  5 09:12:32 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc	Sat Sep 12 21:30:36 2020
@@ -57,21 +57,6 @@ using namespace __tsan;  // NOLINT
 #define mallopt(a, b)
 #endif
 
-#if 0 // XXXMRG
-#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
-#define PTHREAD_CREATE_DETACHED 1
-#elif SANITIZER_MAC
-#define PTHREAD_CREATE_DETACHED 2
-#endif
-#if SANITIZER_NETBSD
-#define	__errno_location __errno
-#define	pthread_yield sched_yield
-#define	fileno_unlocked fileno
-#define	stdout __sF[1]
-#define	stderr __sF[2]
-#endif
-#endif
-
 #ifdef __mips__
 const int kSigCount = 129;
 #else



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/lsan

2020-09-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Sep 11 09:01:41 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_common.cc

Log Message:
__mips64 does not mean 64 bit address space.  also check _LP64.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.cc

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/dist/libsanitizer/lsan/lsan_common.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.cc:1.1.1.7 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.cc:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.cc:1.1.1.7	Sat Sep  5 07:52:57 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.cc	Fri Sep 11 09:01:41 2020
@@ -135,7 +135,7 @@ static inline bool CanBeAHeapPointer(upt
 #if defined(__x86_64__)
   // Accept only canonical form user-space addresses.
   return ((p >> 47) == 0);
-#elif defined(__mips64)
+#elif defined(__mips64) && defined(_LP64)
   return ((p >> 40) == 0);
 #elif defined(__aarch64__)
   unsigned runtimeVMA =



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:45:53 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.h

Log Message:
Add prototypes of internal_sigdelset() and internal_clone()

Cherry-pick the missing change from:

commit 983d7ddd0b278b45d815cbac9197205b39c4860a
Author: Kamil Rytarowski 
Date:   Thu Jul 11 06:22:35 2019 +

Add NetBSD LSan support

Summary:
Combine few relatively small changes into one:

 - implement internal_ptrace() and internal_clone() for NetBSD
 - add support for stoptheworld based on the ptrace(2) API
 - define COMPILER_RT_HAS_LSAN for NetBSD
 - enable tests for NetBSD/amd64

Inspired by the original implementation by Christos Zoulas in netbsd/src 
for GCC.

The implementation is in theory CPU independent through well defined macros
across all NetBSD ports, however only the x86_64 version was tested.

Reviewers: mgorny, dvyukov, vitalybuka, joerg, jfb

Reviewed By: vitalybuka

Subscribers: dexonsmith, jfb, srhines, kubamracek, llvm-commits, christos

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64057

llvm-svn: 365735


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.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/dist/libsanitizer/sanitizer_common/sanitizer_linux.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.10 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.11
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.10	Sat Sep  5 13:35:55 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h	Fri Sep 11 01:45:53 2020
@@ -74,12 +74,8 @@ uptr internal_prctl(int option, uptr arg
 #endif  // SANITIZER_LINUX
 
 #ifdef SANITIZER_NETBSD
-int internal_sigaction_norestorer(int signum, const void *act, void *oldact);
-#define internal_sigdelset(set, signum) \
-__sigdelset(set, signum)
-#define internal_clone(fn, child_stack, flags, arg, \
-parent_tidptr, newtls, child_tidptr) \
-__clone(fn, child_stack, flags, arg)
+void internal_sigdelset(__sanitizer_sigset_t *set, int signum);
+uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg);
 #endif
 
 // This class reads thread IDs from /proc//task using only syscalls.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:08:36 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_getauxval.h

Log Message:
Add getauxval() compat for NetBSD

Cherry-pick and adapt:

commit 02519fc7a6f8c528f67975a9f78ce64dabf402b4
Author: Kamil Rytarowski 
Date:   Thu Sep 12 18:57:58 2019 +

Add getauxval() compat for NetBSD

Summary:
getauxval() is not available on NetBSD and there is no a direct equivalent.

Add a function that implements the same semantics with NetBSD internals.

Reorder the GetPageSize() functions to prefer the sysctl approach for 
NetBSD.
It no longer makes a difference which approach is better. Avoid changing
conditional code path.

Reviewers: vitalybuka, dvyukov, mgorny, joerg

Reviewed By: vitalybuka

Subscribers: llvm-commits, #sanitizers

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D67329

llvm-svn: 371758


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.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/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h:1.1.1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h:1.1.1.1	Sat Sep  5 07:52:57 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h	Fri Sep 11 01:08:36 2020
@@ -8,6 +8,7 @@
 // Common getauxval() guards and definitions.
 // getauxval() is not defined until glibc version 2.16, or until API level 21
 // for Android.
+// Implement the getauxval() compat function for NetBSD.
 //
 //===--===//
 
@@ -41,6 +42,23 @@ extern "C" SANITIZER_WEAK_ATTRIBUTE
 unsigned long getauxval(unsigned long type);  // NOLINT
 # endif
 
-#endif // SANITIZER_LINUX || SANITIZER_FUCHSIA
+#elif SANITIZER_NETBSD
+
+#define SANITIZER_USE_GETAUXVAL 1
+
+#include 
+#include 
+
+static inline decltype(AuxInfo::a_v) getauxval(decltype(AuxInfo::a_type) type) {
+  for (const AuxInfo *aux = (const AuxInfo *)_dlauxinfo();
+   aux->a_type != AT_NULL; ++aux) {
+if (type == aux->a_type)
+  return aux->a_v;
+  }
+
+  return 0;
+}
+
+#endif
 
 #endif // SANITIZER_GETAUXVAL_H



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:07:53 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Use sysctl to implement GetPageSize()

Cherry-pick code chunk from newer LLVM compiler-rt.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.36 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.37
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.36	Mon Sep  7 00:22:51 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Fri Sep 11 01:07:53 2020
@@ -1139,6 +1139,14 @@ uptr GetPageSize() {
 // Android post-M sysconf(_SC_PAGESIZE) crashes if called from .preinit_array.
 #if SANITIZER_ANDROID
   return 4096;
+#elif SANITIZER_FREEBSD || SANITIZER_NETBSD
+// Use sysctl as sysconf can trigger interceptors internally.
+  int pz = 0;
+  uptr pzl = sizeof(pz);
+  int mib[2] = {CTL_HW, HW_PAGESIZE};
+  int rv = internal_sysctl(mib, 2, &pz, &pzl, nullptr, 0);
+  CHECK_EQ(rv, 0);
+  return (uptr)pz;
 #elif SANITIZER_LINUX && (defined(__x86_64__) || defined(__i386__))
   return EXEC_PAGESIZE;
 #elif SANITIZER_USE_GETAUXVAL



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:07:27 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_internal_defs.h

Log Message:
Enable SANITIZER_CAN_USE_PREINIT_ARRAY on NetBSD

Cherry-pick:

commit 3a189bac9bb111c9a59339015ab0d4e2fed735f4
Author: Kamil Rytarowski 
Date:   Thu Dec 19 03:21:46 2019 +0100

[compiler-rt] Enable SANITIZER_CAN_USE_PREINIT_ARRAY on NetBSD

.preinit_array is supported since 9.0.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.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/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.12 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.13
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.12	Sat Sep  5 09:12:32 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h	Fri Sep 11 01:07:27 2020
@@ -104,7 +104,7 @@
 // FIXME: do we have anything like this on Mac?
 #ifndef SANITIZER_CAN_USE_PREINIT_ARRAY
 #if ((SANITIZER_LINUX && !SANITIZER_ANDROID) || SANITIZER_OPENBSD || \
- SANITIZER_FUCHSIA) && !defined(PIC)
+ SANITIZER_FUCHSIA || SANITIZER_NETBSD) && !defined(PIC)
 #define SANITIZER_CAN_USE_PREINIT_ARRAY 1
 // Before Solaris 11.4, .preinit_array is fully supported only with GNU ld.
 // FIXME: Check for those conditions.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:07:00 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_stoptheworld_netbsd_libcdep.cc

Log Message:
Adapt stop-the-world for ptrace changes in NetBSD-9.99.30

Cherry-pick and adapt:

commit fc356dcc11c10003ff22acff667b0a9f5e6c1e0f
Author: Kamil Rytarowski 
Date:   Tue Dec 24 20:33:54 2019 +0100

[compiler-rt] Adapt stop-the-world for ptrace changes in NetBSD-9.99.30

Handle PT_LWPNEXT for newer kernels and keep PT_LWPINFO for older ones.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.1	Fri Sep 11 01:05:28 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc	Fri Sep 11 01:07:00 2020
@@ -120,10 +120,18 @@ bool ThreadSuspender::SuspendAllThreads(
 
   VReport(2, "Attached to process %d.\n", pid_);
 
+#ifdef PT_LWPNEXT
+  struct ptrace_lwpstatus pl;
+  int op = PT_LWPNEXT;
+#else
   struct ptrace_lwpinfo pl;
-  int val;
+  int op = PT_LWPINFO;
+#endif
+
   pl.pl_lwpid = 0;
-  while ((val = ptrace(PT_LWPINFO, pid_, (void *)&pl, sizeof(pl))) != -1 &&
+
+  int val;
+  while ((val = ptrace(op, pid_, (void *)&pl, sizeof(pl))) != -1 &&
  pl.pl_lwpid != 0) {
 suspended_threads_list_.Append(pl.pl_lwpid);
 VReport(2, "Appended thread %d in process %d.\n", pl.pl_lwpid, pid_);



CVS commit: src/external/gpl3/gcc/dist/libsanitizer

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:04:34 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_interceptors.h
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_interceptors.cc
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_interceptors.h

Log Message:
Stop tracking atexit/__cxa_atexit/pthread_atfork allocations in LSan/NetBSD

Cherry-pick and adapt:

commit 8827047551570b7ed7088765c3de2a8cce6823b8
Author: Kamil Rytarowski 
Date:   Sat Sep 21 07:30:42 2019 +

Stop tracking atexit/__cxa_atexit/pthread_atfork allocations in LSan/NetBSD

Summary:
The atexit(3) and __cxa_atexit() calls allocate internally memory and free 
on exit,
after executing all callback. This causes false positives as DoLeakCheck() 
is called
from the atexit handler. In the LSan/ASan tests there are strict checks 
triggering
false positives here.

Intercept all atexit(3) and __cxa_atexit() calls and disable LSan when 
calling the
real functions.

Stop tracing allocations in pthread_atfork(3) funtions, as there are 
performed
internal allocations that are not freed for the time of running 
StopTheWorld()
code. This avoids false-positives.

The same changes have to be replicated in the ASan and LSan runtime.

Non-NetBSD OSs are not tested and this code is restricted to NetBSD only.

Reviewers: dvyukov, joerg, mgorny, vitalybuka, eugenis

Reviewed By: vitalybuka

Subscribers: jfb, llvm-commits, #sanitizers

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D67331

llvm-svn: 372459


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.h
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_interceptors.cc
cvs rdiff -u -r1.8 -r1.9 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.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/dist/libsanitizer/asan/asan_interceptors.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.h:1.6 src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.h:1.7
--- src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.h:1.6	Sat Sep  5 09:12:31 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.h	Fri Sep 11 01:04:33 2020
@@ -103,12 +103,24 @@ void InitializePlatformInterceptors();
 # define ASAN_INTERCEPT___CXA_ATEXIT 0
 #endif
 
+#if SANITIZER_NETBSD
+# define ASAN_INTERCEPT_ATEXIT 1
+#else
+# define ASAN_INTERCEPT_ATEXIT 0
+#endif
+
 #if SANITIZER_LINUX && !SANITIZER_ANDROID
 # define ASAN_INTERCEPT___STRDUP 1
 #else
 # define ASAN_INTERCEPT___STRDUP 0
 #endif
 
+#if SANITIZER_NETBSD
+# define ASAN_INTERCEPT_PTHREAD_ATFORK 1
+#else
+# define ASAN_INTERCEPT_PTHREAD_ATFORK 0
+#endif
+
 DECLARE_REAL(int, memcmp, const void *a1, const void *a2, uptr size)
 DECLARE_REAL(char*, strchr, const char *str, int c)
 DECLARE_REAL(SIZE_T, strlen, const char *s)

Index: src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_interceptors.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_interceptors.cc:1.6 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_interceptors.cc:1.7
--- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_interceptors.cc:1.6	Fri Sep 11 01:03:31 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_interceptors.cc	Fri Sep 11 01:04:34 2020
@@ -348,6 +348,44 @@ INTERCEPTOR(char *, strerror, int errnum
 #define LSAN_MAYBE_INTERCEPT_STRERROR
 #endif
 
+#if SANITIZER_INTERCEPT___CXA_ATEXIT
+INTERCEPTOR(int, __cxa_atexit, void (*func)(void *), void *arg,
+void *dso_handle) {
+  __lsan::ScopedInterceptorDisabler disabler;
+  return REAL(__cxa_atexit)(func, arg, dso_handle);
+}
+#define LSAN_MAYBE_INTERCEPT___CXA_ATEXIT INTERCEPT_FUNCTION(__cxa_atexit)
+#else
+#define LSAN_MAYBE_INTERCEPT___CXA_ATEXIT
+#endif
+
+#if SANITIZER_INTERCEPT_ATEXIT
+INTERCEPTOR(int, atexit, void (*f)()) {
+  __lsan::ScopedInterceptorDisabler disabler;
+  return REAL(__cxa_atexit)((void (*)(void *a))f, 0, 0);
+}
+#define LSAN_MAYBE_INTERCEPT_ATEXIT INTERCEPT_FUNCTION(atexit)
+#else
+#define LSAN_MAYBE_INTERCEPT_ATEXIT
+#endif
+
+#if SANITIZER_INTERCEPT_PTHREAD_ATFORK
+extern "C" {
+extern int _pthread_atfork(void (*prepare)(), void (*parent)(),
+   void (*child)());
+};
+
+INTERCEPTOR(int, pthread_atfork, void (*prepare)(), void (*parent)(),
+void (*child)()) {
+  __lsan::ScopedInterceptorDisabler disabler;
+  // REAL(pthread_atfork) cannot be called due to symbol indirections at least on NetBSD
+  return _pthread_atfork(prepare, parent, child);
+}
+#define LSAN_MAYBE_INTERCEPT_PTHREAD_ATFORK INTERCEPT_FUNCTION(pthread_atfork)
+#else
+#define LS

CVS commit: src/external/gpl3/gcc/dist/libsanitizer

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:03:31 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_interceptors.cc
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_interceptors.cc
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_common_interceptors.inc

Log Message:
Add __lsan::ScopedInterceptorDisabler for strerror(3)

Cherry-pick and adapt:

commit 1b58389428ed07a7322ba9c2bcaeec99807f9457
Author: Kamil Rytarowski 
Date:   Sat Sep 21 07:45:02 2019 +

Add __lsan::ScopedInterceptorDisabler for strerror(3)

Summary:
strerror(3) on NetBSD uses internally TSD with a destructor that is never
fired for exit(3). It's correctly called for pthread_exit(3) scenarios.

This is a case when a leak on exit(3) is expected, unavoidable and harmless.

Reviewers: joerg, vitalybuka, dvyukov, mgorny

Reviewed By: vitalybuka

Subscribers: dmgreen, kristof.beyls, jfb, llvm-commits, #sanitizers

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D67337

llvm-svn: 372461


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_interceptors.cc
cvs rdiff -u -r1.9 -r1.10 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc

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/dist/libsanitizer/asan/asan_interceptors.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc:1.8 src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc:1.9
--- src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc:1.8	Sat Sep  5 09:12:31 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/asan/asan_interceptors.cc	Fri Sep 11 01:03:31 2020
@@ -163,6 +163,11 @@ DECLARE_REAL_AND_INTERCEPTOR(void, free,
 ASAN_MEMSET_IMPL(ctx, block, c, size);  \
   } while (false)
 
+#if CAN_SANITIZE_LEAKS
+#define COMMON_INTERCEPTOR_STRERROR()   \
+  __lsan::ScopedInterceptorDisabler disabler
+#endif
+
 #include "sanitizer_common/sanitizer_common_interceptors.inc"
 #include "sanitizer_common/sanitizer_signal_interceptors.inc"
 

Index: src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_interceptors.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_interceptors.cc:1.5 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_interceptors.cc:1.6
--- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_interceptors.cc:1.5	Sat Sep  5 09:12:31 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_interceptors.cc	Fri Sep 11 01:03:31 2020
@@ -338,6 +338,16 @@ INTERCEPTOR(void, thr_exit, tid_t *state
 #define LSAN_MAYBE_INTERCEPT_THR_EXIT
 #endif
 
+#if SANITIZER_INTERCEPT_STRERROR
+INTERCEPTOR(char *, strerror, int errnum) {
+  __lsan::ScopedInterceptorDisabler disabler;
+  return REAL(strerror)(errnum);
+}
+#define LSAN_MAYBE_INTERCEPT_STRERROR INTERCEPT_FUNCTION(strerror)
+#else
+#define LSAN_MAYBE_INTERCEPT_STRERROR
+#endif
+
 struct ThreadParam {
   void *(*callback)(void *arg);
   void *param;
@@ -447,6 +457,8 @@ void InitializeInterceptors() {
   LSAN_MAYBE_INTERCEPT__LWP_EXIT;
   LSAN_MAYBE_INTERCEPT_THR_EXIT;
 
+  LSAN_MAYBE_INTERCEPT_STRERROR;
+
 #if !SANITIZER_NETBSD && !SANITIZER_FREEBSD
   if (pthread_key_create(&g_thread_finalize_key, &thread_finalize)) {
 Report("LeakSanitizer: failed to create thread key.\n");

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1.9 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1.10
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1.9	Sat Sep  5 09:12:32 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc	Fri Sep 11 01:03:31 2020
@@ -35,6 +35,7 @@
 //   COMMON_INTERCEPTOR_MMAP_IMPL
 //   COMMON_INTERCEPTOR_COPY_STRING
 //   COMMON_INTERCEPTOR_STRNDUP_IMPL
+//   COMMON_INTERCEPTOR_STRERROR
 //===--===//
 
 #include "interception/interception.h"
@@ -290,6 +291,10 @@ bool PlatformHasDifferentMemcpyAndMemmov
   return new_mem;
 #endif
 
+#ifndef COMMON_INTERCEPTOR_STRERROR
+#define COMMON_INTERCEPTOR_STRERROR() {}
+#endif
+
 struct FileMetadata {
   // For open_memstream().
   char **addr;
@@ -3631,6 +3636,7 @@ INTERCEPTOR(int, sched_getparam, int pid
 INTERCEPTOR(char *, strerror, int errnum) {
   void *ctx;
   COMMON_INTERCEPTOR_ENTER(ctx, strerror, errnum);
+  COMMON_INTERCEPTOR_STRERROR();
   char *res = REAL(strerror)(e

CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:01:14 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_stoptheworld_linux_libcdep.cc

Log Message:
Disable sanitizer_stoptheworld_linux_libcdep.cc for NetBSD


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc

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/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.11 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.12
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.11	Sat Sep  5 09:12:32 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc	Fri Sep 11 01:01:14 2020
@@ -12,7 +12,7 @@
 
 #include "sanitizer_platform.h"
 
-#if (SANITIZER_LINUX || SANITIZER_NETBSD) && \
+#if SANITIZER_LINUX && \
 		   (defined(__x86_64__) || defined(__mips__) || \
 defined(__aarch64__) || defined(__powerpc64__) || \
 defined(__s390__) || defined(__i386__) || \



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2020-09-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep  7 22:21:55 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd64.h

Log Message:
use the generic ppc64 LINK_GCC_C_SEQUENCE_SPEC.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.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/dist/gcc/config/rs6000/netbsd64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.25 src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.26
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.25	Wed Nov  6 09:10:50 2019
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h	Mon Sep  7 22:21:55 2020
@@ -584,9 +584,6 @@ extern int dot_symbols;
 #undef DRAFT_V4_STRUCT_RET
 #define DRAFT_V4_STRUCT_RET (!TARGET_64BIT)
 
-#define LINK_GCC_C_SEQUENCE_SPEC \
-  "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
-
 /* Use --as-needed -lgcc_s for eh support.  */
 #ifdef HAVE_LD_AS_NEEDED
 #define USE_LD_AS_NEEDED 1



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep  7 07:10:43 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux_libcdep.cc

Log Message:
avoid returning stack garbage on platforms that don't have either
__lwp_gettcb_fast() or __lwp_getprivate_fast().


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.14 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.15
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.14	Sun Sep  6 05:30:17 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc	Mon Sep  7 07:10:43 2020
@@ -417,7 +417,7 @@ uptr ThreadSelf() {
 
 #if SANITIZER_NETBSD
 static struct tls_tcb * ThreadSelfTlsTcb() {
-  struct tls_tcb * tcb;
+  struct tls_tcb * tcb = NULL;
 # ifdef __HAVE___LWP_GETTCB_FAST
   tcb = (struct tls_tcb *)__lwp_gettcb_fast();
 # elif defined(__HAVE___LWP_GETPRIVATE_FAST)



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep  7 00:22:51 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
fix for netbsd/mips.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.35 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.36
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.35	Sun Sep  6 10:55:16 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Mon Sep  7 00:22:51 2020
@@ -33,6 +33,7 @@
 // format. Struct kernel_stat is defined as 'struct stat' in asm/stat.h. To
 // access stat from asm/stat.h, without conflicting with definition in
 // sys/stat.h, we use this trick.
+#if SANITIZER_LINUX
 #if defined(__mips64)
 #include 
 #include 
@@ -40,6 +41,7 @@
 #include 
 #undef stat
 #endif
+#endif
 
 #if SANITIZER_NETBSD
 #include 
@@ -1848,7 +1850,12 @@ SignalContext::WriteFlag SignalContext::
   uint32_t faulty_instruction;
   uint32_t op_code;
 
+#if SANITIZER_NETBSD
+  ucontext_t *nucontext = (ucontext_t *)ucontext;
+  exception_source = (uint32_t *)_UC_MACHINE_PC(nucontext);
+#else
   exception_source = (uint32_t *)ucontext->uc_mcontext.pc;
+#endif
   faulty_instruction = (uint32_t)(*exception_source);
 
   op_code = (faulty_instruction >> 26) & 0x3f;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep  6 17:15:09 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_netbsd.cc

Log Message:
comment out ioctl that is only defined for the kernel


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.3 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.3	Sun Sep  6 06:55:16 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc	Sun Sep  6 13:15:09 2020
@@ -1774,8 +1774,10 @@ unsigned IOCTL_MTIOCSLOCATE = MTIOCSLOCA
 unsigned IOCTL_MTIOCHLOCATE = MTIOCHLOCATE;
 unsigned IOCTL_POWER_EVENT_RECVDICT = POWER_EVENT_RECVDICT;
 unsigned IOCTL_POWER_IOC_GET_TYPE = POWER_IOC_GET_TYPE;
+#if 0
 unsigned IOCTL_POWER_IOC_GET_TYPE_WITH_LOSSAGE =
 POWER_IOC_GET_TYPE_WITH_LOSSAGE;
+#endif
 unsigned IOCTL_RIOCGINFO = RIOCGINFO;
 unsigned IOCTL_RIOCSINFO = RIOCSINFO;
 unsigned IOCTL_RIOCSSRCH = RIOCSSRCH;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Sep  6 10:55:16 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc sanitizer_platform_limits_netbsd.cc

Log Message:
re-port to netbsd/sparc*
fix build on non-constant pagesize platforms and for dkbad.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.34 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.35
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.34	Sat Sep  5 13:35:55 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Sun Sep  6 10:55:16 2020
@@ -1908,8 +1908,10 @@ SignalContext::WriteFlag SignalContext::
   uptr pc = ucontext->uc_mcontext.gregs[REG_PC];
 # else
   // Historical BSDism here.
-  struct sigcontext *scontext = (struct sigcontext *)context;
-#  if defined(__arch64__)
+  struct sigcontext *scontext = (struct sigcontext *)ucontext;
+#  if SANITIZER_NETBSD
+  uptr pc = scontext->sc_pc;
+#  elif defined(__arch64__)
   uptr pc = scontext->sigc_regs.tpc;
 #  else
   uptr pc = scontext->si_regs.pc;

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.3
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.2	Sat Sep  5 13:35:55 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc	Sun Sep  6 10:55:16 2020
@@ -83,6 +83,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #define RAY_DO_SIGLEV
 #include 
@@ -103,7 +104,10 @@
 #include 
 #include 
 #include 
+/* XXX relies upon NBPG which is not always constant, or provided. */
+#ifdef NBPG
 #include 
+#endif
 #include 
 #include 
 #include 
@@ -620,7 +624,9 @@ unsigned struct_sppplcpcfg_sz = sizeof(s
 unsigned struct_spppstatus_sz = sizeof(spppstatus);
 unsigned struct_spppstatusncp_sz = sizeof(spppstatusncp);
 unsigned struct_srt_rt_sz = sizeof(srt_rt);
+#ifdef NBPG
 unsigned struct_stic_xinfo_sz = sizeof(stic_xinfo);
+#endif
 unsigned struct_sun_dkctlr_sz = sizeof(sun_dkctlr);
 unsigned struct_sun_dkgeom_sz = sizeof(sun_dkgeom);
 unsigned struct_sun_dkpart_sz = sizeof(sun_dkpart);
@@ -1183,10 +1189,12 @@ unsigned IOCTL_KIOCGLED = KIOCGLED;
 unsigned IOCTL_KIOCLAYOUT = KIOCLAYOUT;
 unsigned IOCTL_VUIDSFORMAT = VUIDSFORMAT;
 unsigned IOCTL_VUIDGFORMAT = VUIDGFORMAT;
+#ifdef NBPG
 unsigned IOCTL_STICIO_GXINFO = STICIO_GXINFO;
 unsigned IOCTL_STICIO_RESET = STICIO_RESET;
 unsigned IOCTL_STICIO_STARTQ = STICIO_STARTQ;
 unsigned IOCTL_STICIO_STOPQ = STICIO_STOPQ;
+#endif
 unsigned IOCTL_UKYOPON_IDENTIFY = UKYOPON_IDENTIFY;
 unsigned IOCTL_USB_REQUEST = USB_REQUEST;
 unsigned IOCTL_USB_SETDEBUG = USB_SETDEBUG;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Sep  6 05:30:17 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux_libcdep.cc

Log Message:
fix merge botch: netbsd doesn't want any of this.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.13 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.14
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.13	Sat Sep  5 13:35:55 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc	Sun Sep  6 05:30:17 2020
@@ -543,13 +543,15 @@ void GetThreadStackAndTls(bool main, upt
 #endif
 }
 
-#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+#if !SANITIZER_NETBSD
+#if !SANITIZER_FREEBSD && !SANITIZER_OPENBSD
 typedef ElfW(Phdr) Elf_Phdr;
 #elif SANITIZER_WORDSIZE == 32 && __FreeBSD_version <= 902001 // v9.2
 #define Elf_Phdr XElf32_Phdr
 #define dl_phdr_info xdl_phdr_info
 #define dl_iterate_phdr(c, b) xdl_iterate_phdr((c), (b))
 #endif // !SANITIZER_FREEBSD && !SANITIZER_OPENBSD
+#endif // !SANITIZER_NETBSD
 
 struct DlIteratePhdrData {
   InternalMmapVectorNoCtor *modules;



CVS commit: src/external/gpl3/gcc/dist/gcc

2020-09-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Sep  5 22:41:17 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
don't include vxworks-dummy.h twice


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/external/gpl3/gcc/dist/gcc/config.gcc

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/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.64 src/external/gpl3/gcc/dist/gcc/config.gcc:1.65
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.64	Sat Sep  5 09:12:23 2020
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Sat Sep  5 22:41:17 2020
@@ -1209,7 +1209,7 @@ arm*-*-netbsdelf*)
 	with_cpu=${with_cpu:-strongarm}
 	;;
 	esac
-	tm_file="${tm_file} vxworks-dummy.h arm/arm.h"
+	tm_file="${tm_file} arm/arm.h"
 	case ${target} in
 	arm*-*-netbsdelf-*eabihf*)
 	tm_defines="${tm_defines} TARGET_DEFAULT_FLOAT_ABI=ARM_FLOAT_ABI_HARD"



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Sep  5 13:35:55 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc sanitizer_linux.h sanitizer_linux_libcdep.cc
sanitizer_platform_limits_netbsd.cc sanitizer_syscall_generic.inc

Log Message:
fix various merge botches; we may need to re-port the ThreadLister code.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h
cvs rdiff -u -r1.12 -r1.13 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
cvs rdiff -u -r1.1.1.2 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
cvs rdiff -u -r1.8 -r1.9 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc

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/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.33 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.34
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.33	Sat Sep  5 09:12:32 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Sat Sep  5 13:35:55 2020
@@ -41,8 +41,6 @@
 #undef stat
 #endif
 
-#endif // SANITIZER_LINUX
-
 #if SANITIZER_NETBSD
 #include 
 #endif
@@ -980,7 +978,6 @@ ThreadLister::ThreadLister(pid_t pid) : 
   if (internal_iserror(descriptor_)) {
 Report("Can't open /proc/%d/task for reading.\n", pid);
   }
-#endif
 }
 
 ThreadLister::Result ThreadLister::ListThreads(
@@ -1055,10 +1052,8 @@ bool ThreadLister::IsAlive(int tid) {
 }
 
 ThreadLister::~ThreadLister() {
-#ifndef SANITIZER_NETBSD
   if (!internal_iserror(descriptor_))
 internal_close(descriptor_);
-#endif
 }
 #endif
 

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.9 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.10
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.9	Sat Sep  5 09:12:32 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h	Sat Sep  5 13:35:55 2020
@@ -69,6 +69,8 @@ uptr internal_clone(int (*fn)(void *), v
 #endif
 #elif SANITIZER_FREEBSD
 void internal_sigdelset(__sanitizer_sigset_t *set, int signum);
+#elif SANITIZER_NETBSD
+uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5);
 #endif  // SANITIZER_LINUX
 
 #ifdef SANITIZER_NETBSD

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.12 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.13
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.12	Sat Sep  5 09:12:32 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc	Sat Sep  5 13:35:55 2020
@@ -72,6 +72,10 @@ struct __sanitizer::linux_dirent {
 #include 
 #endif
 
+#if SANITIZER_NETBSD
+#include 
+#endif
+
 namespace __sanitizer {
 
 SANITIZER_WEAK_ATTRIBUTE int

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.1.1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.1.1.2	Sat Sep  5 07:52:57 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc	Sat Sep  5 13:35:55 2020
@@ -35,7 +35,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -48,7 +47,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -73,6 +71,7 @@
 #include 
 #include 
 #include 
+#undef INLINE
 #include 
 #include 
 #include 
@@ -106,7 +105,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -114,7 +112,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -122,6 +119,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -130,8 +128,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -347,8 +343,6 @@ unsigned struct_apm_power_info_sz = size
 unsigned struct_atabusiodetach_args_sz = size

CVS commit: src/external/gpl3/gcc/dist

2020-09-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Sep  5 09:12:34 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist: LAST_UPDATED MD5SUMS NEWS config.guess
config.sub configure configure.ac
src/external/gpl3/gcc/dist/INSTALL: binaries.html build.html
configure.html download.html finalinstall.html gfdl.html index.html
old.html prerequisites.html specific.html test.html
src/external/gpl3/gcc/dist/config: tls.m4
src/external/gpl3/gcc/dist/fixincludes: configure
src/external/gpl3/gcc/dist/gcc: ChangeLog Makefile.in alias.c
auto-profile.c builtins.c cfgexpand.c common.opt config.gcc
config.host configure configure.ac cppbuiltin.c cppdefault.c
debug.h diagnostic.c dse.c dwarf2out.c except.c expr.c
file-prefix-map.c file-prefix-map.h final.c gcc.c gcc.h
genattrtab.c genemit.c genmultilib genrecog.c ggc-common.c
gimplify.c graphite-isl-ast-to-gimple.c graphite.h hwint.h
ipa-inline.c ira-color.c opts-global.c opts.c output.h reload.c
reload1.c rtlanal.c system.h target-def.h targhooks.c toplev.c
tree-cfg.c tree-ssa-ccp.c var-tracking.c varasm.c
src/external/gpl3/gcc/dist/gcc/c: Make-lang.in
src/external/gpl3/gcc/dist/gcc/c-family: c-cppbuiltin.c c-format.c
c-format.h c-opts.c c.opt
src/external/gpl3/gcc/dist/gcc/common/config/aarch64: aarch64-common.c
src/external/gpl3/gcc/dist/gcc/common/config/arm: arm-common.c
src/external/gpl3/gcc/dist/gcc/common/config/riscv: riscv-common.c
src/external/gpl3/gcc/dist/gcc/config: freebsd-spec.h netbsd-elf.h
netbsd-stdint.h netbsd.h t-linux t-netbsd
src/external/gpl3/gcc/dist/gcc/config/aarch64: driver-aarch64.c
t-aarch64
src/external/gpl3/gcc/dist/gcc/config/alpha: alpha.h elf.h netbsd.h
t-alpha
src/external/gpl3/gcc/dist/gcc/config/arc: arc-modes.def arc-protos.h
arc.c arc.h arc.md arc.opt t-arc
src/external/gpl3/gcc/dist/gcc/config/arm: arm.c arm.h arm.md bpabi.h
elf.h freebsd.h netbsd-elf.h t-arm thumb2.md
src/external/gpl3/gcc/dist/gcc/config/i386: constraints.md cpuid.h
driver-i386.c i386-opts.h i386-protos.h i386.c i386.h i386.md
i386.opt netbsd-elf.h netbsd64.h pmm_malloc.h predicates.md
src/external/gpl3/gcc/dist/gcc/config/m68k: constraints.md m68k.c
m68k.md netbsd-elf.h
src/external/gpl3/gcc/dist/gcc/config/mips: mips.c netbsd.h t-mips
src/external/gpl3/gcc/dist/gcc/config/pa: pa.c pa.h
src/external/gpl3/gcc/dist/gcc/config/riscv: constraints.md elf.h
generic.md linux.h peephole.md predicates.md riscv-ftypes.def
riscv-modes.def riscv-protos.h riscv.c riscv.h riscv.md riscv.opt
sync.md
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd.h ppc-asm.h
rs6000.c sysv4.h t-netbsd t-rs6000 vxworksae.h
src/external/gpl3/gcc/dist/gcc/config/sh: netbsd-elf.h sh.c t-sh
src/external/gpl3/gcc/dist/gcc/config/sparc: constraints.md
netbsd-elf.h predicates.md sparc.md sync.md
src/external/gpl3/gcc/dist/gcc/config/vax: builtins.md constraints.md
elf.h netbsd-elf.h predicates.md vax-protos.h vax.c vax.h vax.md
src/external/gpl3/gcc/dist/gcc/cp: Make-lang.in cfns.gperf cfns.h
decl.c except.c
src/external/gpl3/gcc/dist/gcc/doc: cpp.1 cpp.texi cppenv.texi
cppinternals.info cppopts.texi extend.texi fsf-funding.7 g++.1
gcc.1 gccinstall.info gcov-tool.1 gcov.1 gcov.texi gfdl.7 gpl.7
invoke.texi
src/external/gpl3/gcc/dist/gcc/ginclude: stddef.h unwind-arm-common.h
src/external/gpl3/gcc/dist/gcc/objc: Make-lang.in
src/external/gpl3/gcc/dist/gcc/objcp: Make-lang.in
src/external/gpl3/gcc/dist/include: objalloc.h
src/external/gpl3/gcc/dist/intl: configure
src/external/gpl3/gcc/dist/libbacktrace: configure
src/external/gpl3/gcc/dist/libcpp: Makefile.in configure configure.ac
files.c init.c internal.h lex.c macro.c
src/external/gpl3/gcc/dist/libcpp/include: cpplib.h
src/external/gpl3/gcc/dist/libdecnumber: configure
src/external/gpl3/gcc/dist/libgcc: Makefile.in config.host configure
gthr-posix.h unwind-compat.c unwind-dw2-fde-dip.c unwind-dw2-fde.c
unwind-dw2.c unwind-generic.h unwind-seh.c unwind-sjlj.c
src/external/gpl3/gcc/dist/libgcc/config/alpha: qrnnd.S
src/external/gpl3/gcc/dist/libgcc/config/arm: pr-support.c
src/external/gpl3/gcc/dist/libgcc/config/c6x: pr-support.c
src/external/gpl3/gcc/dist/libgcc/config/cr16: unwind-cr16.c
src/external/gpl3/gcc/dist/libgcc/config/i386: morestack.S
src/external/gpl3/gcc/dist/libgcc/config/ia64: unwind-ia64.c
  

CVS commit: src/external/gpl3/gcc/dist/gcc

2020-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Aug 12 06:42:53 UTC 2020

Removed Files:
src/external/gpl3/gcc/dist/gcc: gengtype-lex.c

Log Message:
delete this file; it needs to be newer than the .l file or
else sys.mk will attempt to write it to the source tree,
which may be r/o and fail.

XXX may cause updates builds to fail because a file listed
in .depend won't exist anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r0 src/external/gpl3/gcc/dist/gcc/gengtype-lex.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/m68k

2020-08-09 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Aug 10 06:24:39 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/m68k: netbsd-elf.h

Log Message:
PR port-m68k/6

Reset STACK_BOUNDARY to default, 16, to fix strange freeze for amiga,
when kernel is compiled by GCC8.

For m68k, the stack pointer is required to be aligned to 16-bit boundary
by architecture. Whereas System V ABI demands it to be aligned to 32-bit
boundary.

According to the document, STACK_BOUNDARY is ``the minimum alignment
enforced by hardware for the stack pointer on this machine.'' Whereas,
PREFERRED_STACK_BOUNDARY should be used ``if you wish to preserve a
certain alignment for the stack pointer, greater than what the hardware
enforces.''

Therefore, STACK_BOUNDARY and PREFERRED_STACK_BOUNDARY should be 16 and
32, respectively, for m68k. This is how Linux/m68k does.

GCC 8 generates codes that wisely allocate 64-bit objects on stack by
using STACK_BOUNDARY. This corrupts the stack frame if it is not properly
aligned.

Since the architecture only guarantees the stack pointer to be aligned to
16-bit boundary, it is not aligned to 32-bit boundary in an instance in
general. If the interrupt occurs at this moment, the interrupt handler
spoils the stack frame as explained above, which results in the mysterious
kernel freezes.

I guess that similar failures can occur even for userland with signal.

With this setting, amiga kernel works just fine as far as I can see.
Furthermore, I've confirmed for amiga, mac68k, and sun3,

(1)   Kernel compiled by patched GCC8 works with
(1-a) userland built by GCC7 and non-modified GCC8, and
(1-b) userland built by patched GCC8.

(2)   Userland binaries compiled by GCC7 and non-modified GCC8 work fine
  with kernel and base libraries built by patched GCC8.

(3)   There's no regression observed for tests/kernel, tests/lib/libc/sys,
  and tests/lib/libc/gen.

This also fixes sun2 kernel to a considerable extent. With non-modified
GCC8, sun2 kernel crashes in strange ways during the early boot stages.
With this change, it boots singleuser.

OK mrg


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.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/dist/gcc/config/m68k/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.15 src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.16
--- src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h:1.15	Tue Oct  1 10:38:18 2019
+++ src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h	Mon Aug 10 06:24:39 2020
@@ -292,8 +292,6 @@ while (0)
 /* Boundary (in *bits*) on which stack pointer should be aligned.
The m68k/SVR4 convention is to keep the stack pointer longword aligned.  */
 
-#undef STACK_BOUNDARY
-#define STACK_BOUNDARY 32
 #undef PREFERRED_STACK_BOUNDARY
 #define PREFERRED_STACK_BOUNDARY 32
 



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2020-05-18 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon May 18 21:28:10 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: driver-aarch64.c

Log Message:
fix build on netbsd-9 hosts.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c

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/dist/gcc/config/aarch64/driver-aarch64.c
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.7 src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.8
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.7	Tue Apr 28 03:00:23 2020
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c	Mon May 18 21:28:10 2020
@@ -365,6 +365,7 @@ host_detect_local_cpu (int argc, const c
 	{
 	  exts += "asimd ";
 	}
+#ifdef ID_AA64ISAR0_EL1_RDM
   if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_RDM) == ID_AA64ISAR0_EL1_RDM_SQRDML)
 	{
 	  exts += "asimdrdm ";
@@ -377,6 +378,7 @@ host_detect_local_cpu (int argc, const c
 	{
 	  exts += "asimdfml ";
 	}
+#endif
   if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_AES) == ID_AA64ISAR0_EL1_AES_AES)
 	{
 	  exts += "aes ";
@@ -389,10 +391,12 @@ host_detect_local_cpu (int argc, const c
 	{
 	  exts += "crc32 ";
 	}
+#ifdef ID_AA64ISAR0_EL1_ATOMIC
   if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_ATOMIC) == ID_AA64ISAR0_EL1_ATOMIC_SWP)
 	{
 	  exts += "atomics ";
 	}
+#endif
   if ((__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_SHA1) & ID_AA64ISAR0_EL1_SHA1_SHA1CPMHSU) != 0)
 	{
 	  exts += "sha1 ";
@@ -401,6 +405,7 @@ host_detect_local_cpu (int argc, const c
 	{
 	  exts += "sha2 ";
 	}
+#ifdef ID_AA64ISAR0_EL1_SHA2_SHA512HSU
   if ((__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_SHA2) & ID_AA64ISAR0_EL1_SHA2_SHA512HSU) != 0)
 	{
 	  exts += "sha512 ";
@@ -425,6 +430,7 @@ host_detect_local_cpu (int argc, const c
 	{
 	  exts += "lrcpc ";
 	}
+#endif
 
 	  strncpy(buf, exts.c_str(), sizeof(buf) - 1);
 	  buf[sizeof(buf) - 1] = '\0';



CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2020-04-27 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr 28 03:00:23 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/aarch64: driver-aarch64.c

Log Message:
slightly reduce the scope of #ifdef __NetBSD__ version of the
-m{cpu,tune,arch}=native handling code, and hopefully reduce
future effort by aligning inputs

- share common variables and setup more
- build a linux/arm64 like /proc/cpuinfo Features line and
  use that to match the new 'list of features' per gcc feature,
  based upon our sysctl(2) published info.  complete this list
  for all supported extensions.

now this feature works again.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c

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/dist/gcc/config/aarch64/driver-aarch64.c
diff -u src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.6 src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.7
--- src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c:1.6	Wed Mar 11 08:29:45 2020
+++ src/external/gpl3/gcc/dist/gcc/config/aarch64/driver-aarch64.c	Tue Apr 28 03:00:23 2020
@@ -191,8 +191,6 @@ host_detect_local_cpu (int argc, const c
   unsigned long default_flags = 0;
   FILE *f = NULL;
 
-#ifndef __NetBSD__
-
   gcc_assert (argc);
 
   if (!argv[0])
@@ -209,6 +207,8 @@ host_detect_local_cpu (int argc, const c
   if (!arch && !tune && !cpu)
 goto not_found;
 
+#ifndef __NetBSD__
+
   f = fopen ("/proc/cpuinfo", "r");
 
   if (f == NULL)
@@ -308,22 +308,6 @@ host_detect_local_cpu (int argc, const c
   char impl_buf[8];
   int mib[2], ncpu;
 
-  gcc_assert (argc);
-
-  if (!argv[0])
-goto not_found;
-
-  /* Are we processing -march, mtune or mcpu?  */
-  arch = strcmp (argv[0], "arch") == 0;
-  if (!arch)
-tune = strcmp (argv[0], "tune") == 0;
-
-  if (!arch && !tune)
-cpu = strcmp (argv[0], "cpu") == 0;
-
-  if (!arch && !tune && !cpu)
-goto not_found;
-
   mib[0] = CTL_HW;
   mib[1] = HW_NCPU; 
   len = sizeof(ncpu);
@@ -370,29 +354,112 @@ host_detect_local_cpu (int argc, const c
 
   if (!tune && !processed_exts)
 {
+  std::string exts;
+
+	  /* These are all the extensions from aarch64-option-extensions.def.  */
+  if (__SHIFTOUT(id.ac_aa64pfr0, ID_AA64PFR0_EL1_FP) == ID_AA64PFR0_EL1_FP_IMPL)
+	{
+	  exts += "fp ";
+	}
+  if (__SHIFTOUT(id.ac_aa64pfr0, ID_AA64PFR0_EL1_ADVSIMD) == ID_AA64PFR0_EL1_ADV_SIMD_IMPL)
+	{
+	  exts += "asimd ";
+	}
+  if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_RDM) == ID_AA64ISAR0_EL1_RDM_SQRDML)
+	{
+	  exts += "asimdrdm ";
+	}
+  if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_DP) == ID_AA64ISAR0_EL1_DP_UDOT)
+	{
+	  exts += "asimddp ";
+	}
+  if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_FHM) == ID_AA64ISAR0_EL1_FHM_FMLAL)
+	{
+	  exts += "asimdfml ";
+	}
+  if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_AES) == ID_AA64ISAR0_EL1_AES_AES)
+	{
+	  exts += "aes ";
+	}
+  if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_AES) == ID_AA64ISAR0_EL1_AES_PMUL)
+	{
+	  exts += "aes pmull ";
+	}
+  if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_CRC32) == ID_AA64ISAR0_EL1_CRC32_CRC32X)
+	{
+	  exts += "crc32 ";
+	}
+  if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_ATOMIC) == ID_AA64ISAR0_EL1_ATOMIC_SWP)
+	{
+	  exts += "atomics ";
+	}
+  if ((__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_SHA1) & ID_AA64ISAR0_EL1_SHA1_SHA1CPMHSU) != 0)
+	{
+	  exts += "sha1 ";
+	}
+  if ((__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_SHA2) & ID_AA64ISAR0_EL1_SHA2_SHA256HSU) != 0)
+	{
+	  exts += "sha2 ";
+	}
+  if ((__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_SHA2) & ID_AA64ISAR0_EL1_SHA2_SHA512HSU) != 0)
+	{
+	  exts += "sha512 ";
+	}
+  if ((__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_SHA3) & ID_AA64ISAR0_EL1_SHA3_EOR3) != 0)
+	{
+	  exts += "sha3 ";
+	}
+  if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_SM3) == ID_AA64ISAR0_EL1_SM3_SM3)
+	{
+	  exts += "sm3 ";
+	}
+  if (__SHIFTOUT(id.ac_aa64isar0, ID_AA64ISAR0_EL1_SM4) == ID_AA64ISAR0_EL1_SM4_SM4)
+	{
+	  exts += "sm4 ";
+	}
+  if (__SHIFTOUT(id.ac_aa64pfr0, ID_AA64PFR0_EL1_SVE) == ID_AA64PFR0_EL1_SVE_IMPL)
+	{
+	  exts += "sve ";
+	}
+  if (__SHIFTOUT(id.ac_aa64isar1, ID_AA64ISAR1_EL1_LRCPC) == ID_AA64ISAR1_EL1_LRCPC_PR)
+	{
+	  exts += "lrcpc ";
+	}
+
+	  strncpy(buf, exts.c_str(), sizeof(buf) - 1);
+	  buf[sizeof(buf) - 1] = '\0';
+
   for (i = 0; i < num_exts; i++)
 {
-  bool enabled;
+	  const char *p = aarch64_extensions[

CVS commit: src/external/gpl3/gcc/dist/gcc/config

2020-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 26 21:11:07 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc/config: netbsd-elf.h

Log Message:
Fix -static -pie to be -static *and* -pie. Before it was just -static:
- Restructure the begin and end code so the top level conditional is "pie".
  There is no change for the end code, but we use crtbeginS for static pie.
- If -pie is specified, always pass it to the linker (otherwise we end up
  with non pie binaries).
- Remove an extra unneeded space in the shared linker definition.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/gpl3/gcc/dist/gcc/config/netbsd-elf.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/dist/gcc/config/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h:1.17 src/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h:1.18
--- src/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h:1.17	Tue Oct  1 06:38:17 2019
+++ src/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h	Sun Apr 26 17:11:07 2020
@@ -39,12 +39,12 @@ along with GCC; see the file COPYING3.  
%{p:gcrt0%O%s}		\
%{!p:crt0%O%s}}}		\
%:if-exists(crti%O%s)	\
-   %{static:%:if-exists-else(crtbeginT%O%s crtbegin%O%s)} \
-   %{!static:   \
- %{!shared: \
-   %{!pie:crtbegin%O%s} \
-   %{pie:crtbeginS%O%s}}\
- %{shared:crtbeginS%O%s}}"
+   %{pie:crtbeginS%O%s}		\
+   %{!pie:			\
+ %{static:%:if-exists-else(crtbeginT%O%s crtbegin%O%s)} \
+ %{!static: \
+   %{shared:crtbeginS%O%s}	\
+   %{!shared:crtbegin%O%s}}}"
 
 #undef STARTFILE_SPEC
 #define STARTFILE_SPEC NETBSD_STARTFILE_SPEC
@@ -55,10 +55,10 @@ along with GCC; see the file COPYING3.  
C++ file-scope static objects deconstructed after exiting "main".  */
 
 #define NETBSD_ENDFILE_SPEC	\
-  "%{!shared:   \
-%{!pie:crtend%O%s}  \
-%{pie:crtendS%O%s}} \
-   %{shared:crtendS%O%s}\
+  "%{pie:crtendS%O%s}		\
+   %{!pie:			\
+ %{shared:crtendS%O%s}	\
+ %{!shared:crtend%O%s}}	\
%:if-exists(crtn%O%s)"
 
 #undef ENDFILE_SPEC
@@ -85,11 +85,12 @@ along with GCC; see the file COPYING3.  
  %{!nostdlib: \
%{!r: \
 	 %{!e*:-e %(netbsd_entry_point)}}} \
+ %{pie:-pie} \
  %{!static: \
%{rdynamic:-export-dynamic} \
%(netbsd_link_ld_elf_so)} \
  %{static:-static \
-   %{pie: --no-dynamic-linker}}} \
+   %{pie:--no-dynamic-linker}}} \
%{!shared:%{!nostdlib:%{!nodefaultlibs:\
  %{%:sanitize(address): -lasan } \
  %{%:sanitize(undefined): -lubsan"



CVS commit: src/external/gpl3/gcc/dist/gcc/common/config/aarch64

2020-04-20 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Apr 20 21:57:22 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc/common/config/aarch64: aarch64-common.c

Log Message:
when sorting all_extensions_by_on[] be sure to keep the NULL
entry last.  correct the sizeof() to use the right variable
(they were the same size at least.)  as-was, with the NULL
entry first, all loops across this array were no-ops.

this should fix PR#55158's arm64 side.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.6 -r1.2 \
src/external/gpl3/gcc/dist/gcc/common/config/aarch64/aarch64-common.c

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/dist/gcc/common/config/aarch64/aarch64-common.c
diff -u src/external/gpl3/gcc/dist/gcc/common/config/aarch64/aarch64-common.c:1.1.1.6 src/external/gpl3/gcc/dist/gcc/common/config/aarch64/aarch64-common.c:1.2
--- src/external/gpl3/gcc/dist/gcc/common/config/aarch64/aarch64-common.c:1.1.1.6	Wed Mar 11 08:16:31 2020
+++ src/external/gpl3/gcc/dist/gcc/common/config/aarch64/aarch64-common.c	Mon Apr 20 21:57:22 2020
@@ -285,9 +285,9 @@ aarch64_option_init_struct (struct gcc_o
to calculate the feature strings is called on every options push,
pop and attribute change (arm_neon headers, lto etc all cause this to
happen quite frequently).  It is a trade-off between time and space and
-   so time won.  */
+   so time won.  Keep NULL entry last.  */
 int n_extensions
-  = sizeof (all_extensions) / sizeof (struct aarch64_option_extension);
+  = sizeof (all_extensions_by_on) / sizeof (all_extensions_by_on[0]) - 1;
 qsort (&all_extensions_by_on, n_extensions,
 	   sizeof (struct aarch64_option_extension), opt_ext_cmp);
 }



CVS commit: src/external/gpl3/gcc/dist/gcc

2020-04-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Apr  8 06:49:28 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc: gimplify.c

Log Message:
Pull in https://gcc.gnu.org/g:3d947f1f27188e3a61ba7f42399b1c348469fe13

middle-end/94479 - fix gimplification of address

When gimplifying an address operand we may expose an indirect
ref via DECL_VALUE_EXPR for example.  This is dealt with in the
code already but it fails to consider that INDIRECT_REFs get
gimplified to MEM_REFs.

Fixed which makes the ICE observed on x86_64-netbsd go away.

2020-04-07  Richard Biener  

PR middle-end/94479
* gimplify.c (gimplify_addr_expr): Also consider generated
MEM_REFs.

* gcc.dg/torture/pr94479.c: New testcase.

Fixes -fstack-check ICE when building devel/git-base.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.12 -r1.2 src/external/gpl3/gcc/dist/gcc/gimplify.c

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/dist/gcc/gimplify.c
diff -u src/external/gpl3/gcc/dist/gcc/gimplify.c:1.1.1.12 src/external/gpl3/gcc/dist/gcc/gimplify.c:1.2
--- src/external/gpl3/gcc/dist/gcc/gimplify.c:1.1.1.12	Wed Mar 11 08:16:14 2020
+++ src/external/gpl3/gcc/dist/gcc/gimplify.c	Wed Apr  8 06:49:28 2020
@@ -6072,7 +6072,9 @@ gimplify_addr_expr (tree *expr_p, gimple
 
   /* For various reasons, the gimplification of the expression
 	 may have made a new INDIRECT_REF.  */
-  if (TREE_CODE (op0) == INDIRECT_REF)
+  if (TREE_CODE (op0) == INDIRECT_REF
+ || (TREE_CODE (op0) == MEM_REF
+ && integer_zerop (TREE_OPERAND (op0, 1
 	goto do_indirect_ref;
 
   mark_addressable (TREE_OPERAND (expr, 0));



CVS commit: src/external/gpl3/gcc/dist/gcc/doc

2020-03-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Mar 11 08:44:33 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc/doc: cpp.info cppinternals.info g++.1
gcc.1 gcc.info gccinstall.info gccint.info

Log Message:
regen for GCC 8.4.0.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gcc/dist/gcc/doc/cpp.info \
src/external/gpl3/gcc/dist/gcc/doc/gcc.info
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gcc/dist/gcc/doc/cppinternals.info \
src/external/gpl3/gcc/dist/gcc/doc/g++.1 \
src/external/gpl3/gcc/dist/gcc/doc/gcc.1 \
src/external/gpl3/gcc/dist/gcc/doc/gccinstall.info \
src/external/gpl3/gcc/dist/gcc/doc/gccint.info

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

diffs are larger than 1MB and have been omitted


CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2020-01-22 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jan 22 21:39:43 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd.h

Log Message:
Do not override STACK_BOUNDARY in netbsd.h

sysv4.h already overrides PREFERRED_STACK_BOUNDARY b/c SYSV ABI
requires 16 bytes alignment for %sp anyway and so we already get that
for free.

More importantly this also fixes alloca() in GCC 8, that was somehow
confused by that STACK_BOUNDARY value we had and created a buffer that
overlapped top local variable slots.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd.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/dist/gcc/config/rs6000/netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd.h:1.14 src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd.h:1.15
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd.h:1.14	Tue Oct  1 10:38:19 2019
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd.h	Wed Jan 22 21:39:43 2020
@@ -138,10 +138,6 @@
 #define TRAMPOLINE_SIZE 48
 #endif
 
-/* Override STACK_BOUNDARY to use Altivec compliant one.  */
-#undef STACK_BOUNDARY
-#define STACK_BOUNDARY	128
-
 /* Use standard DWARF numbering for DWARF debugging information.  */
 #define RS6000_USE_DWARF_NUMBERING
 



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-04-26 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr 27 00:23:18 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Backport improvements into GCC's sanitizer_linux.cc from more recent LLVM

Backport fixups for syscall()/__syscall() routines from LLVM compiler-rt
dated October 1st 2018. The commit beffore switching LLVM compiler-rt
sycall calls to libc calls for NetBSD.

GCC8 will get part of these changes from upstream and GCC9 will operate on
libc calls directly for the NetBSD port.

This is intended to correct misuse of parameters of syscall()/__syscall()
that could break !x86 ports in UBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.29 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.30
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.29	Tue Apr 16 07:34:54 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Sat Apr 27 00:23:17 2019
@@ -42,6 +42,10 @@
 
 #endif // !SANITIZER_FREEBSD && !SANITIZER_NETBSD
 
+#if SANITIZER_NETBSD
+#include 
+#endif
+
 #include 
 #include 
 #include 
@@ -74,6 +78,8 @@ extern char **environ;  // provided by c
 #if SANITIZER_NETBSD
 #include 	// For NAME_MAX
 #include 
+#include 
+extern struct ps_strings *__ps_strings;
 extern char **environ;  // provided by crt1
 #endif  // SANITIZER_NETBSD
 
@@ -147,11 +153,11 @@ uptr internal_mmap(void *addr, uptr leng
 #endif // !SANITIZER_S390
 
 uptr internal_munmap(void *addr, uptr length) {
-  return internal_syscall(SYSCALL(munmap), (uptr)addr, length);
+  return internal_syscall_ptr(SYSCALL(munmap), (uptr)addr, length);
 }
 
 int internal_mprotect(void *addr, uptr length, int prot) {
-  return internal_syscall(SYSCALL(mprotect), (uptr)addr, length, prot);
+  return internal_syscall_ptr(SYSCALL(mprotect), (uptr)addr, length, prot);
 }
 
 uptr internal_close(fd_t fd) {
@@ -162,7 +168,7 @@ uptr internal_open(const char *filename,
 #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
   return internal_syscall(SYSCALL(openat), AT_FDCWD, (uptr)filename, flags);
 #else
-  return internal_syscall(SYSCALL(open), (uptr)filename, flags);
+  return internal_syscall_ptr(SYSCALL(open), (uptr)filename, flags);
 #endif
 }
 
@@ -171,7 +177,7 @@ uptr internal_open(const char *filename,
   return internal_syscall(SYSCALL(openat), AT_FDCWD, (uptr)filename, flags,
   mode);
 #else
-  return internal_syscall(SYSCALL(open), (uptr)filename, flags, mode);
+  return internal_syscall_ptr(SYSCALL(open), (uptr)filename, flags, mode);
 #endif
 }
 
@@ -200,7 +206,7 @@ uptr internal_write(fd_t fd, const void 
 uptr internal_ftruncate(fd_t fd, uptr size) {
   sptr res;
 #ifdef SANITIZER_NETBSD
-  HANDLE_EINTR(res, internal_syscall(SYSCALL(ftruncate), fd, 0, (s64)size));
+  HANDLE_EINTR(res, internal_syscall64(SYSCALL(ftruncate), fd, 0, (s64)size));
 #else
   HANDLE_EINTR(res, (sptr)internal_syscall(SYSCALL(ftruncate), fd,
(OFF_T)size));
@@ -250,7 +256,7 @@ static void kernel_stat_to_stat(struct k
 
 uptr internal_stat(const char *path, void *buf) {
 #if SANITIZER_FREEBSD || SANITIZER_NETBSD
-  return internal_syscall(SYSCALL(stat), path, buf);
+  return internal_syscall_ptr(SYSCALL(fstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0);
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
   return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path,
   (uptr)buf, 0);
@@ -274,7 +280,7 @@ uptr internal_stat(const char *path, voi
 
 uptr internal_lstat(const char *path, void *buf) {
 #if SANITIZER_FREEBSD || SANITIZER_NETBSD
-  return internal_syscall(SYSCALL(lstat), path, buf);
+  return internal_syscall_ptr(SYSCALL(lstat), path, buf);
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
   return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path,
  (uptr)buf, AT_SYMLINK_NOFOLLOW);
@@ -298,7 +304,7 @@ uptr internal_lstat(const char *path, vo
 
 uptr internal_fstat(fd_t fd, void *buf) {
 #if SANITIZER_FREEBSD || SANITIZER_NETBSD
-  return internal_syscall(SYSCALL(fstat), fd, (uptr)buf);
+  return internal_syscall_ptr(SYSCALL(fstat), fd, (uptr)buf);
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
   return = internal_syscall(SYSCALL(fstat), fd, &kbuf);
 #elif SANITIZER_LINUX_USES_64BIT_SYSCALLS
@@ -336,7 +342,7 @@ uptr internal_dup2(int oldfd, int newfd)
 
 uptr internal_readlink(const char *path, char *buf, uptr bufsize) {
 #if SANITIZER_NETBSD
-  return internal_syscall_ptr(SYSCALL(readlink), path, buf, bu

CVS commit: src/external/gpl3/gcc/dist/gcc/config/riscv

2019-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Apr 18 06:32:21 UTC 2019

Removed Files:
src/external/gpl3/gcc/dist/gcc/config/riscv: riscv-opc.h t-elf
t-linux64

Log Message:
delete files no longer present in GCC 7 port of riscv.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 \
src/external/gpl3/gcc/dist/gcc/config/riscv/riscv-opc.h
cvs rdiff -u -r1.2 -r0 src/external/gpl3/gcc/dist/gcc/config/riscv/t-elf \
src/external/gpl3/gcc/dist/gcc/config/riscv/t-linux64

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



CVS commit: src/external/gpl3/gcc/dist/libgcc

2019-04-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr 16 07:50:05 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libgcc: config.host
Added Files:
src/external/gpl3/gcc/dist/libgcc/config/riscv: t-netbsd

Log Message:
list a bunch of soft-fp as present in the current risc64 libgcc defs.mk.
this makes mknative-gcc work without breaking maya's manual work.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/external/gpl3/gcc/dist/libgcc/config.host
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gcc/dist/libgcc/config/riscv/t-netbsd

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/dist/libgcc/config.host
diff -u src/external/gpl3/gcc/dist/libgcc/config.host:1.23 src/external/gpl3/gcc/dist/libgcc/config.host:1.24
--- src/external/gpl3/gcc/dist/libgcc/config.host:1.23	Tue Apr  2 21:29:46 2019
+++ src/external/gpl3/gcc/dist/libgcc/config.host	Tue Apr 16 07:50:05 2019
@@ -1157,7 +1157,7 @@ riscv*-*-linux*)
 	md_unwind_header=riscv/linux-unwind.h
 	;;
 riscv*-*-netbsd*)
-	# nothing needed for NetBSD
+	tmake_file="${tmake_file} riscv/t-netbsd"
 	;;
 riscv*-*-*)
 	tmake_file="${tmake_file} riscv/t-softfp${host_address} t-softfp riscv/t-elf riscv/t-elf${host_address}"

Added files:

Index: src/external/gpl3/gcc/dist/libgcc/config/riscv/t-netbsd
diff -u /dev/null src/external/gpl3/gcc/dist/libgcc/config/riscv/t-netbsd:1.1
--- /dev/null	Tue Apr 16 07:50:05 2019
+++ src/external/gpl3/gcc/dist/libgcc/config/riscv/t-netbsd	Tue Apr 16 07:50:05 2019
@@ -0,0 +1,21 @@
+LIB2ADD += $(srcdir)/soft-fp/addtf3.c \
+	   $(srcdir)/soft-fp/divtf3.c \
+	   $(srcdir)/soft-fp/eqtf2.c \
+	   $(srcdir)/soft-fp/getf2.c \
+	   $(srcdir)/soft-fp/letf2.c \
+	   $(srcdir)/soft-fp/multf3.c \
+	   $(srcdir)/soft-fp/negtf2.c \
+	   $(srcdir)/soft-fp/subtf3.c \
+	   $(srcdir)/soft-fp/unordtf2.c \
+	   $(srcdir)/soft-fp/fixtfsi.c \
+	   $(srcdir)/soft-fp/fixunstfsi.c \
+	   $(srcdir)/soft-fp/floatsitf.c \
+	   $(srcdir)/soft-fp/floatunsitf.c \
+	   $(srcdir)/soft-fp/fixtfdi.c \
+	   $(srcdir)/soft-fp/fixunstfdi.c \
+	   $(srcdir)/soft-fp/floatditf.c \
+	   $(srcdir)/soft-fp/floatunditf.c \
+	   $(srcdir)/soft-fp/extendsftf2.c \
+	   $(srcdir)/soft-fp/extenddftf2.c \
+	   $(srcdir)/soft-fp/trunctfsf2.c \
+	   $(srcdir)/soft-fp/trunctfdf2.c



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2019-04-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr 16 07:36:55 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd64.h sysv4.h

Log Message:
avoid differences to linux64.h that aren't needed.
merge the rs6000_abi_name check for netbsd into the linux/freebsd section.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/sysv4.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/dist/gcc/config/rs6000/netbsd64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.21 src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.22
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.21	Wed Apr 10 20:06:26 2019
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h	Tue Apr 16 07:36:55 2019
@@ -87,17 +87,6 @@ extern int dot_symbols;
 
 #define ELFv2_ABI_CHECK (rs6000_elf_abi == 2)   
 
-#undef CC1_OS_NETBSD_SPEC
-#define CC1_OS_NETBSD_SPEC \
-  NETBSD_CC1_AND_CC1PLUS_SPEC \
-  "%{!m32: %{!mrelocatable: %{!fno-pie: %{!fno-pic: \
- %{!fpie: %{!fpic: \
-   %{!fPIE: %{!fPIC:-fPIC"
-/* %{!m32: %{!mcmodel*: -mcmodel=medium}}" */
-
-#undef CC1PLUS_SPEC
-#define CC1PLUS_SPEC CC1_OS_NETBSD_SPEC
-
 #undef	SUBSUBTARGET_OVERRIDE_OPTIONS
 #define	SUBSUBTARGET_OVERRIDE_OPTIONS\
   do\
@@ -181,17 +170,6 @@ extern int dot_symbols;
 }\
   while (0)
 
-#ifdef	RS6000_BI_ARCH
-
-#if 0
-#undef	OVERRIDE_OPTIONS
-#define	OVERRIDE_OPTIONS \
-  rs6000_override_options (((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \
-			   ? (char *) 0 : TARGET_CPU_DEFAULT)
-#endif
-
-#endif
-
 #undef	ASM_DEFAULT_SPEC
 #undef	ASM_SPEC
 #undef	LINK_OS_NETBSD_SPEC
@@ -263,6 +241,22 @@ extern int dot_symbols;
 
 #endif
 
+/* We use NetBSD libc _mcount for profiling.  */
+#define NO_PROFILE_COUNTERS 1
+#define PROFILE_HOOK(LABEL) \
+  do { if (TARGET_64BIT) output_profile_hook (LABEL); } while (0)
+
+/* PowerPC64 NetBSD word-aligns FP doubles when -malign-power is given.  */
+#undef  ADJUST_FIELD_ALIGN
+#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \
+  (rs6000_special_adjust_field_align_p ((TYPE), (COMPUTED))		\
+   ? 128\
+   : (TARGET_64BIT			\
+  && TARGET_ALIGN_NATURAL == 0	\
+  && TYPE_MODE (strip_array_types (TYPE)) == DFmode)		\
+   ? MIN ((COMPUTED), 32)		\
+   : (COMPUTED))
+
 /* PowerPC64 NetBSD increases natural record alignment to doubleword if
the first field is an FP double, only if in power alignment mode.  */
 #undef  ROUND_TYPE_ALIGN
@@ -305,8 +299,8 @@ extern int dot_symbols;
   (!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE))
 
 /* NetBSD doesn't support saving and restoring 64-bit regs in a 32-bit
-   process.  XXXMRG?  */
-#define OS_MISSING_POWERPC64 !TARGET_64BIT
+   process.  */
+#define OS_MISSING_POWERPC64 (!TARGET_64BIT)
 
 #undef  TARGET_OS_CPP_BUILTINS
 #define TARGET_OS_CPP_BUILTINS()			\
@@ -350,6 +344,17 @@ extern int dot_symbols;
 }		\
   while (0)
 
+#undef CC1_OS_NETBSD_SPEC
+#define CC1_OS_NETBSD_SPEC \
+  NETBSD_CC1_AND_CC1PLUS_SPEC \
+  "%{!m32: %{!mrelocatable: %{!fno-pie: %{!fno-pic: \
+ %{!fpie: %{!fpic: \
+   %{!fPIE: %{!fPIC:-fPIC"
+/* %{!m32: %{!mcmodel*: -mcmodel=medium}}" */
+
+#undef CC1PLUS_SPEC
+#define CC1PLUS_SPEC CC1_OS_NETBSD_SPEC
+
 #undef  CPP_OS_DEFAULT_SPEC
 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_netbsd)"
 
@@ -382,17 +387,6 @@ extern int dot_symbols;
 /* Use standard DWARF numbering for DWARF debugging information.  */
 #define RS6000_USE_DWARF_NUMBERING
 
-/* PowerPC64 NetBSD word-aligns FP doubles when -malign-power is given.  */
-#undef  ADJUST_FIELD_ALIGN
-#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \
-  (rs6000_special_adjust_field_align_p ((TYPE), (COMPUTED))		\
-   ? 128\
-   : (TARGET_64BIT  \
-  && TARGET_ALIGN_NATURAL == 0  \
-  && TYPE_MODE (strip_array_types (TYPE)) == DFmode)   		\
-   ? MIN ((COMPUTED), 32)   \
-   : (COMPUTED))
-
 #undef  TOC_SECTION_ASM_OP
 #define TOC_SECTION_ASM_OP \
   (TARGET_64BIT		\
@@ -601,4 +595,11 @@ extern int dot_symbols;
 /* NetBSD ppc64 has 128-bit long double support.  */
 #undef	RS6000_DEFAULT_LONG_DOUBLE_SIZE
 #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
+
 #define POWERPC_NETBSD
+
+/* The IEEE 128-bit emulator is only built on Linux systems.  Flag that we
+   should enable the type handling for KFmode on VSX systems even if we are not
+   enabling the __float128 keyword.  */
+#undef	TARGET_FLOAT128_ENABLE_TYPE
+#define TARGET_FLOAT128_ENABLE_TYPE 1

Index: src/external/gpl3/gcc/dist/gcc/config/rs

CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-04-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr 16 07:34:54 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
no clone() on netbsd.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.28 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.29
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.28	Tue Apr 16 01:40:16 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Tue Apr 16 07:34:54 2019
@@ -1182,7 +1182,7 @@ uptr internal_clone(int (*fn)(void *), v
: "x30", "memory");
   return res;
 }
-#elif defined(__powerpc64__)
+#elif defined(__powerpc64__) && SANITIZER_LINUX
 uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg,
int *parent_tidptr, void *newtls, int *child_tidptr) {
   long long res;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-04-15 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Apr 16 01:40:16 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Sync GetPcSpBp() with GCC9 (and recent LLVM)

Unify all NetBSD ports in a single ifdef.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.27 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.28
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.27	Mon Apr 15 15:58:23 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Tue Apr 16 01:40:16 2019
@@ -1402,51 +1402,39 @@ SignalContext::WriteFlag SignalContext::
 }
 
 void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {
-#if defined(__arm__)
-  ucontext_t *ucontext = (ucontext_t*)context;
-# if SANITIZER_NETBSD
+#if SANITIZER_NETBSD
+  // This covers all NetBSD architectures
+  ucontext_t *ucontext = (ucontext_t *)context;
   *pc = _UC_MACHINE_PC(ucontext);
+  *bp = _UC_MACHINE_FP(ucontext);
   *sp = _UC_MACHINE_SP(ucontext);
-  *bp = ucontext->uc_mcontext.__gregs[_REG_R11];
-# else
+#elif defined(__arm__)
+  ucontext_t *ucontext = (ucontext_t*)context;
   *pc = ucontext->uc_mcontext.arm_pc;
   *bp = ucontext->uc_mcontext.arm_fp;
   *sp = ucontext->uc_mcontext.arm_sp;
-# endif
 #elif defined(__aarch64__)
   ucontext_t *ucontext = (ucontext_t*)context;
-# if SANITIZER_NETBSD
-  *pc = _UC_MACHINE_PC(ucontext);
-  *sp = _UC_MACHINE_SP(ucontext);
-  *bp = ucontext->uc_mcontext.__gregs[29]; /* XXX */
-# else
   *pc = ucontext->uc_mcontext.pc;
   *bp = ucontext->uc_mcontext.regs[29];
   *sp = ucontext->uc_mcontext.sp;
-# endif
 #elif defined(__hppa__)
   ucontext_t *ucontext = (ucontext_t*)context;
-# if SANITIZER_NETBSD
-  *pc = _UC_MACHINE_PC(ucontext);
-  *sp = _UC_MACHINE_SP(ucontext);
-  *bp = ucontext->uc_mcontext.__gregs[3]; /* XXX */
-#else
   *pc = ucontext->uc_mcontext.sc_iaoq[0];
   /* GCC uses %r3 whenever a frame pointer is needed.  */
   *bp = ucontext->uc_mcontext.sc_gr[3];
   *sp = ucontext->uc_mcontext.sc_gr[30];
-# endif
 #elif defined(__x86_64__)
 # if SANITIZER_FREEBSD
   ucontext_t *ucontext = (ucontext_t*)context;
   *pc = ucontext->uc_mcontext.mc_rip;
   *bp = ucontext->uc_mcontext.mc_rbp;
   *sp = ucontext->uc_mcontext.mc_rsp;
-# elif SANITIZER_NETBSD
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.__gregs[_REG_RIP];
-  *bp = ucontext->uc_mcontext.__gregs[_REG_RBP];
-  *sp = ucontext->uc_mcontext.__gregs[_REG_RSP];
+#elif SANITIZER_OPENBSD
+  sigcontext *ucontext = (sigcontext *)context;
+  *pc = ucontext->sc_rip;
+  *bp = ucontext->sc_rbp;
+  *sp = ucontext->sc_rsp;
 # else
   ucontext_t *ucontext = (ucontext_t*)context;
   *pc = ucontext->uc_mcontext.gregs[REG_RIP];
@@ -1459,94 +1447,64 @@ void GetPcSpBp(void *context, uptr *pc, 
   *pc = ucontext->uc_mcontext.mc_eip;
   *bp = ucontext->uc_mcontext.mc_ebp;
   *sp = ucontext->uc_mcontext.mc_esp;
-# elif SANITIZER_NETBSD
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.__gregs[_REG_EIP];
-  *bp = ucontext->uc_mcontext.__gregs[_REG_EBP];
-  *sp = ucontext->uc_mcontext.__gregs[_REG_ESP];
-# else
-  ucontext_t *ucontext = (ucontext_t*)context;
+#elif SANITIZER_OPENBSD
+  sigcontext *ucontext = (sigcontext *)context;
+  *pc = ucontext->sc_eip;
+  *bp = ucontext->sc_ebp;
+  *sp = ucontext->sc_esp;
+# else
+  ucontext_t *ucontext = (ucontext_t*)context;
+# if SANITIZER_SOLARIS
+  /* Use the numeric values: the symbolic ones are undefined by llvm
+ include/llvm/Support/Solaris.h.  */
+# ifndef REG_EIP
+#  define REG_EIP 14 // REG_PC
+# endif
+# ifndef REG_EBP
+#  define REG_EBP  6 // REG_FP
+# endif
+# ifndef REG_ESP
+#  define REG_ESP 17 // REG_SP
+# endif
+# endif
   *pc = ucontext->uc_mcontext.gregs[REG_EIP];
   *bp = ucontext->uc_mcontext.gregs[REG_EBP];
   *sp = ucontext->uc_mcontext.gregs[REG_ESP];
 # endif
 #elif defined(__powerpc__) || defined(__powerpc64__)
   ucontext_t *ucontext = (ucontext_t*)context;
-# if SANITIZER_NETBSD
-  *pc = _UC_MACHINE_PC(ucontext);
-  *sp = _UC_MACHINE_SP(ucontext);
-  *bp = ucontext->uc_mcontext.__gregs[_REG_R31];
-#  else
   *pc = ucontext->uc_mcontext.regs->nip;
   *sp = ucontext->uc_mcontext.regs->gpr[PT_R1];
   // The powerpc{,64}-linux ABIs do not specify r31 as the frame
   // pointer, but GCC always uses r31 when we need a frame pointer.
   *bp = ucontext->uc_mcontext.regs->gpr[PT_R31];
-# endif
 #elif defined(__sparc__)
+# if defined(__arch64__) || defined(__sparcv9)
+#  define STACK_BIAS 2047

CVS commit: src/external/gpl3/gcc/dist/gcc/config/riscv

2019-04-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Apr 15 21:13:36 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/riscv: netbsd.h

Log Message:
Remove unused definition.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.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/dist/gcc/config/riscv/netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h:1.9 src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h:1.10
--- src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h:1.9	Mon Apr 15 18:49:07 2019
+++ src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h	Mon Apr 15 21:13:36 2019
@@ -20,9 +20,6 @@ along with this program; see the file CO
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-#undef TARGET_USE_GP
-#define TARGET_USE_GP 0
-
 #undef DRIVER_SELF_SPECS
 #define DRIVER_SELF_SPECS ""
 



CVS commit: src/external/gpl3/gcc/dist/gcc/config/riscv

2019-04-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Apr 15 18:49:07 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/riscv: netbsd.h

Log Message:
Re-do previous:
emulate the addition of NETBSD_SUBTARGET_EXTRA_SPECS usually done by
SUBTARGET_EXTRA_SPECS (not used in risc-v) with EXTRA_SPECS.
Go back to using %(netbsd_link_spec) in our link spec, now that it's
a valid string.

Try to mimic other riscv OSes in our LINK_SPEC. they all start with
"-melf" XLEN_SPEC "lriscv" LD_EMUL_SUFFIX

and a definition of LD_EMUL_SUFFIX,
let's copy the LD_EMUL_SUFFIX linux uses.

Now we can link executables.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.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/dist/gcc/config/riscv/netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h:1.8 src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h:1.9
--- src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h:1.8	Mon Apr 15 14:19:20 2019
+++ src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h	Mon Apr 15 18:49:07 2019
@@ -48,17 +48,20 @@ Boston, MA 02111-1307, USA.  */
 #undef LIB_SPEC
 #define LIB_SPEC NETBSD_LIB_SPEC
 
-#undef LINK_SPEC
-#define LINK_SPEC NETBSD_LINK_SPEC_ELF
-/* Provide a LINK_SPEC appropriate for a NetBSD/mips target.
-   This is a copy of LINK_SPEC from  tweaked for
-   the MIPS target.  */
+#define EXTRA_SPECS NETBSD_SUBTARGET_EXTRA_SPECS
+
+#define LD_EMUL_SUFFIX \
+  "%{mabi=lp64d:}" \
+  "%{mabi=lp64f:_lp64f}" \
+  "%{mabi=lp64:_lp64}" \
+  "%{mabi=ilp32d:}" \
+  "%{mabi=ilp32f:_ilp32f}" \
+  "%{mabi=ilp32:_ilp32}"
 
 #undef LINK_SPEC
-#define LINK_SPEC \
-  "%{m64:-m elf64lriscv} \
-   %{m32:-m elf32lriscv}" \
-   NETBSD_LINK_SPEC_ELF
+#define LINK_SPEC "\
+-melf" XLEN_SPEC "lriscv" LD_EMUL_SUFFIX " \
+%(netbsd_link_spec)"
 
 #undef NETBSD_ENTRY_POINT
 #define NETBSD_ENTRY_POINT	"_start"



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-04-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Apr 15 15:58:23 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Provide riscv implementation.

XXX this is MI, why not use it for everyone?


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.26 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.27
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.26	Tue Feb  5 12:56:43 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Mon Apr 15 15:58:23 2019
@@ -1542,6 +1542,11 @@ void GetPcSpBp(void *context, uptr *pc, 
   *pc = _UC_MACHINE_PC(ucontext);
   *sp = _UC_MACHINE_SP(ucontext);
   *bp = ucontext->uc_mcontext.__gregs[1];	/* XXX */
+#elif defined(__riscv) && SANITIZER_NETBSD
+  ucontext_t *ucontext = (ucontext_t*)context;
+  *pc = _UC_MACHINE_PC(ucontext);
+  *sp = _UC_MACHINE_SP(ucontext);
+  *bp = _UC_MACHINE_FP(ucontext);
 #elif defined(__s390__)
   ucontext_t *ucontext = (ucontext_t*)context;
 # if defined(__s390x__)



CVS commit: src/external/gpl3/gcc/dist/gcc/config/riscv

2019-04-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Apr 15 14:19:20 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/riscv: netbsd.h

Log Message:
don't redefine types.
UINTMAX_TYPE / INTMAX_TYPE are mostly not redefined on netbsd.
These choices contradict typical 64bit archs, perhaps we don't want them.

XXX is the SIZE_TYPE default for riscv reasonable?
(long unsigned int for 64bit abi, unsigned int for 32bit abi)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.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/dist/gcc/config/riscv/netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h:1.7 src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h:1.8
--- src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h:1.7	Sat Apr 13 15:53:32 2019
+++ src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h	Mon Apr 15 14:19:20 2019
@@ -62,12 +62,3 @@ Boston, MA 02111-1307, USA.  */
 
 #undef NETBSD_ENTRY_POINT
 #define NETBSD_ENTRY_POINT	"_start"
-
-#undef SIZE_TYPE
-#define SIZE_TYPE "long unsigned int"
-
-#undef INTMAX_TYPE
-#define INTMAX_TYPE "long long int"
-
-#undef UINTMAX_TYPE
-#define UINTMAX_TYPE "long long unsigned int"



CVS commit: src/external/gpl3/gcc/dist/gcc/config/riscv

2019-04-13 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Apr 13 15:53:32 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/riscv: netbsd.h

Log Message:
use NETBSD_LINK_SPEC_ELF rather than netbsd_link_spec.

My current guess as to why it makes a difference is that riscv, unlike other
targets, doesn't use the macro SUBTARGET_EXTRA_SPECS for anything meaningful

Fixes linking libgcc_s.so, which is now emitted as a dynamic library, not
a static object (which fails, as it has undefined references)

XXX there might be a better way of doing this


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.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/dist/gcc/config/riscv/netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h:1.6 src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h:1.7
--- src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h:1.6	Sun Feb 10 07:56:21 2019
+++ src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h	Sat Apr 13 15:53:32 2019
@@ -57,8 +57,8 @@ Boston, MA 02111-1307, USA.  */
 #undef LINK_SPEC
 #define LINK_SPEC \
   "%{m64:-m elf64lriscv} \
-   %{m32:-m elf32lriscv} \
-   %(netbsd_link_spec)"
+   %{m32:-m elf32lriscv}" \
+   NETBSD_LINK_SPEC_ELF
 
 #undef NETBSD_ENTRY_POINT
 #define NETBSD_ENTRY_POINT	"_start"



CVS commit: src/external/gpl3/gcc/dist/gcc/config/i386

2019-04-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Apr 11 00:17:44 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/i386: netbsd-elf.h netbsd64.h

Log Message:
be sure to keep cc1_cpu the CC1*_SPEC.

fixes x86 -mtune=native without killing -cxx-isystem.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h \
src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.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/dist/gcc/config/i386/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h:1.10 src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h:1.11
--- src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h:1.10	Sat Jan 19 12:10:06 2019
+++ src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h	Thu Apr 11 00:17:44 2019
@@ -41,6 +41,16 @@ along with GCC; see the file COPYING3.  
 #define CPP_SPEC "%(netbsd_cpp_spec)"
 
 
+/* Provide C11_SPEC/CC1PLUS_SPEC appropriate for NetBSD/i386.  */
+#define NETBSD_CC1_CPU_SPEC " %(cc1_cpu) "
+
+#undef CC1_SPEC
+#define CC1_SPEC NETBSD_CC1_AND_CC1PLUS_SPEC NETBSD_CC1_CPU_SPEC
+
+#undef CC1PLUS_SPEC
+#define CC1PLUS_SPEC NETBSD_CC1_AND_CC1PLUS_SPEC NETBSD_CC1_CPU_SPEC
+
+
 /* Make gcc agree with  */
 
 #undef SIZE_TYPE
Index: src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h:1.10 src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h:1.11
--- src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h:1.10	Sat Jan 19 12:10:06 2019
+++ src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h	Thu Apr 11 00:17:44 2019
@@ -44,6 +44,16 @@ along with GCC; see the file COPYING3.  
 #define CPP_SPEC "%(netbsd_cpp_spec)"
 
 
+/* Provide C11_SPEC/CC1PLUS_SPEC appropriate for NetBSD/x86-64.  */
+#define NETBSD_CC1_CPU_SPEC " %(cc1_cpu) "
+
+#undef CC1_SPEC
+#define CC1_SPEC NETBSD_CC1_AND_CC1PLUS_SPEC NETBSD_CC1_CPU_SPEC
+
+#undef CC1PLUS_SPEC
+#define CC1PLUS_SPEC NETBSD_CC1_AND_CC1PLUS_SPEC NETBSD_CC1_CPU_SPEC
+
+
 /* Output assembler code to FILE to call the profiler.  */
 
 #undef FUNCTION_PROFILER



CVS commit: src/external/gpl3/gcc/dist/gcc/config

2019-04-10 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Apr 10 20:06:26 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config: netbsd.h
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd64.h
src/external/gpl3/gcc/dist/gcc/config/sparc: netbsd-elf.h

Log Message:
revert previous


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/external/gpl3/gcc/dist/gcc/config/netbsd.h
cvs rdiff -u -r1.20 -r1.21 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h
cvs rdiff -u -r1.14 -r1.15 \
src/external/gpl3/gcc/dist/gcc/config/sparc/netbsd-elf.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/dist/gcc/config/netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.29 src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.30
--- src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.29	Wed Apr 10 16:11:06 2019
+++ src/external/gpl3/gcc/dist/gcc/config/netbsd.h	Wed Apr 10 20:06:26 2019
@@ -153,6 +153,16 @@ along with GCC; see the file COPYING3.  
 #define NETBSD_LIBGCC_SPEC "-lgcc"
 #endif
 
+/* Pass -cxx-isystem to cc1/cc1plus.  */
+#define NETBSD_CC1_AND_CC1PLUS_SPEC		\
+  "%{cxx-isystem}"
+
+#undef CC1_SPEC
+#define CC1_SPEC NETBSD_CC1_AND_CC1PLUS_SPEC
+
+#undef CC1PLUS_SPEC
+#define CC1PLUS_SPEC NETBSD_CC1_AND_CC1PLUS_SPEC
+
 #if defined(HAVE_LD_EH_FRAME_HDR)
 #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
 #endif

Index: src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.20 src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.21
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.20	Wed Apr 10 16:15:11 2019
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h	Wed Apr 10 20:06:26 2019
@@ -89,6 +89,7 @@ extern int dot_symbols;
 
 #undef CC1_OS_NETBSD_SPEC
 #define CC1_OS_NETBSD_SPEC \
+  NETBSD_CC1_AND_CC1PLUS_SPEC \
   "%{!m32: %{!mrelocatable: %{!fno-pie: %{!fno-pic: \
  %{!fpie: %{!fpic: \
%{!fPIE: %{!fPIC:-fPIC"

Index: src/external/gpl3/gcc/dist/gcc/config/sparc/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/sparc/netbsd-elf.h:1.14 src/external/gpl3/gcc/dist/gcc/config/sparc/netbsd-elf.h:1.15
--- src/external/gpl3/gcc/dist/gcc/config/sparc/netbsd-elf.h:1.14	Wed Apr 10 16:15:11 2019
+++ src/external/gpl3/gcc/dist/gcc/config/sparc/netbsd-elf.h	Wed Apr 10 20:06:26 2019
@@ -142,7 +142,8 @@ along with GCC; see the file COPYING3.  
 %{!mcpu*:%{!mv8plus:-mcpu=ultrasparc}} \
 %{!mno-vis:%{!mcpu=v9:-mvis}} \
 %{p:-mcmodel=medlow} \
-%{pg:-mcmodel=medlow}} "
+%{pg:-mcmodel=medlow}} " \
+  NETBSD_CC1_AND_CC1PLUS_SPEC
 
 #define CC1_SPEC64 \
  "%{m32:%{m64:%emay not use both -m32 and -m64}} \
@@ -152,7 +153,8 @@ along with GCC; see the file COPYING3.  
 %{!mcpu*:%{!mv8plus:-mcpu=cypress}}} \
   %{!m32: \
   %{p:-mcmodel=medlow} \
-  %{pg:-mcmodel=medlow}} "
+  %{pg:-mcmodel=medlow}} " \
+  NETBSD_CC1_AND_CC1PLUS_SPEC
 
 #if defined(SPARC_BI_ARCH) || defined(__arch64__)
 /* add code model specific object to the link line for 64bit */



CVS commit: src/external/gpl3/gcc/dist/gcc/config

2019-04-10 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Apr 10 16:15:11 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd64.h
src/external/gpl3/gcc/dist/gcc/config/sparc: netbsd-elf.h

Log Message:
Remove lingering references to NETBSD_CC1_AND_CC1PLUS_SPEC.
Not actually tested.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gcc/dist/gcc/config/sparc/netbsd-elf.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/dist/gcc/config/rs6000/netbsd64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.19 src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.20
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.19	Wed Apr  3 08:31:57 2019
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h	Wed Apr 10 16:15:11 2019
@@ -89,7 +89,6 @@ extern int dot_symbols;
 
 #undef CC1_OS_NETBSD_SPEC
 #define CC1_OS_NETBSD_SPEC \
-  NETBSD_CC1_AND_CC1PLUS_SPEC \
   "%{!m32: %{!mrelocatable: %{!fno-pie: %{!fno-pic: \
  %{!fpie: %{!fpic: \
%{!fPIE: %{!fPIC:-fPIC"

Index: src/external/gpl3/gcc/dist/gcc/config/sparc/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/sparc/netbsd-elf.h:1.13 src/external/gpl3/gcc/dist/gcc/config/sparc/netbsd-elf.h:1.14
--- src/external/gpl3/gcc/dist/gcc/config/sparc/netbsd-elf.h:1.13	Sat Jan 19 12:10:07 2019
+++ src/external/gpl3/gcc/dist/gcc/config/sparc/netbsd-elf.h	Wed Apr 10 16:15:11 2019
@@ -142,8 +142,7 @@ along with GCC; see the file COPYING3.  
 %{!mcpu*:%{!mv8plus:-mcpu=ultrasparc}} \
 %{!mno-vis:%{!mcpu=v9:-mvis}} \
 %{p:-mcmodel=medlow} \
-%{pg:-mcmodel=medlow}} " \
-  NETBSD_CC1_AND_CC1PLUS_SPEC
+%{pg:-mcmodel=medlow}} "
 
 #define CC1_SPEC64 \
  "%{m32:%{m64:%emay not use both -m32 and -m64}} \
@@ -153,8 +152,7 @@ along with GCC; see the file COPYING3.  
 %{!mcpu*:%{!mv8plus:-mcpu=cypress}}} \
   %{!m32: \
   %{p:-mcmodel=medlow} \
-  %{pg:-mcmodel=medlow}} " \
-  NETBSD_CC1_AND_CC1PLUS_SPEC
+  %{pg:-mcmodel=medlow}} "
 
 #if defined(SPARC_BI_ARCH) || defined(__arch64__)
 /* add code model specific object to the link line for 64bit */



CVS commit: src/external/gpl3/gcc/dist/gcc/config

2019-04-10 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Apr 10 16:11:06 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config: netbsd.h

Log Message:
remove bogus specs redefinition.
fixes the use of -march=native


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/external/gpl3/gcc/dist/gcc/config/netbsd.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/dist/gcc/config/netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.28 src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.29
--- src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.28	Sun Apr  7 14:11:23 2019
+++ src/external/gpl3/gcc/dist/gcc/config/netbsd.h	Wed Apr 10 16:11:06 2019
@@ -153,16 +153,6 @@ along with GCC; see the file COPYING3.  
 #define NETBSD_LIBGCC_SPEC "-lgcc"
 #endif
 
-/* Pass -cxx-isystem to cc1/cc1plus.  */
-#define NETBSD_CC1_AND_CC1PLUS_SPEC		\
-  "%{cxx-isystem}"
-
-#undef CC1_SPEC
-#define CC1_SPEC NETBSD_CC1_AND_CC1PLUS_SPEC
-
-#undef CC1PLUS_SPEC
-#define CC1PLUS_SPEC NETBSD_CC1_AND_CC1PLUS_SPEC
-
 #if defined(HAVE_LD_EH_FRAME_HDR)
 #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
 #endif



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-04-07 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Apr  7 14:26:26 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
Claim ifunc support on a number of architectures.
(Architecture list taken from src/tests/libexec/ld.elf_so/t_ifunc.c)

This is needed for attribute target_clones to work.

Non-functional until a mknative run. Tested by doing a regular GCC build.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/external/gpl3/gcc/dist/gcc/config.gcc

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/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.55 src/external/gpl3/gcc/dist/gcc/config.gcc:1.56
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.55	Sun Apr  7 14:14:05 2019
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Sun Apr  7 14:26:26 2019
@@ -802,6 +802,11 @@ case ${target} in
   esac
   nbsd_tm_file="netbsd.h netbsd-stdint.h netbsd-elf.h"
   default_use_cxa_atexit=yes
+  case ${target} in
+arm*-* | i[34567]86-* | powerpc*-* | sparc*-* | x86_64-*)
+  default_gnu_indirect_function=yes
+  ;;
+  esac
   ;;
 *-*-openbsd*)
   tmake_file="t-openbsd"



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-04-07 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Apr  7 14:14:05 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
don't append to nbsd_tm_file. This is the sole definition so fine to do.
Only done to reduce diff to upstream.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/external/gpl3/gcc/dist/gcc/config.gcc

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/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.54 src/external/gpl3/gcc/dist/gcc/config.gcc:1.55
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.54	Sun Apr  7 14:11:23 2019
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Sun Apr  7 14:14:05 2019
@@ -800,7 +800,7 @@ case ${target} in
   case ${enable_threads} in
 "" | yes | posix) thread_file='posix' ;;
   esac
-  nbsd_tm_file="${nbsd_tm_file} netbsd.h netbsd-stdint.h netbsd-elf.h"
+  nbsd_tm_file="netbsd.h netbsd-stdint.h netbsd-elf.h"
   default_use_cxa_atexit=yes
   ;;
 *-*-openbsd*)



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-04-07 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Apr  7 14:11:23 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc
src/external/gpl3/gcc/dist/gcc/config: netbsd.h

Log Message:
Reduce diff to upstream  (in config.gcc):
Make the NETBSD_ENABLE_PTHREADS unconditional (we don't use the else case)


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/external/gpl3/gcc/dist/gcc/config.gcc
cvs rdiff -u -r1.27 -r1.28 src/external/gpl3/gcc/dist/gcc/config/netbsd.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/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.53 src/external/gpl3/gcc/dist/gcc/config.gcc:1.54
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.53	Sun Apr  7 14:08:35 2019
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Sun Apr  7 14:11:23 2019
@@ -798,10 +798,7 @@ case ${target} in
   gnu_ld=yes
   use_gcc_stdint=wrap
   case ${enable_threads} in
-"" | yes | posix)
-  thread_file='posix'
-  tm_defines="${tm_defines} NETBSD_ENABLE_PTHREADS"
-  ;;
+"" | yes | posix) thread_file='posix' ;;
   esac
   nbsd_tm_file="${nbsd_tm_file} netbsd.h netbsd-stdint.h netbsd-elf.h"
   default_use_cxa_atexit=yes

Index: src/external/gpl3/gcc/dist/gcc/config/netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.27 src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.28
--- src/external/gpl3/gcc/dist/gcc/config/netbsd.h:1.27	Sun Feb  3 11:10:26 2019
+++ src/external/gpl3/gcc/dist/gcc/config/netbsd.h	Sun Apr  7 14:11:23 2019
@@ -107,16 +107,12 @@ along with GCC; see the file COPYING3.  
FIXME: Could eliminate the duplication here if we were allowed to
use string concatenation.  */
 
-#ifdef NETBSD_ENABLE_PTHREADS
 #define NETBSD_LIB_SPEC_PTHREAD \
   "%{pthread:			\
  %{!p:			\
%{!pg:-lpthread}}	\
  %{p:-lpthread_p}		\
  %{pg:-lpthread_p}}"
-#else
-#define NETBSD_LIB_SPEC_PTHREAD
-#endif
 
 #define NETBSD_LIB_SPEC		\
   NETBSD_LIB_SPEC_PTHREAD   \



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-04-07 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Apr  7 14:08:35 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
Make the post-netbsd 2.0 case the only case. NFC.

(Reducing diff to upstream)


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/external/gpl3/gcc/dist/gcc/config.gcc

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/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.52 src/external/gpl3/gcc/dist/gcc/config.gcc:1.53
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.52	Tue Mar 19 23:55:28 2019
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Sun Apr  7 14:08:35 2019
@@ -797,32 +797,14 @@ case ${target} in
   gas=yes
   gnu_ld=yes
   use_gcc_stdint=wrap
-
-  # NetBSD 2.0 and later get POSIX threads enabled by default.
-  # Allow them to be explicitly enabled on any other version.
   case ${enable_threads} in
-"")
-  case ${target} in
-*-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*)
-  thread_file='posix'
-  tm_defines="${tm_defines} NETBSD_ENABLE_PTHREADS"
-  ;;
-  esac
-  ;;
-yes | posix)
+"" | yes | posix)
   thread_file='posix'
   tm_defines="${tm_defines} NETBSD_ENABLE_PTHREADS"
   ;;
   esac
-
-  # NetBSD 2.0 and later provide __cxa_atexit(), which we use by
-  # default (unless overridden by --disable-__cxa_atexit).
-  case ${target} in
-*-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*)
-  default_use_cxa_atexit=yes
-  ;;
-  esac
   nbsd_tm_file="${nbsd_tm_file} netbsd.h netbsd-stdint.h netbsd-elf.h"
+  default_use_cxa_atexit=yes
   ;;
 *-*-openbsd*)
   tmake_file="t-openbsd"



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2019-04-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Apr  3 08:31:57 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd64.h

Log Message:
- fix missing else in SUBSUBTARGET_OVERRIDE_OPTIONS
- remove obsolete defines, and move stuff to be more like freebsd64.h
- remove common / already correctly defined overrides


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.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/dist/gcc/config/rs6000/netbsd64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.18 src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.19
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.18	Tue Feb  5 12:01:11 2019
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h	Wed Apr  3 08:31:57 2019
@@ -152,6 +152,7 @@ extern int dot_symbols;
 		error ("-mcmodel incompatible with other toc options"); \
 	  SET_CMODEL (CMODEL_SMALL);			\
 	}			\
+	  else			\
 	{			\
 	  if (!global_options_set.x_rs6000_current_cmodel)	\
 		SET_CMODEL (CMODEL_MEDIUM);			\
@@ -262,20 +263,6 @@ extern int dot_symbols;
 
 #endif
 
-/* Use standard DWARF numbering for DWARF debugging information.  */
-#define RS6000_USE_DWARF_NUMBERING
-
-/* PowerPC64 NetBSD word-aligns FP doubles when -malign-power is given.  */
-#undef  ADJUST_FIELD_ALIGN
-#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \
-  (rs6000_special_adjust_field_align_p ((TYPE), (COMPUTED))		\
-   ? 128\
-   : (TARGET_64BIT  \
-  && TARGET_ALIGN_NATURAL == 0  \
-  && TYPE_MODE (strip_array_types (TYPE)) == DFmode)   		\
-   ? MIN ((COMPUTED), 32)   \
-   : (COMPUTED))
-
 /* PowerPC64 NetBSD increases natural record alignment to doubleword if
the first field is an FP double, only if in power alignment mode.  */
 #undef  ROUND_TYPE_ALIGN
@@ -326,13 +313,15 @@ extern int dot_symbols;
   do			\
 {			\
   NETBSD_OS_CPP_BUILTINS_ELF();			\
+  builtin_define ("__PPC__");			\
+  builtin_define ("__ppc__");			\
+  builtin_define ("__powerpc__");			\
   if (TARGET_ISEL)	\
 	builtin_define ("__PPC_ISEL__");		\
   if (TARGET_64BIT)	\
 	{		\
-	  builtin_define ("__PPC__");			\
+	  builtin_define ("__arch64__");		\
 	  builtin_define ("__PPC64__");			\
-	  builtin_define ("__powerpc__");		\
 	  builtin_define ("__powerpc64__");		\
 	  builtin_define_with_int_value ("__PIC__", 2);	\
 	  builtin_assert ("cpu=powerpc64");		\
@@ -390,6 +379,20 @@ extern int dot_symbols;
   %{rdynamic:-export-dynamic} \
   %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}"
 
+/* Use standard DWARF numbering for DWARF debugging information.  */
+#define RS6000_USE_DWARF_NUMBERING
+
+/* PowerPC64 NetBSD word-aligns FP doubles when -malign-power is given.  */
+#undef  ADJUST_FIELD_ALIGN
+#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \
+  (rs6000_special_adjust_field_align_p ((TYPE), (COMPUTED))		\
+   ? 128\
+   : (TARGET_64BIT  \
+  && TARGET_ALIGN_NATURAL == 0  \
+  && TYPE_MODE (strip_array_types (TYPE)) == DFmode)   		\
+   ? MIN ((COMPUTED), 32)   \
+   : (COMPUTED))
+
 #undef  TOC_SECTION_ASM_OP
 #define TOC_SECTION_ASM_OP \
   (TARGET_64BIT		\
@@ -404,6 +407,43 @@ extern int dot_symbols;
   ? "\t.section\t\".got2\",\"aw\""			\
   : "\t.section\t\".got1\",\"aw\""))
 
+/* This is how to declare the size of a function.  */
+#undef  ASM_DECLARE_FUNCTION_SIZE
+#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)\
+  do\
+{   \
+  if (!flag_inhibit_size_directive) \
+{   \
+  fputs ("\t.size\t", (FILE));  \
+  if (TARGET_64BIT && DOT_SYMBOLS)  \
+putc ('.', (FILE)); \
+  assemble_name ((FILE), (FNAME));  \
+  fputs (",.-", (FILE));\
+  rs6000_output_function_entry (FILE, FNAME);   \
+  putc ('\n', (FILE));  \
+}   \
+}   

CVS commit: src/external/gpl3/gcc/dist/gcc/config/vax

2019-04-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 03:47:30 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/vax: vax.c

Log Message:
remove debugging code


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/gpl3/gcc/dist/gcc/config/vax/vax.c

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/dist/gcc/config/vax/vax.c
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/vax.c:1.18 src/external/gpl3/gcc/dist/gcc/config/vax/vax.c:1.19
--- src/external/gpl3/gcc/dist/gcc/config/vax/vax.c:1.18	Mon Apr  1 23:01:50 2019
+++ src/external/gpl3/gcc/dist/gcc/config/vax/vax.c	Mon Apr  1 23:47:30 2019
@@ -1840,11 +1840,8 @@ legitimate_pic_operand_p (rtx x)
 static bool
 indirectable_constant_address_p (rtx x, bool indirect)
 {
-  if (GET_CODE (x) == SYMBOL_REF) {
-fprintf (asm_out_file, "%s: %d %d %d\n", __func__,
-!flag_pic, SYMBOL_REF_LOCAL_P (x), !indirect);
+  if (GET_CODE (x) == SYMBOL_REF)
 return !flag_pic || SYMBOL_REF_LOCAL_P (x) || !indirect;
-}
 
   if (GET_CODE (x) == CONST)
 return !flag_pic



CVS commit: src/external/gpl3/gcc/dist/gcc/config/vax

2019-04-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 03:01:50 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/vax: vax.c

Log Message:
Compiling some files with -fPIC and -O2 ends up having global
symbols classified as local in pic mode, and that ends up with PC32
relocations "movl *psp, %rx" (/bin/sh parse.c). Treat pic code as
shared libraries to avoid classifying common initialized symbols
as local. Thanks to thorpej@ for his help.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/gpl3/gcc/dist/gcc/config/vax/vax.c

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/dist/gcc/config/vax/vax.c
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/vax.c:1.17 src/external/gpl3/gcc/dist/gcc/config/vax/vax.c:1.18
--- src/external/gpl3/gcc/dist/gcc/config/vax/vax.c:1.17	Sat Jan 19 07:10:07 2019
+++ src/external/gpl3/gcc/dist/gcc/config/vax/vax.c	Mon Apr  1 23:01:50 2019
@@ -118,6 +118,18 @@ static bool vax_mode_dependent_address_p
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE vax_option_override
 
+#if TARGET_ELF
+#undef TARGET_BINDS_LOCAL_P
+#define TARGET_BINDS_LOCAL_P vax_elf_binds_local_p
+
+static bool
+vax_elf_binds_local_p (const_tree exp)
+{
+  return default_binds_local_p_3 (exp, (flag_shlib | flag_pic) != 0,
+  true, false, false);
+}
+#endif
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Set global variables as needed for the options enabled.  */
@@ -1828,8 +1840,11 @@ legitimate_pic_operand_p (rtx x)
 static bool
 indirectable_constant_address_p (rtx x, bool indirect)
 {
-  if (GET_CODE (x) == SYMBOL_REF)
+  if (GET_CODE (x) == SYMBOL_REF) {
+fprintf (asm_out_file, "%s: %d %d %d\n", __func__,
+!flag_pic, SYMBOL_REF_LOCAL_P (x), !indirect);
 return !flag_pic || SYMBOL_REF_LOCAL_P (x) || !indirect;
+}
 
   if (GET_CODE (x) == CONST)
 return !flag_pic



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-03-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Mar 19 23:55:28 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
default oabi to strongarm.  fixes build.sh -a arm builds.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/external/gpl3/gcc/dist/gcc/config.gcc

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/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.51 src/external/gpl3/gcc/dist/gcc/config.gcc:1.52
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.51	Sun Feb 10 07:55:57 2019
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Tue Mar 19 23:55:28 2019
@@ -1134,6 +1134,8 @@ arm*-*-netbsdelf*)
 	*)
 	tm_file="$tm_file arm/netbsd-elf.h"
 	tmake_file="$tmake_file arm/t-netbsd"
+	# NetBSD/arm (non-eabi) is only old platforms
+	with_cpu=${with_cpu:-strongarm}
 	;;
 	esac
 	tm_file="${tm_file} arm/aout.h arm/arm.h"



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-02-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb 14 10:29:58 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: output.h varasm.c

Log Message:
put joerg's varasm.c patch back with additional upstream fixes.  now
crtbegin.o has a read-only .eh_frame, and libstdc++ builds.

2017-09-01  Joerg Sonnenberger  
Jeff Law  

* varasm.c (bss_initializer_p): Do not put constants into .bss
(categorize_decl_for_section): Handle bss_initializer_p returning
false when DECL_INITIAL is NULL.

2017-11-27  Jakub Jelinek  

PR target/83100
* varasm.c (bss_initializer_p): Return true for DECL_COMMON
TREE_READONLY decls.

2018-02-09  Jakub Jelinek  

PR middle-end/84237
* output.h (bss_initializer_p): Add NAMED argument, defaulted to false.
* varasm.c (bss_initializer_p): Add NAMED argument, if true, ignore
TREE_READONLY bit.
(get_variable_section): For decls in named .bss* sections pass true as
second argument to bss_initializer_p.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc/dist/gcc/output.h \
src/external/gpl3/gcc/dist/gcc/varasm.c

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/dist/gcc/output.h
diff -u src/external/gpl3/gcc/dist/gcc/output.h:1.7 src/external/gpl3/gcc/dist/gcc/output.h:1.8
--- src/external/gpl3/gcc/dist/gcc/output.h:1.7	Sat Jan 19 12:10:04 2019
+++ src/external/gpl3/gcc/dist/gcc/output.h	Thu Feb 14 10:29:58 2019
@@ -556,7 +556,7 @@ extern void output_file_directive (FILE 
 extern unsigned int default_section_type_flags (tree, const char *, int);
 
 extern bool have_global_bss_p (void);
-extern bool bss_initializer_p (const_tree);
+extern bool bss_initializer_p (const_tree, bool = false);
 
 extern void default_no_named_section (const char *, unsigned int, tree);
 extern void default_elf_asm_named_section (const char *, unsigned int, tree);
Index: src/external/gpl3/gcc/dist/gcc/varasm.c
diff -u src/external/gpl3/gcc/dist/gcc/varasm.c:1.7 src/external/gpl3/gcc/dist/gcc/varasm.c:1.8
--- src/external/gpl3/gcc/dist/gcc/varasm.c:1.7	Thu Jan 31 08:53:07 2019
+++ src/external/gpl3/gcc/dist/gcc/varasm.c	Thu Feb 14 10:29:58 2019
@@ -972,18 +972,18 @@ decode_reg_name (const char *name)
 /* Return true if DECL's initializer is suitable for a BSS section.  */
 
 bool
-bss_initializer_p (const_tree decl)
+bss_initializer_p (const_tree decl, bool named)
 {
-  return (DECL_INITIAL (decl) == NULL
-	  /* In LTO we have no errors in program; error_mark_node is used
-	 to mark offlined constructors.  */
-	  || (DECL_INITIAL (decl) == error_mark_node
-	  && !in_lto_p)
-	  || (flag_zero_initialized_in_bss
-	  /* Leave constant zeroes in .rodata so they
-		 can be shared.  */
-	  && !TREE_READONLY (decl)
-	  && initializer_zerop (DECL_INITIAL (decl;
+  /* Do not put non-common constants into the .bss section, they belong in
+ a readonly section, except when NAMED is true.  */
+  return ((!TREE_READONLY (decl) || DECL_COMMON (decl) || named)
+	  && (DECL_INITIAL (decl) == NULL
+	  /* In LTO we have no errors in program; error_mark_node is used
+	 to mark offlined constructors.  */
+	  || (DECL_INITIAL (decl) == error_mark_node
+	  && !in_lto_p)
+	  || (flag_zero_initialized_in_bss
+	  && initializer_zerop (DECL_INITIAL (decl);
 }
 
 /* Compute the alignment of variable specified by DECL.
@@ -1154,7 +1154,8 @@ get_variable_section (tree decl, bool pr
 {
   section *sect = get_named_section (decl, NULL, reloc);
 
-  if ((sect->common.flags & SECTION_BSS) && !bss_initializer_p (decl))
+  if ((sect->common.flags & SECTION_BSS)
+	  && !bss_initializer_p (decl, true))
 	{
 	  error_at (DECL_SOURCE_LOCATION (decl),
 		"only zero initializers are allowed in section %qs",
@@ -6465,7 +6466,8 @@ categorize_decl_for_section (const_tree 
 	ret = SECCAT_BSS;
   else if (! TREE_READONLY (decl)
 	   || TREE_SIDE_EFFECTS (decl)
-	   || ! TREE_CONSTANT (DECL_INITIAL (decl)))
+	   || (DECL_INITIAL (decl)
+		   && ! TREE_CONSTANT (DECL_INITIAL (decl
 	{
 	  /* Here the reloc_rw_mask is not testing whether the section should
 	 be read-only or not, but whether the dynamic link will have to
@@ -6485,7 +6487,8 @@ categorize_decl_for_section (const_tree 
 	   location.  -fmerge-all-constants allows even that (at the
 	   expense of not conforming).  */
 	ret = SECCAT_RODATA;
-  else if (TREE_CODE (DECL_INITIAL (decl)) == STRING_CST)
+  else if (DECL_INITIAL (decl)
+	   && TREE_CODE (DECL_INITIAL (decl)) == STRING_CST)
 	ret = SECCAT_RODATA_MERGE_STR_INIT;
   else
 	ret = SECCAT_RODATA_MERGE_CONST;



CVS commit: src/external/gpl3/gcc/dist/gcc/config/riscv

2019-02-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 10 07:56:21 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/riscv: netbsd.h

Log Message:
remove stuff provided by netbsd-stdint.h.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.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/dist/gcc/config/riscv/netbsd.h
diff -u src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h:1.5 src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h:1.6
--- src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h:1.5	Sat Feb  9 21:00:41 2019
+++ src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h	Sun Feb 10 07:56:21 2019
@@ -63,38 +63,6 @@ Boston, MA 02111-1307, USA.  */
 #undef NETBSD_ENTRY_POINT
 #define NETBSD_ENTRY_POINT	"_start"
 
-#define SIG_ATOMIC_TYPE   "int"
-
-#define INT8_TYPE "signed char"
-#define INT16_TYPE "short int"
-#define INT32_TYPE "int"
-#define INT64_TYPE "long long int"
-#define UINT8_TYPE "unsigned char"
-#define UINT16_TYPE "short unsigned int"
-#define UINT32_TYPE "unsigned int"
-#define UINT64_TYPE "long long unsigned int"
-
-#define INT_LEAST8_TYPE "signed char"
-#define INT_LEAST16_TYPE "short int"
-#define INT_LEAST32_TYPE "int"
-#define INT_LEAST64_TYPE "long long int"
-#define UINT_LEAST8_TYPE "unsigned char"
-#define UINT_LEAST16_TYPE "short unsigned int"
-#define UINT_LEAST32_TYPE "unsigned int"
-#define UINT_LEAST64_TYPE "long long unsigned int"
-
-#define INT_FAST8_TYPE "signed char"
-#define INT_FAST16_TYPE "short int"
-#define INT_FAST32_TYPE "int"
-#define INT_FAST64_TYPE "long long int"
-#define UINT_FAST8_TYPE "unsigned char"
-#define UINT_FAST16_TYPE "short unsigned int"
-#define UINT_FAST32_TYPE "unsigned int"
-#define UINT_FAST64_TYPE "long long unsigned int"
-
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "long int"
-
 #undef SIZE_TYPE
 #define SIZE_TYPE "long unsigned int"
 



CVS commit: src/external/gpl3/gcc/dist/gcc

2019-02-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 10 07:55:57 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/gcc: config.gcc

Log Message:
riscv wants netbsd-stdint.h's CHAR_FAST8=1 and SHORT_FAST16=1.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/external/gpl3/gcc/dist/gcc/config.gcc

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/dist/gcc/config.gcc
diff -u src/external/gpl3/gcc/dist/gcc/config.gcc:1.50 src/external/gpl3/gcc/dist/gcc/config.gcc:1.51
--- src/external/gpl3/gcc/dist/gcc/config.gcc:1.50	Sat Feb  9 20:57:17 2019
+++ src/external/gpl3/gcc/dist/gcc/config.gcc	Sun Feb 10 07:55:57 2019
@@ -2157,8 +2157,8 @@ riscv*-*-elf* | riscv*-*-rtems*)
 	gcc_cv_initfini_array=yes
 	;;
 riscv*-*-netbsd*)# NetBSD RISC-V
-	# XXXMRG not ported yet, copied from old config
 	tm_file="elfos.h ${tm_file} ${nbsd_tm_file} riscv/netbsd.h"
+	tm_defines="${tm_defines} CHAR_FAST8=1 SHORT_FAST16=1"
 	case ${target} in
 	  riscv32*) tm_defines="${tm_defines} TARGET_64BIT_DEFAULT=0" ;;
 	  *) tmake_file="${tmake_file} riscv/t-netbsd64" ;;



  1   2   3   4   5   >