Module Name: src
Committed By: mrg
Date: Thu Aug 3 01:36:55 UTC 2023
Modified Files:
src/external/gpl3/gcc: README.gcc12
src/external/gpl3/gcc/dist/gcc: common.opt
src/external/gpl3/gcc/dist/gcc/config: netbsd.cc
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd64.h
src/external/gpl3/gcc/dist/gcc/config/vax: elf.h netbsd-elf.h
vax-protos.h vax.h
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_allocator.h
lsan_common.cpp
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: Makefile.am
Makefile.in sanitizer_interceptors_ioctl_netbsd.inc
sanitizer_internal_defs.h sanitizer_linux.cpp
sanitizer_platform_limits_netbsd.cpp
sanitizer_platform_limits_netbsd.h
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_platform_linux.cpp
src/external/gpl3/gcc/lib: Makefile Makefile.sanitizer
src/external/gpl3/gcc/lib/libasan: Makefile shlib_version
src/external/gpl3/gcc/lib/liblsan: Makefile shlib_version
src/external/gpl3/gcc/lib/libtsan: Makefile shlib_version
src/external/gpl3/gcc/lib/libubsan: Makefile shlib_version
src/external/gpl3/gcc/usr.bin: Makefile.inc
Log Message:
many fixes for native GCC 12 builds
- default to dwarf4 since out ctf tools fail with dwarf5. i tried to
do this via subtarget options as other ports do, but this would
require adjusting several of the targets non-netbsd code, and ideally
we'll fix our tools sooner than later, so just hack it here for now.
- catch up config/rs6000/netbsd64.h (mostly delete things)
- remove some more upstream diffs in config/vax, though it does not work
currently - libc.so link fails due to weird relocations.
- include some headers to ensure types are available
- add missing sanitizer netbsd files to the 'dist' tree
- remove no longer present TIOCRCVFRAME and TIOCXMTFRAME interceptors
- expanding the sanitizer OS/cpu defs to cover more netbsd platforms
- copy across a few minor changes from gcc.old's sanitizer's (eg,
disabling linux-specific code, adding netbsd specific code.)
- add (untested, but building) tsan support for arm64
- re-enable the sanitzers, at least simple -fsanitize=address builds a
working application on amd64 now
- fix the source lists (mostly .cc -> .cpp rename here)
- add some missing new defines, -f*, and -W*
- bump sanitizer shlib version
- apply -fno-jump-tables in some more places on m68k
- update the list in README.gcc12 to note many things now work or a few
things to do not work (although there are many uncommited changes at
this point across the rest of 'src' and 'xsrc'.) main points are that
vax, hppa, ppc, and sh3 don't build yet, but most other things are
either testing and working or at least building.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc/README.gcc12
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gcc/dist/gcc/common.opt
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/gcc/config/netbsd.cc
cvs rdiff -u -r1.27 -r1.28 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gcc/dist/gcc/config/vax/elf.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gcc/dist/gcc/config/vax/netbsd-elf.h
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gcc/dist/gcc/config/vax/vax-protos.h
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gcc/dist/gcc/config/vax/vax.h
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.cpp
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
cvs rdiff -u -r1.17 -r1.18 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cpp \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_platform_linux.cpp
cvs rdiff -u -r1.22 -r1.23 src/external/gpl3/gcc/lib/Makefile
cvs rdiff -u -r1.16 -r1.17 src/external/gpl3/gcc/lib/Makefile.sanitizer
cvs rdiff -u -r1.33 -r1.34 src/external/gpl3/gcc/lib/libasan/Makefile
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc/lib/libasan/shlib_version
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc/lib/liblsan/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/lib/liblsan/shlib_version
cvs rdiff -u -r1.16 -r1.17 src/external/gpl3/gcc/lib/libtsan/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/lib/libtsan/shlib_version
cvs rdiff -u -r1.20 -r1.21 src/external/gpl3/gcc/lib/libubsan/Makefile
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gcc/lib/libubsan/shlib_version
cvs rdiff -u -r1.37 -r1.38 src/external/gpl3/gcc/usr.bin/Makefile.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/README.gcc12
diff -u src/external/gpl3/gcc/README.gcc12:1.3 src/external/gpl3/gcc/README.gcc12:1.4
--- src/external/gpl3/gcc/README.gcc12:1.3 Tue Aug 1 07:09:38 2023
+++ src/external/gpl3/gcc/README.gcc12 Thu Aug 3 01:36:53 2023
@@ -1,4 +1,4 @@
-$NetBSD: README.gcc12,v 1.3 2023/08/01 07:09:38 mrg Exp $
+$NetBSD: README.gcc12,v 1.4 2023/08/03 01:36:53 mrg Exp $
new stuff:
@@ -10,7 +10,6 @@ new stuff:
d
gfortran
libbacktrace: +dwarf5_CFLAGS = $(libbacktrace_TEST_CFLAGS) -gdwarf-5
- libcody
c++tools
todo:
@@ -23,8 +22,8 @@ tools: does build.sh tools work?
kernels: does a kernel run? y (yes), b (builds/ready), ? (not ready)
libgcc: does libgcc build?
native-gcc: does a full mknative-gcc complete?
-sani: has sanitizer been ported to this CPU again for GCC 12
-make release: does build.sh release complete?
+sani: has sanitizer been ported to this CPU again for GCC 12? b (build) y (works)
+make release: does build.sh release complete? (before sanitizer - bs)
runs: does the system boot with a full world?
atf: does atf run / compare well
switched: has port switched? y (yes), n (no/ready), ? (not ready)
@@ -32,48 +31,65 @@ switched: has port switched? y (yes), n
architecture tools kernels libgcc native-gcc/sani make release[2] runs atf switched
------------ ----- ------- ------ --------------- ------------ ---- --- --------
-aarch64 y y y y ? y y y ?
-aarch64eb y ? ? y ? ? ? ? ?
-alpha y ? ? y ? ? ? ? ?
-earmv4 ? ? ? ? ? ? ? ? ?
-earmv4eb ? ? ? ? ? ? ? ? ?
-earmv5 y ? ? y ? ? ? ? ?
-earmv5eb y ? ? y ? ? ? ? ?
-earmv5hf y ? ? y ? ? ? ? ?
-earmv5hfeb y ? ? y ? ? ? ? ?
-earmv6 y ? ? y ? ? ? ? ?
-earmv6eb y ? ? y ? ? ? ? ?
-earmv6hf y ? ? y ? ? ? ? ?
-earmv6hfeb y ? ? y ? ? ? ? ?
-earmv7 y ? y y ? ? ? ? ?
-earmv7eb y ? ? y ? ? ? ? ?
-earmv7hf y ? ? y ? ? ? ? ?
-earmv7hfeb y ? ? y ? ? ? ? ?
-hppa y ? ? y ? ? ? ? ?
-i386 y ? y y ? y ? ? ?
-ia64 y y y y ? y y[3] n ?
-m68000 y ? ? y ? ? ? ? ?
-m68k y ? ? y ? ? ? ? ?
-mipseb y ? ? y ? ? ? ? ?
-mipsel y ? y y ? y ? ? ?
-mips64eb y ? ? y ? ? ? ? ?
-mips64el y ? ? y ? ? ? ? ?
-powerpc y ? ? y ? ? ? ? ?
-powerpc64 ? ? ? ? ? ? ? ? ?
-sh3eb y ? ? y ? ? ? ? ?
-sh3el y ? ? y ? ? ? ? ?
-sparc y ? ? y ? y ? ? ?
-sparc64 y ? ? y ? y ? ? ?
+aarch64 y y y y b y y y ?
+aarch64eb y y y y b y y y ?
+alpha y b y y b y ? ? ?
+earmv4 y b ? y ? ? ? ? ?
+earmv4eb y b ? y ? ? ? ? ?
+earmv5 y b ? y ? ? ? ? ?
+earmv5eb y b ? y ? ? ? ? ?
+earmv5hf y b ? y ? ? ? ? ?
+earmv5hfeb y b ? y ? ? ? ? ?
+earmv6 y b ? y ? ? ? ? ?
+earmv6eb y b ? y ? ? ? ? ?
+earmv6hf y b ? y ? ? ? ? ?
+earmv6hfeb y b ? y ? ? ? ? ?
+earmv7 y b y y ? ? ? ? ?
+earmv7eb y b ? y ? ? ? ? ?
+earmv7hf y b ? y ? ? ? ? ?
+earmv7hfeb y b ? y ? ? ? ? ?
+hppa y b y y ? n[5] ? ? ?
+i386 y b y y y y ? ? ?
+ia64 y b y y y y y[3] n ?
+m68000 y n[9] y y ? bs ? ? ?
+m68k y b y y ? bs ? ? ?
+mipseb y b y y ? bs ? ? ?
+mipsel y b y y ? bs ? ? ?
+mips64eb y b y y ? bs ? ? ?
+mips64el y b y y ? bs ? ? ?
+powerpc y ? y y ? n[4] ? ? ?
+powerpc64 y ? ? y ? ? ? ? ?
+sh3eb y ? y y ? ? ? ? ?
+sh3el y ? y y ? ? ? ? ?
+sparc y y y y ? bs y ? ?
+sparc64 y b y y b y ? ? ?
vax y ? y y ? n ? ? ?
-x86_64 y y y y ? y y n[1] ?
-riscv32 y ? ? ? ? ? ? ? ?
-riscv64 y ? ? ? ? ? ? ? ?
+x86_64 y y y y y y y y ?
+riscv32 y y y y ? bs ? ? ?
+riscv64 y y y y ? bs ? ? ?
------------ ----- ------- ------ --------------- ------------ ---- ---
architecture tools kernels libgcc native-gcc/sani make release runs atf
[1]: amd64 crashed in memfd, likely bug in new code
[2]: while libsanitizer is not re-ported, "make release" does not include it.
[3]: GENERIC.SKI boots just as well as GCC 10.
+[4]: rs6000 has a new generator for rs6000-builtins.cc and rs6000-builtins.h rs6000-vecdefines.h
+[5]: GCC itself fails to build:
+ build-print-rtl.c: In constructor 'rtx_writer::rtx_writer(FILE*, int, bool, bool, rtx_reuse_manager*)':
+ build-print-rtl.c:90:3: error: class 'rtx_writer' does not have any field named 'm_rtx_reuse_manager'
+[6]: rs6000 has new generator to deal with
+[7]: fails to build kernels:
+ In file included from sys/arch/powerpc/oea/pmap64.c:4:
+ sys/arch/powerpc/oea/pmap.c:2186:2: error: #error PPC_OEA64 not supported
+[8]: destdir.evbsh3/usr/include/ssp/string.h: In function '_int_strtod_l':
+ destdir.evbsh3/usr/include/ssp/string.h:82:1: error: inlining failed in call to 'always_inline' '__memcpy_ichk': target specific option mismatch
+ 82 | __ssp_bos_icheck3_restrict(memcpy, void *, const void *)
+ | ^~~~~~~~~~~~~~~~~~~~~~~~~~
+ src/lib/libc/gdtoa/gdtoaimp.h:534:20: note: called from here
+ 534 | #define Bcopy(x,y) memcpy(&x->sign,&y->sign,y->wds*sizeof(ULong) + 2*sizeof(int))
+ src/lib/libc/gdtoa/strtod.c:582:17: note: in expansion of macro 'Bcopy'
+ 582 | Bcopy(bd, bd0);
+[9]: sun2 fails to load the kernel, probably too big again.
CPU vs platform test table (for CPUs with multiple ports). this is "make release" or just kernels.
@@ -82,33 +98,33 @@ values: y (yes), k (kernels only), n (f
CPU platform list
--- -------- ----
acorn32 cats epoc32 evbarm-eb evbarm-el hpcarm iyonix netwinder shark zaurus
-earmv4: ? ? ? ? ? ? ? ?
-earm: ? ? ? ?
-earmhf: ? ?
-earmv6: ? ?
-earmv6hf: ? ?
-earmv7: ? ?
-earmv7hf: ? ?
+earmv4: k k k k k k k y
+earm: k k k k
+earmhf: k k
+earmv6: k k
+earmv6hf: k k
+earmv7: k k
+earmv7hf: k k
amiga atari cesfic hp300 luna68k mac68k mvme68k news68k next68k sun3 x68k
-m68k: ? ? ? ? ? ? ? ? ? y ?
+m68k: y k k k k k k k k k k
evbmips emips ews4800mips mipsco newsmips sgimips
-mipseb: ? ? ? ? ? ?
+mipseb: k k k k k y
evbmips algor arc cobalt hpcmips pmax
-mipsel: ? ? ? ? ? r
+mipsel: k k k k k y
algor evbmips pmax
-mips64eb: ?
-mips64el: ? ? ?
+mips64eb: r
+mips64el: k r r
amigappc bebox evbppc ibmnws macppc mvmeppc ofppc prep rs6000 sandpoint
-powerpc: ? ? ? ? ? ? ? ? ? ?
+powerpc: k k k k kn[6] k k k k k
evbppc macppc ofppc
-powerpc64: ? ? ?
+powerpc64: k k n[7]
dreamcast evbsh3 hpcsh landisk mmeye
-sh3eb: ? ?
-sh3el: ? ? ? ?
+sh3eb: kn[8] k
+sh3el: k kn[8] k k
Index: src/external/gpl3/gcc/dist/gcc/common.opt
diff -u src/external/gpl3/gcc/dist/gcc/common.opt:1.13 src/external/gpl3/gcc/dist/gcc/common.opt:1.14
--- src/external/gpl3/gcc/dist/gcc/common.opt:1.13 Sun Jul 30 05:51:11 2023
+++ src/external/gpl3/gcc/dist/gcc/common.opt Thu Aug 3 01:36:53 2023
@@ -3293,8 +3293,9 @@ gdwarf
Common Driver JoinedOrMissing Negative(gdwarf-)
Generate debug information in default version of DWARF format.
+; XXX NetBSD ctf tools can't handle version 5 yet.
gdwarf-
-Common Driver Joined UInteger Var(dwarf_version) Init(5) Negative(gstabs)
+Common Driver Joined UInteger Var(dwarf_version) Init(4) Negative(gstabs)
Generate debug information in DWARF v2 (or later) format.
gdwarf32
Index: src/external/gpl3/gcc/dist/gcc/config/netbsd.cc
diff -u src/external/gpl3/gcc/dist/gcc/config/netbsd.cc:1.1.1.1 src/external/gpl3/gcc/dist/gcc/config/netbsd.cc:1.2
--- src/external/gpl3/gcc/dist/gcc/config/netbsd.cc:1.1.1.1 Sun Jul 30 05:21:02 2023
+++ src/external/gpl3/gcc/dist/gcc/config/netbsd.cc Thu Aug 3 01:36:54 2023
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3.
#include "tm.h"
#include "tree.h"
#include "varasm.h"
+#include "opts.h"
#include "netbsd-protos.h"
static void
Index: src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.27 src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.28
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.27 Tue Sep 15 05:06:56 2020
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h Thu Aug 3 01:36:54 2023
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler,
for 64 bit PowerPC NetBSD.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006-2023 Free Software Foundation, Inc.
Contributed by Matthew Green ([email protected]).
This file is part of GCC.
@@ -93,86 +93,7 @@ extern int dot_symbols;
#undef SUBSUBTARGET_OVERRIDE_OPTIONS
#define SUBSUBTARGET_OVERRIDE_OPTIONS \
- do \
- { \
- if (!global_options_set.x_rs6000_alignment_flags) \
- rs6000_alignment_flags = MASK_ALIGN_NATURAL; \
- if (TARGET_64BIT) \
- { \
- if (DEFAULT_ABI != ABI_AIX) \
- { \
- rs6000_current_abi = ABI_AIX; \
- error (INVALID_64BIT, "call"); \
- } \
- dot_symbols = !strcmp (rs6000_abi_name, "aixdesc"); \
- if (ELFv2_ABI_CHECK) \
- { \
- rs6000_current_abi = ABI_ELFv2; \
- if (dot_symbols) \
- error ("%<-mcall-aixdesc%> incompatible with %<-mabi=elfv2%>"); \
- } \
- if (rs6000_isa_flags & OPTION_MASK_RELOCATABLE) \
- { \
- rs6000_isa_flags &= ~OPTION_MASK_RELOCATABLE; \
- error (INVALID_64BIT, "relocatable"); \
- } \
- if (ELFv2_ABI_CHECK) \
- { \
- rs6000_current_abi = ABI_ELFv2; \
- if (dot_symbols) \
- error ("-mcall-aixdesc incompatible with -mabi=elfv2"); \
- } \
- if (rs6000_isa_flags & OPTION_MASK_EABI) \
- { \
- rs6000_isa_flags &= ~OPTION_MASK_EABI; \
- error (INVALID_64BIT, "eabi"); \
- } \
- if (TARGET_PROTOTYPE) \
- { \
- target_prototype = 0; \
- error (INVALID_64BIT, "prototype"); \
- } \
- if ((rs6000_isa_flags & OPTION_MASK_POWERPC64) == 0) \
- { \
- rs6000_isa_flags |= OPTION_MASK_POWERPC64; \
- 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"); \
- SET_CMODEL (CMODEL_SMALL); \
- } \
- else \
- { \
- if (!global_options_set.x_rs6000_current_cmodel) \
- SET_CMODEL (CMODEL_MEDIUM); \
- if (rs6000_current_cmodel != CMODEL_SMALL) \
- { \
- TARGET_NO_FP_IN_TOC = 0; \
- TARGET_NO_SUM_IN_TOC = 0; \
- } \
- } \
- } \
- else \
- { \
- if (!RS6000_BI_ARCH_P) \
- error (INVALID_32BIT, "32"); \
- if (TARGET_PROFILE_KERNEL) \
- { \
- TARGET_PROFILE_KERNEL = 0; \
- error (INVALID_32BIT, "profile-kernel"); \
- } \
- if (global_options_set.x_rs6000_current_cmodel) \
- { \
- SET_CMODEL (CMODEL_SMALL); \
- error (INVALID_32BIT, "cmodel"); \
- } \
- } \
- } \
- while (0)
+ do rs6000_linux64_override_options (); while (0)
#undef ASM_DEFAULT_SPEC
#undef ASM_SPEC
@@ -253,11 +174,9 @@ extern int dot_symbols;
/* 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) \
+ ((TARGET_64BIT \
+ && TARGET_ALIGN_NATURAL == 0 \
+ && TYPE_MODE (strip_array_types (TYPE)) == DFmode) \
? MIN ((COMPUTED), 32) \
: (COMPUTED))
Index: src/external/gpl3/gcc/dist/gcc/config/vax/elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/elf.h:1.12 src/external/gpl3/gcc/dist/gcc/config/vax/elf.h:1.13
--- src/external/gpl3/gcc/dist/gcc/config/vax/elf.h:1.12 Sun Jul 30 05:51:30 2023
+++ src/external/gpl3/gcc/dist/gcc/config/vax/elf.h Thu Aug 3 01:36:54 2023
@@ -115,5 +115,5 @@ along with GCC; see the file COPYING3.
fputs (integer_asm_op (SIZE, FALSE), FILE); \
fprintf (FILE, "%%pcrel%d(", SIZE * 8); \
assemble_name (FILE, LABEL); \
- fprintf (FILE, "%+d)", SIZE); \
+ fputc (')', FILE); \
} while (0)
Index: src/external/gpl3/gcc/dist/gcc/config/vax/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/netbsd-elf.h:1.10 src/external/gpl3/gcc/dist/gcc/config/vax/netbsd-elf.h:1.11
--- src/external/gpl3/gcc/dist/gcc/config/vax/netbsd-elf.h:1.10 Sun Jul 30 05:51:30 2023
+++ src/external/gpl3/gcc/dist/gcc/config/vax/netbsd-elf.h Thu Aug 3 01:36:54 2023
@@ -45,9 +45,8 @@ along with GCC; see the file COPYING3.
#undef LINK_SPEC
#define LINK_SPEC NETBSD_LINK_SPEC_ELF
-#undef EXTRA_SPECS
-#define EXTRA_SPECS NETBSD_SUBTARGET_EXTRA_SPECS
-#undef SUBTARGET_EXTRA_SPECS
+#define EXTRA_SPECS \
+ { "netbsd_entry_point", NETBSD_ENTRY_POINT },
#undef INTPTR_TYPE
#define INTPTR_TYPE "long int"
Index: src/external/gpl3/gcc/dist/gcc/config/vax/vax-protos.h
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/vax-protos.h:1.11 src/external/gpl3/gcc/dist/gcc/config/vax/vax-protos.h:1.12
--- src/external/gpl3/gcc/dist/gcc/config/vax/vax-protos.h:1.11 Sun Jul 30 05:51:30 2023
+++ src/external/gpl3/gcc/dist/gcc/config/vax/vax-protos.h Thu Aug 3 01:36:54 2023
@@ -17,6 +17,8 @@ You should have received a copy of the G
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#include <stdbool.h>
+
extern bool legitimate_constant_address_p (rtx);
extern void vax_expand_prologue (void);
Index: src/external/gpl3/gcc/dist/gcc/config/vax/vax.h
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/vax.h:1.14 src/external/gpl3/gcc/dist/gcc/config/vax/vax.h:1.15
--- src/external/gpl3/gcc/dist/gcc/config/vax/vax.h:1.14 Tue Aug 1 06:05:13 2023
+++ src/external/gpl3/gcc/dist/gcc/config/vax/vax.h Thu Aug 3 01:36:54 2023
@@ -139,9 +139,6 @@ along with GCC; see the file COPYING3.
/* Specify the registers used for certain standard purposes.
The values of these macros are register numbers. */
-/* VAX PSW for DWARF-2 */
-#define PSW_REGNUM VAX_PSW_REGNUM
-
/* VAX pc is overloaded on a register. */
#define PC_REGNUM VAX_PC_REGNUM
Index: src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.6 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.7
--- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.6 Sun Jul 30 05:51:42 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h Thu Aug 3 01:36:54 2023
@@ -50,7 +50,9 @@ struct ChunkMetadata {
};
#if defined(__mips64) || defined(__aarch64__) || defined(__i386__) || \
- defined(__arm__) || SANITIZER_RISCV64 || defined(__hexagon__)
+ defined(__arm__) || SANITIZER_RISCV64 || defined(__hexagon__) || \
+ ((defined(__hppa__) || defined(__sparc__)) && !defined(_LP64)) || \
+ defined(__mips_o32) || defined(__mips_n32)
template <typename AddressSpaceViewTy>
struct AP32 {
static const uptr kSpaceBeg = 0;
@@ -65,7 +67,8 @@ struct AP32 {
template <typename AddressSpaceView>
using PrimaryAllocatorASVT = SizeClassAllocator32<AP32<AddressSpaceView>>;
using PrimaryAllocator = PrimaryAllocatorASVT<LocalAddressSpaceView>;
-#elif defined(__x86_64__) || defined(__powerpc64__) || defined(__s390x__)
+#elif defined(__x86_64__) || defined(__powerpc64__) || defined(__s390x__) || \
+ defined(__alpha__) || defined(__sparc64__) || defined(__ia64__)
# if SANITIZER_FUCHSIA
const uptr kAllocatorSpace = ~(uptr)0;
const uptr kAllocatorSize = 0x40000000000ULL; // 4T.
Index: src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.cpp
diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.cpp:1.3 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.cpp:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.cpp:1.3 Mon Jul 31 01:44:55 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.cpp Thu Aug 3 01:36:54 2023
@@ -161,7 +161,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 =
Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am:1.8 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am:1.9
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am:1.8 Sun Jul 30 05:51:42 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am Thu Aug 3 01:36:54 2023
@@ -47,6 +47,7 @@ sanitizer_common_files = \
sanitizer_openbsd.cpp \
sanitizer_platform_limits_freebsd.cpp \
sanitizer_platform_limits_linux.cpp \
+ sanitizer_platform_limits_netbsd.cpp \
sanitizer_platform_limits_openbsd.cpp \
sanitizer_platform_limits_posix.cpp \
sanitizer_platform_limits_solaris.cpp \
@@ -67,6 +68,7 @@ sanitizer_common_files = \
sanitizer_symbolizer_report.cpp \
sanitizer_stacktrace_printer.cpp \
sanitizer_stoptheworld_linux_libcdep.cpp \
+ sanitizer_stoptheworld_netbsd_libcdep.cpp \
sanitizer_stoptheworld_mac.cpp \
sanitizer_suppressions.cpp \
sanitizer_symbolizer.cpp \
Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in:1.8 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in:1.9
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in:1.8 Sun Jul 30 05:51:42 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in Thu Aug 3 01:36:54 2023
@@ -133,6 +133,7 @@ am__objects_1 = sancov_flags.lo sanitize
sanitizer_netbsd.lo sanitizer_openbsd.lo \
sanitizer_platform_limits_freebsd.lo \
sanitizer_platform_limits_linux.lo \
+ sanitizer_platform_limits_netbsd.lo \
sanitizer_platform_limits_openbsd.lo \
sanitizer_platform_limits_posix.lo \
sanitizer_platform_limits_solaris.lo sanitizer_posix.lo \
@@ -145,6 +146,7 @@ am__objects_1 = sancov_flags.lo sanitize
sanitizer_symbolizer_mac.lo sanitizer_symbolizer_report.lo \
sanitizer_stacktrace_printer.lo \
sanitizer_stoptheworld_linux_libcdep.lo \
+ sanitizer_stoptheworld_netbsd_libcdep.lo \
sanitizer_stoptheworld_mac.lo sanitizer_suppressions.lo \
sanitizer_symbolizer.lo sanitizer_symbolizer_libbacktrace.lo \
sanitizer_symbolizer_libcdep.lo \
@@ -408,6 +410,7 @@ sanitizer_common_files = \
sanitizer_openbsd.cpp \
sanitizer_platform_limits_freebsd.cpp \
sanitizer_platform_limits_linux.cpp \
+ sanitizer_platform_limits_netbsd.cpp \
sanitizer_platform_limits_openbsd.cpp \
sanitizer_platform_limits_posix.cpp \
sanitizer_platform_limits_solaris.cpp \
@@ -428,6 +431,7 @@ sanitizer_common_files = \
sanitizer_symbolizer_report.cpp \
sanitizer_stacktrace_printer.cpp \
sanitizer_stoptheworld_linux_libcdep.cpp \
+ sanitizer_stoptheworld_netbsd_libcdep.cpp \
sanitizer_stoptheworld_mac.cpp \
sanitizer_suppressions.cpp \
sanitizer_symbolizer.cpp \
@@ -564,6 +568,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_openbsd.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_platform_limits_freebsd.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_platform_limits_linux.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_platform_limits_netbsd.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_platform_limits_openbsd.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_platform_limits_posix.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_platform_limits_solaris.Plo@am__quote@
@@ -582,6 +587,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_stacktrace_printer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_stacktrace_sparc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_stoptheworld_linux_libcdep.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_stoptheworld_netbsd_libcdep.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_stoptheworld_mac.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_suppressions.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_symbolizer.Plo@am__quote@
Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc:1.6 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc:1.7
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc:1.6 Sun Jul 30 05:51:42 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc Thu Aug 3 01:36:54 2023
@@ -1267,8 +1267,6 @@ static void ioctl_table_fill() {
_(TIOCGFLAGS, WRITE, sizeof(int));
_(TIOCSFLAGS, READ, sizeof(int));
_(TIOCDCDTIMESTAMP, WRITE, struct_timeval_sz);
- _(TIOCRCVFRAME, READ, sizeof(uptr));
- _(TIOCXMTFRAME, READ, sizeof(uptr));
_(TIOCPTMGET, WRITE, struct_ptmget_sz);
_(TIOCGRANTPT, NONE, 0);
_(TIOCPTSNAME, WRITE, struct_ptmget_sz);
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.17 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.18
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.17 Sun Jul 30 05:51:42 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h Thu Aug 3 01:36:54 2023
@@ -139,7 +139,10 @@ namespace __sanitizer {
typedef unsigned long long uptr;
typedef signed long long sptr;
#else
-# if (SANITIZER_WORDSIZE == 64) || SANITIZER_MAC || SANITIZER_WINDOWS
+# if (SANITIZER_WORDSIZE == 64) || SANITIZER_MAC || SANITIZER_WINDOWS || \
+ (SANITIZER_NETBSD && \
+ (defined(__sparc__) || defined(__hppa__) || defined(__arm__) || \
+ (defined(__mips__) && !defined(__mips_o32))))
typedef unsigned long uptr;
typedef signed long sptr;
# else
@@ -188,8 +191,11 @@ typedef u64 OFF64_T;
#if (SANITIZER_WORDSIZE == 64) || SANITIZER_MAC
typedef uptr operator_new_size_type;
+#elifdef __SIZE_TYPE__
+typedef __SIZE_TYPE__ operator_new_size_type;
#else
-# if defined(__s390__) && !defined(__s390x__)
+# if (defined(__s390__) && !defined(__s390x__)) || \
+ (SANITIZER_NETBSD && (defined(__sparc__) || defined(__hppa__) || defined(__mips__)))
// Special case: 31-bit s390 has unsigned long as size_t.
typedef unsigned long operator_new_size_type;
# else
Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cpp
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cpp:1.3 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cpp:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cpp:1.3 Mon Jul 31 01:44:56 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cpp Thu Aug 3 01:36:54 2023
@@ -34,6 +34,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 <asm/unistd.h>
#include <sys/types.h>
@@ -49,6 +50,11 @@
#include <asm/stat.h>
#undef stat
#endif
+#endif
+
+#if SANITIZER_NETBSD
+#include <lwp.h>
+#endif
#include <dlfcn.h>
#include <errno.h>
@@ -1778,12 +1784,15 @@ void internal_join_thread(void *th) {}
#if defined(__aarch64__)
// Android headers in the older NDK releases miss this definition.
+#if SANITIZER_LINUX
struct __sanitizer_esr_context {
struct _aarch64_ctx head;
uint64_t esr;
};
+#endif
static bool Aarch64GetESR(ucontext_t *ucontext, u64 *esr) {
+#if SANITIZER_LINUX
static const u32 kEsrMagic = 0x45535201;
u8 *aux = reinterpret_cast<u8 *>(ucontext->uc_mcontext.__reserved);
while (true) {
@@ -1795,6 +1804,7 @@ static bool Aarch64GetESR(ucontext_t *uc
}
aux += ctx->size;
}
+#endif
return false;
}
#endif
@@ -1821,7 +1831,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;
@@ -1879,6 +1894,8 @@ SignalContext::WriteFlag SignalContext::
// From OpenSolaris $SRC/uts/sun4/os/trap.c (get_accesstype).
#if SANITIZER_SOLARIS
uptr pc = ucontext->uc_mcontext.gregs[REG_PC];
+#elif SANITIZER_NETBSD
+ uptr pc = ucontext->uc_mcontext.__gregs[_REG_PC];
#else
// Historical BSDism here.
struct sigcontext *scontext = (struct sigcontext *)context;
Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cpp:1.3 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cpp:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cpp:1.3 Mon Jul 31 01:44:56 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cpp Thu Aug 3 01:36:54 2023
@@ -2342,8 +2342,6 @@ unsigned IOCTL_TIOCDRAIN = TIOCDRAIN;
unsigned IOCTL_TIOCGFLAGS = TIOCGFLAGS;
unsigned IOCTL_TIOCSFLAGS = TIOCSFLAGS;
unsigned IOCTL_TIOCDCDTIMESTAMP = TIOCDCDTIMESTAMP;
-unsigned IOCTL_TIOCRCVFRAME = TIOCRCVFRAME;
-unsigned IOCTL_TIOCXMTFRAME = TIOCXMTFRAME;
unsigned IOCTL_TIOCPTMGET = TIOCPTMGET;
unsigned IOCTL_TIOCGRANTPT = TIOCGRANTPT;
unsigned IOCTL_TIOCPTSNAME = TIOCPTSNAME;
Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h:1.10 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h:1.11
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h:1.10 Mon Jul 31 01:44:56 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h Thu Aug 3 01:36:54 2023
@@ -2195,8 +2195,6 @@ extern unsigned IOCTL_TIOCDRAIN;
extern unsigned IOCTL_TIOCGFLAGS;
extern unsigned IOCTL_TIOCSFLAGS;
extern unsigned IOCTL_TIOCDCDTIMESTAMP;
-extern unsigned IOCTL_TIOCRCVFRAME;
-extern unsigned IOCTL_TIOCXMTFRAME;
extern unsigned IOCTL_TIOCPTMGET;
extern unsigned IOCTL_TIOCGRANTPT;
extern unsigned IOCTL_TIOCPTSNAME;
Index: src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_platform_linux.cpp
diff -u src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_platform_linux.cpp:1.3 src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_platform_linux.cpp:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_platform_linux.cpp:1.3 Mon Jul 31 01:44:58 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_platform_linux.cpp Thu Aug 3 01:36:54 2023
@@ -408,6 +408,8 @@ static uptr UnmangleLongJmpSp(uptr mangl
#if SANITIZER_NETBSD
# ifdef __x86_64__
# define LONG_JMP_SP_ENV_SLOT 6
+# elifdef __aarch64__
+# define LONG_JMP_SP_ENV_SLOT 1
# else
# error unsupported
# endif
Index: src/external/gpl3/gcc/lib/Makefile
diff -u src/external/gpl3/gcc/lib/Makefile:1.22 src/external/gpl3/gcc/lib/Makefile:1.23
--- src/external/gpl3/gcc/lib/Makefile:1.22 Tue Aug 1 05:57:56 2023
+++ src/external/gpl3/gcc/lib/Makefile Thu Aug 3 01:36:54 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2023/08/01 05:57:56 mrg Exp $
+# $NetBSD: Makefile,v 1.23 2023/08/03 01:36:54 mrg Exp $
.include <bsd.own.mk>
@@ -11,16 +11,13 @@ SUBDIR+= liblto_plugin
.if (${MKLIBSTDCXX} != "no") && (${MKCXX} != "no")
SUBDIR+= libsupc++ libstdc++-v3
-# XXX needs re-port
-.if 0
SUBDIR+= .WAIT libasan liblsan libubsan
# TSan does not work with 32bit address space and has not been ported
# to all 64-bit architectures.
-.if ${MACHINE} == "amd64"
+.if ${MACHINE} == "amd64" || ${MACHINE_CPU} == "aarch64"
SUBDIR+= libtsan
.endif
-.endif # 0
.endif
Index: src/external/gpl3/gcc/lib/Makefile.sanitizer
diff -u src/external/gpl3/gcc/lib/Makefile.sanitizer:1.16 src/external/gpl3/gcc/lib/Makefile.sanitizer:1.17
--- src/external/gpl3/gcc/lib/Makefile.sanitizer:1.16 Tue Sep 15 05:19:34 2020
+++ src/external/gpl3/gcc/lib/Makefile.sanitizer Thu Aug 3 01:36:54 2023
@@ -1,73 +1,76 @@
-# $NetBSD: Makefile.sanitizer,v 1.16 2020/09/15 05:19:34 mrg Exp $
+# $NetBSD: Makefile.sanitizer,v 1.17 2023/08/03 01:36:54 mrg Exp $
SANITIZER=${GCCDIST}/libsanitizer
.PATH: ${SANITIZER}/interception ${SANITIZER}/sanitizer_common
INTERCEPTION_SRCS= \
-interception_linux.cc \
-interception_mac.cc \
-interception_type_test.cc \
-interception_win.cc
+ interception_linux.cpp \
+ interception_mac.cpp \
+ interception_win.cpp \
+ interception_type_test.cpp
# XXXmknative
SANITIZER_SRCS+= \
- sancov_flags.cc \
- sanitizer_allocator.cc \
- sanitizer_allocator_checks.cc \
- sanitizer_allocator_report.cc \
- sanitizer_common.cc \
- sanitizer_common_libcdep.cc \
- sanitizer_coverage_libcdep_new.cc \
- sanitizer_deadlock_detector1.cc \
- sanitizer_deadlock_detector2.cc \
- sanitizer_errno.cc \
- sanitizer_file.cc \
- sanitizer_flag_parser.cc \
- sanitizer_flags.cc \
- sanitizer_libc.cc \
- sanitizer_libignore.cc \
- sanitizer_linux.cc \
- sanitizer_linux_libcdep.cc \
- sanitizer_linux_s390.cc \
- sanitizer_mac.cc \
- sanitizer_netbsd.cc \
- sanitizer_openbsd.cc \
- sanitizer_persistent_allocator.cc \
- sanitizer_platform_limits_linux.cc \
- sanitizer_platform_limits_netbsd.cc \
- sanitizer_platform_limits_openbsd.cc \
- sanitizer_platform_limits_solaris.cc \
- sanitizer_posix.cc \
- sanitizer_posix_libcdep.cc \
- sanitizer_printf.cc \
- sanitizer_procmaps_bsd.cc \
- sanitizer_procmaps_common.cc \
- sanitizer_procmaps_linux.cc \
- sanitizer_procmaps_mac.cc \
- sanitizer_procmaps_solaris.cc \
- sanitizer_rtems.cc \
- sanitizer_solaris.cc \
- sanitizer_stackdepot.cc \
- sanitizer_stacktrace.cc \
- sanitizer_stacktrace_libcdep.cc \
- sanitizer_stacktrace_printer.cc \
- sanitizer_stacktrace_sparc.cc \
- sanitizer_stoptheworld_linux_libcdep.cc \
- sanitizer_stoptheworld_netbsd_libcdep.cc \
- sanitizer_suppressions.cc \
- sanitizer_symbolizer.cc \
- sanitizer_symbolizer_libbacktrace.cc \
- sanitizer_symbolizer_libcdep.cc \
- sanitizer_symbolizer_mac.cc \
- sanitizer_symbolizer_posix_libcdep.cc \
- sanitizer_symbolizer_report.cc \
- sanitizer_symbolizer_win.cc \
- sanitizer_termination.cc \
- sanitizer_thread_registry.cc \
- sanitizer_tls_get_addr.cc \
- sanitizer_unwind_linux_libcdep.cc \
- sanitizer_unwind_win.cc \
- sanitizer_win.cc
+ sancov_flags.cpp \
+ sanitizer_allocator.cpp \
+ sanitizer_allocator_checks.cpp \
+ sanitizer_allocator_report.cpp \
+ sanitizer_common.cpp \
+ sanitizer_common_libcdep.cpp \
+ sanitizer_coverage_libcdep_new.cpp \
+ sanitizer_deadlock_detector1.cpp \
+ sanitizer_deadlock_detector2.cpp \
+ sanitizer_errno.cpp \
+ sanitizer_file.cpp \
+ sanitizer_flags.cpp \
+ sanitizer_flag_parser.cpp \
+ sanitizer_libc.cpp \
+ sanitizer_libignore.cpp \
+ sanitizer_linux.cpp \
+ sanitizer_linux_libcdep.cpp \
+ sanitizer_linux_s390.cpp \
+ sanitizer_mac.cpp \
+ sanitizer_mac_libcdep.cpp \
+ sanitizer_mutex.cpp \
+ sanitizer_netbsd.cpp \
+ sanitizer_openbsd.cpp \
+ sanitizer_platform_limits_freebsd.cpp \
+ sanitizer_platform_limits_linux.cpp \
+ sanitizer_platform_limits_netbsd.cpp \
+ sanitizer_platform_limits_openbsd.cpp \
+ sanitizer_platform_limits_posix.cpp \
+ sanitizer_platform_limits_solaris.cpp \
+ sanitizer_posix.cpp \
+ sanitizer_posix_libcdep.cpp \
+ sanitizer_printf.cpp \
+ sanitizer_procmaps_bsd.cpp \
+ sanitizer_procmaps_common.cpp \
+ sanitizer_procmaps_linux.cpp \
+ sanitizer_procmaps_mac.cpp \
+ sanitizer_procmaps_solaris.cpp \
+ sanitizer_solaris.cpp \
+ sanitizer_stackdepot.cpp \
+ sanitizer_stacktrace.cpp \
+ sanitizer_stacktrace_libcdep.cpp \
+ sanitizer_stacktrace_sparc.cpp \
+ sanitizer_symbolizer_mac.cpp \
+ sanitizer_symbolizer_report.cpp \
+ sanitizer_stacktrace_printer.cpp \
+ sanitizer_stoptheworld_linux_libcdep.cpp \
+ sanitizer_stoptheworld_netbsd_libcdep.cpp \
+ sanitizer_stoptheworld_mac.cpp \
+ sanitizer_suppressions.cpp \
+ sanitizer_symbolizer.cpp \
+ sanitizer_symbolizer_libbacktrace.cpp \
+ sanitizer_symbolizer_libcdep.cpp \
+ sanitizer_symbolizer_posix_libcdep.cpp \
+ sanitizer_symbolizer_win.cpp \
+ sanitizer_termination.cpp \
+ sanitizer_thread_registry.cpp \
+ sanitizer_tls_get_addr.cpp \
+ sanitizer_unwind_linux_libcdep.cpp \
+ sanitizer_unwind_win.cpp \
+ sanitizer_win.cpp
# The linux build does this to avoid preinit sections on shared libraries
CSHLIBFLAGS+= -DPIC
@@ -77,16 +80,29 @@ SRCS+= ${INTERCEPTION_SRCS} ${SANITIZER_
CPPFLAGS+=-I${SANITIZER}/include -I${SANITIZER}
CPPFLAGS.sanitizer_netbsd.cc+=-I${GCCDIST}/gcc/ginclude
CPPFLAGS+=-D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-CPPFLAGS+=-D__STDC_LIMIT_MACROS -DSANITIZER_HAS_EXCEPTIONS=1
-CPPFLAGS+=-DSANITIZER_NEEDS_SEGV=1
+CPPFLAGS+=-D__STDC_LIMIT_MACROS
+CPPFLAGS+=-DASAN_NEEDS_SEGV=1
+CPPFLAGS+=-DASAN_HAS_CXA_RETHROW_PRIMARY_EXCEPTION=0
#CPPFLAGS+=-DCAN_SANITIZE_UB=0
LIBDPLIBS+= pthread ${.CURDIR}/../../../../../lib/libpthread
-COPTS+=-std=gnu++11 -fsized-deallocation -fvisibility=hidden
-COPTS+=-fno-builtin -fno-exceptions -fno-rtti -funwind-tables
+COPTS+=-fPIC -fno-builtin -fno-exceptions -fno-rtti
+COPTS+=-funwind-tables -fvisibility=hidden -fno-ipa-icf
+#COPTS+=-fsized-deallocation
+COPTS+=-std=gnu++14
+
+# XXX is this mis-compiled, and supposed to be some weak-symbol override thing?
+.for _f in asan_suppressions.cpp sancov_flags.cpp
+#COPTS.${_f}+=-Wno-error=address
+COPTS.${_f}+=-Wno-address
+.endfor
+# XXX
+COPTS.sanitizer_posix.cpp+=-Wno-error=maybe-uninitialized
+COPTS.tsan_rtl_access.cpp+=-Wno-error=maybe-uninitialized
+COPTS.ubsan_handlers_cxx.cpp+=-Wno-error=maybe-uninitialized
-# Can't profile without it`
+# Can't profile without it
#-fomit-frame-pointer
.if ${MACHINE_ARCH} == "vax"
Index: src/external/gpl3/gcc/lib/libasan/Makefile
diff -u src/external/gpl3/gcc/lib/libasan/Makefile:1.33 src/external/gpl3/gcc/lib/libasan/Makefile:1.34
--- src/external/gpl3/gcc/lib/libasan/Makefile:1.33 Mon Sep 14 15:01:57 2020
+++ src/external/gpl3/gcc/lib/libasan/Makefile Thu Aug 3 01:36:55 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.33 2020/09/14 15:01:57 kamil Exp $
+# $NetBSD: Makefile,v 1.34 2023/08/03 01:36:55 mrg Exp $
UNSUPPORTED_COMPILER.clang= # defined
NOSANITIZER= # defined
@@ -12,53 +12,55 @@ NOSANITIZER= # defined
# XXXmknative
ASAN_SRCS= \
- asan_activation.cc \
- asan_allocator.cc \
- asan_debugging.cc \
- asan_descriptions.cc \
- asan_errors.cc \
- asan_fake_stack.cc \
- asan_flags.cc \
- asan_globals.cc \
- asan_interceptors.cc \
- asan_interceptors_memintrinsics.cc \
- asan_linux.cc \
- asan_mac.cc \
- asan_malloc_linux.cc \
- asan_malloc_mac.cc \
- asan_malloc_win.cc \
- asan_memory_profile.cc \
- asan_new_delete.cc \
- asan_poisoning.cc \
- asan_posix.cc \
- asan_report.cc \
- asan_rtl.cc \
- asan_shadow_setup.cc \
- asan_stack.cc \
- asan_stats.cc \
- asan_suppressions.cc \
- asan_thread.cc \
- asan_win.cc \
- asan_win_dll_thunk.cc \
- asan_win_dynamic_runtime_thunk.cc
+ asan_activation.cpp \
+ asan_allocator.cpp \
+ asan_debugging.cpp \
+ asan_descriptions.cpp \
+ asan_errors.cpp \
+ asan_fake_stack.cpp \
+ asan_flags.cpp \
+ asan_globals.cpp \
+ asan_interceptors.cpp \
+ asan_interceptors_memintrinsics.cpp \
+ asan_linux.cpp \
+ asan_mac.cpp \
+ asan_malloc_linux.cpp \
+ asan_malloc_mac.cpp \
+ asan_malloc_win.cpp \
+ asan_memory_profile.cpp \
+ asan_new_delete.cpp \
+ asan_poisoning.cpp \
+ asan_posix.cpp \
+ asan_premap_shadow.cpp \
+ asan_report.cpp \
+ asan_rtl.cpp \
+ asan_shadow_setup.cpp \
+ asan_stack.cpp \
+ asan_stats.cpp \
+ asan_suppressions.cpp \
+ asan_thread.cpp \
+ asan_win.cpp \
+ asan_win_dll_thunk.cpp \
+ asan_win_dynamic_runtime_thunk.cpp \
+ asan_interceptors_vfork.S
LIB= asan
-SRCS+= ${ASAN_SRCS} lsan_common.cc lsan_common_linux.cc
+SRCS+= ${ASAN_SRCS} lsan_common.cpp lsan_common_linux.cpp
LIBDPLIBS+= rt ${NETBSDSRCDIR}/lib/librt
LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm
LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
CPPFLAGS+=-DCAN_SANITIZE_UB=0
.if ${MACHINE_ARCH} == "vax"
-COPTS.asan_allocator.cc += -O1
-COPTS.asan_report.cc += -O1
-COPTS.sanitizer_file.cc += -O1
-COPTS.ubsan_diag.cc += -O1
-COPTS.ubsan_init.cc += -O1
+COPTS.asan_allocator.cpp += -O1
+COPTS.asan_report.cpp += -O1
+COPTS.sanitizer_file.cpp += -O1
+COPTS.ubsan_diag.cpp += -O1
+COPTS.ubsan_init.cpp += -O1
.endif
.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
-COPTS.asan_interceptors.cc += -O1
+COPTS.asan_interceptors.cpp += -O1
.endif
.include <bsd.lib.mk>
Index: src/external/gpl3/gcc/lib/libasan/shlib_version
diff -u src/external/gpl3/gcc/lib/libasan/shlib_version:1.6 src/external/gpl3/gcc/lib/libasan/shlib_version:1.7
--- src/external/gpl3/gcc/lib/libasan/shlib_version:1.6 Wed Oct 2 02:54:34 2019
+++ src/external/gpl3/gcc/lib/libasan/shlib_version Thu Aug 3 01:36:55 2023
@@ -1,2 +1,2 @@
-major=5
+major=6
minor=0
Index: src/external/gpl3/gcc/lib/liblsan/Makefile
diff -u src/external/gpl3/gcc/lib/liblsan/Makefile:1.8 src/external/gpl3/gcc/lib/liblsan/Makefile:1.9
--- src/external/gpl3/gcc/lib/liblsan/Makefile:1.8 Mon Sep 14 15:01:57 2020
+++ src/external/gpl3/gcc/lib/liblsan/Makefile Thu Aug 3 01:36:55 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2020/09/14 15:01:57 kamil Exp $
+# $NetBSD: Makefile,v 1.9 2023/08/03 01:36:55 mrg Exp $
.include <bsd.own.mk>
@@ -8,17 +8,21 @@
.PATH: ${SANITIZER}/lsan ${SANITIZER}/asan
LSAN_SRCS+= \
- lsan.cc \
- lsan_allocator.cc \
- lsan_common.cc \
- lsan_common_linux.cc \
- lsan_interceptors.cc \
- lsan_linux.cc \
- lsan_thread.cc
+ lsan_common.cpp \
+ lsan_common_linux.cpp \
+ lsan_common_mac.cpp \
+ lsan.cpp \
+ lsan_linux.cpp \
+ lsan_mac.cpp \
+ lsan_malloc_mac.cpp \
+ lsan_allocator.cpp \
+ lsan_interceptors.cpp \
+ lsan_thread.cpp \
+ lsan_posix.cpp
.if ${MACHINE_ARCH} == "vax"
-COPTS.lsan_allocator.cc += -O1
-COPTS.sanitizer_file.cc += -O1
+#COPTS.lsan_allocator.cpp += -O1
+#COPTS.sanitizer_file.cpp += -O1
.endif
LIB= lsan
Index: src/external/gpl3/gcc/lib/liblsan/shlib_version
diff -u src/external/gpl3/gcc/lib/liblsan/shlib_version:1.2 src/external/gpl3/gcc/lib/liblsan/shlib_version:1.3
--- src/external/gpl3/gcc/lib/liblsan/shlib_version:1.2 Fri Feb 1 10:31:55 2019
+++ src/external/gpl3/gcc/lib/liblsan/shlib_version Thu Aug 3 01:36:55 2023
@@ -1,2 +1,2 @@
-major=2
+major=3
minor=0
Index: src/external/gpl3/gcc/lib/libtsan/Makefile
diff -u src/external/gpl3/gcc/lib/libtsan/Makefile:1.16 src/external/gpl3/gcc/lib/libtsan/Makefile:1.17
--- src/external/gpl3/gcc/lib/libtsan/Makefile:1.16 Sun Apr 25 23:12:54 2021
+++ src/external/gpl3/gcc/lib/libtsan/Makefile Thu Aug 3 01:36:55 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.16 2021/04/25 23:12:54 christos Exp $
+# $NetBSD: Makefile,v 1.17 2023/08/03 01:36:55 mrg Exp $
UNSUPPORTED_COMPILER.clang= # defined
NOSANITIZER= # defined
@@ -13,44 +13,43 @@ NOCOMPAT= # defined
# XXXmknative
TSAN_SRCS= \
- tsan_clock.cc \
- tsan_debugging.cc \
- tsan_external.cc \
- tsan_fd.cc \
- tsan_flags.cc \
- tsan_ignoreset.cc \
- tsan_interceptors.cc \
- tsan_interceptors_mac.cc \
- tsan_interface_ann.cc \
- tsan_interface_atomic.cc \
- tsan_interface.cc \
- tsan_interface_java.cc \
- tsan_libdispatch_mac.cc \
- tsan_malloc_mac.cc \
- tsan_md5.cc \
- tsan_mman.cc \
- tsan_mutex.cc \
- tsan_mutexset.cc \
- tsan_new_delete.cc \
- tsan_platform_linux.cc \
- tsan_platform_mac.cc \
- tsan_platform_posix.cc \
- tsan_platform_windows.cc \
- tsan_report.cc \
- tsan_rtl.cc \
- tsan_rtl_mutex.cc \
- tsan_rtl_proc.cc \
- tsan_rtl_report.cc \
- tsan_rtl_thread.cc \
- tsan_stack_trace.cc \
- tsan_stat.cc \
- tsan_suppressions.cc \
- tsan_symbolize.cc \
- tsan_sync.cc
+ tsan_clock.cpp \
+ tsan_debugging.cpp \
+ tsan_external.cpp \
+ tsan_fd.cpp \
+ tsan_flags.cpp \
+ tsan_ignoreset.cpp \
+ tsan_interceptors_posix.cpp \
+ tsan_interceptors_mac.cpp \
+ tsan_interface_ann.cpp \
+ tsan_interface_atomic.cpp \
+ tsan_interface.cpp \
+ tsan_interface_java.cpp \
+ tsan_malloc_mac.cpp \
+ tsan_md5.cpp \
+ tsan_mman.cpp \
+ tsan_mutexset.cpp \
+ tsan_new_delete.cpp \
+ tsan_platform_linux.cpp \
+ tsan_platform_mac.cpp \
+ tsan_platform_posix.cpp \
+ tsan_platform_windows.cpp \
+ tsan_report.cpp \
+ tsan_rtl.cpp \
+ tsan_rtl_access.cpp \
+ tsan_rtl_mutex.cpp \
+ tsan_rtl_proc.cpp \
+ tsan_rtl_report.cpp \
+ tsan_rtl_thread.cpp \
+ tsan_stack_trace.cpp \
+ tsan_suppressions.cpp \
+ tsan_symbolize.cpp \
+ tsan_sync.cpp \
+ tsan_vector_clock.cpp
.if ${MACHINE_ARCH} == "x86_64"
TSAN_SRCS+= tsan_rtl_amd64.S
-.elif ${MACHINE_ARCH} == "aarch64"
+.elif ${MACHINE_CPU} == "aarch64"
TSAN_SRCS+= tsan_rtl_aarch64.S
.elif ${MACHINE_MIPS64}
TSAN_SRCS+= tsan_rtl_mips64.S
@@ -66,6 +65,6 @@ LIBDPLIBS+= rt ${NETBSDSRCDIR}/lib/librt
LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm
LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
CPPFLAGS+=-DCAN_SANITIZE_UB=0
-COPTS.tsan_interceptors.cc += -Wno-unused-function
+COPTS.tsan_interceptors.cpp += -Wno-unused-function
.include <bsd.lib.mk>
Index: src/external/gpl3/gcc/lib/libtsan/shlib_version
diff -u src/external/gpl3/gcc/lib/libtsan/shlib_version:1.2 src/external/gpl3/gcc/lib/libtsan/shlib_version:1.3
--- src/external/gpl3/gcc/lib/libtsan/shlib_version:1.2 Fri Feb 1 10:31:55 2019
+++ src/external/gpl3/gcc/lib/libtsan/shlib_version Thu Aug 3 01:36:55 2023
@@ -1,2 +1,2 @@
-major=1
+major=2
minor=0
Index: src/external/gpl3/gcc/lib/libubsan/Makefile
diff -u src/external/gpl3/gcc/lib/libubsan/Makefile:1.20 src/external/gpl3/gcc/lib/libubsan/Makefile:1.21
--- src/external/gpl3/gcc/lib/libubsan/Makefile:1.20 Sat Jun 3 21:31:46 2023
+++ src/external/gpl3/gcc/lib/libubsan/Makefile Thu Aug 3 01:36:55 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2023/06/03 21:31:46 lukem Exp $
+# $NetBSD: Makefile,v 1.21 2023/08/03 01:36:55 mrg Exp $
UNSUPPORTED_COMPILER.clang= # defined
LIBISCXX = yes
@@ -12,22 +12,23 @@ LIBISCXX = yes
# XXXmknative
UBSAN_SRCS= \
- ubsan_diag.cc \
- ubsan_flags.cc \
- ubsan_handlers.cc \
- ubsan_init.cc \
- ubsan_monitor.cc \
- ubsan_type_hash.cc \
- ubsan_type_hash_itanium.cc \
- ubsan_type_hash_win.cc \
- ubsan_value.cc
+ ubsan_diag.cpp \
+ ubsan_flags.cpp \
+ ubsan_handlers.cpp \
+ ubsan_handlers_cxx.cpp \
+ ubsan_init.cpp \
+ ubsan_monitor.cpp \
+ ubsan_type_hash.cpp \
+ ubsan_type_hash_itanium.cpp \
+ ubsan_type_hash_win.cpp \
+ ubsan_value.cpp
.for _s in ubsan_handlers_cxx ubsan_type_hash ubsan_type_hash_itanium
-COPTS.${_s}.cc+=-frtti
+COPTS.${_s}.cpp+=-frtti
.endfor
.if ${MACHINE_ARCH} == "vax"
-COPTS.sanitizer_file.cc += -O1
+COPTS.sanitizer_file.cpp += -O1
.endif
LIB= ubsan
@@ -35,9 +36,9 @@ SRCS+= ${UBSAN_SRCS}
LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm
LIBDPLIBS+= rt ${NETBSDSRCDIR}/lib/librt
LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
-CPPFLAGS+=-DCAN_SANITIZE_UB=1
+CPPFLAGS+=-DCAN_SANITIZE_UB=1 -DUBSAN_CAN_USE_CXXABI=1
# XXX
-COPTS.ubsan_handlers.cc+=${CC_WNO_MAYBE_UNINITIALIZED}
+COPTS.ubsan_handlers.cpp+=${CC_WNO_MAYBE_UNINITIALIZED}
.include <bsd.lib.mk>
Index: src/external/gpl3/gcc/lib/libubsan/shlib_version
diff -u src/external/gpl3/gcc/lib/libubsan/shlib_version:1.5 src/external/gpl3/gcc/lib/libubsan/shlib_version:1.6
--- src/external/gpl3/gcc/lib/libubsan/shlib_version:1.5 Wed Oct 2 02:54:35 2019
+++ src/external/gpl3/gcc/lib/libubsan/shlib_version Thu Aug 3 01:36:55 2023
@@ -1,2 +1,2 @@
-major=4
+major=5
minor=0
Index: src/external/gpl3/gcc/usr.bin/Makefile.inc
diff -u src/external/gpl3/gcc/usr.bin/Makefile.inc:1.37 src/external/gpl3/gcc/usr.bin/Makefile.inc:1.38
--- src/external/gpl3/gcc/usr.bin/Makefile.inc:1.37 Tue Aug 1 05:57:53 2023
+++ src/external/gpl3/gcc/usr.bin/Makefile.inc Thu Aug 3 01:36:55 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.37 2023/08/01 05:57:53 mrg Exp $
+# $NetBSD: Makefile.inc,v 1.38 2023/08/03 01:36:55 mrg Exp $
.ifndef _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_INC_
_EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_INC_=1
@@ -84,4 +84,10 @@ COPTS+=-Wno-narrowing -Wno-unused
# Lots trigger this.
CFLAGS+= -Wno-format-diag
+# Avoid jump tables that don't fit.
+.if ${GCC_MACHINE_ARCH} == "m68000" || ${GCC_MACHINE_ARCH} == "m68k" || \
+ ${GCC_MACHINE_ARCH} == "coldfire"
+COPTS.c-omp.cc+=-fno-jump-tables
+.endif
+
.endif