Add -Wno-error=format-overflow for c-cppbuiltin.c and c-typeck.c to prevent
build failure.
Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.
Reviewed by: kamil@
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.
The prototypes in libexecinfo's unwind.h do not match those commonly
used (e.g. by gcc, clang, GNU libunwind, LLVM libunwind...), causing
C++ programs to fail to build on type mismatches (e.g. compiler-rt,
libc++abi). Rather than providing our own header, reuse the one
included in gcc.
PT_LWPINFO is a legacy ptrace(2) operation that was originally intended
to retrieve the thread (LWP) information inside a traced process.
It has a number of flaws and is confused with PT_LWPINFO from FreeBSD.
PT_LWPSTATUS and PT_LWPNEXT address the problems (shortly by: rename,
removal of pl_event) and introduces new features: signal context
(pl_sigpend, pl_sigmask), LWP name (pl_name), LWP TLS base address
(pl_private). The private pointer was so far missing information for
a debugger.
PT_LWPSTATUS@nnn is now shipped with core(5) files and contain LWP specific
information, so far missed in the core(5) files.
PT_LWPSTATUS retrieves LWP information for the prompted thread.
PT_LWPNEXT retrieves LWP information for the next thread, borrowing the
semantics from NetBSD specific PT_LWPINFO.
PT_LWPINFO is namespaced with __LEGACY_PT_LWPINFO and still available for
the foreseeable future, without plans of removing it.
Add ATF tests for PT_LWPSTATUS + PT_LWPNEXT.
Keep ATF tests for PT_LWPINFO.
Switch GDB to new API.
Proposed on tech-kern@.
Since binutils 2.15, nm(1) cannot be used for character devices.
We worked around this by a local patch:
http://cvsweb.netbsd.org/bsdweb.cgi/src/gnu/dist/binutils/binutils/Attic/bucomm.c?r1=1.1.1.2&hideattic=0#rev1.2
With recent update of binutils, 'nm /dev/ksyms' got broken again.
This is due to a consistency check involving file size reported by
stat(2), which is always zero for character devices. So, skip this
check if file size is zero.
- port lsan_allocator.h to riscv and ia64.
- remove configure output garbage from ia64/defs.mk
- update README.gcc8 to reality:
- arms mostly work, but not quite
- most ports now build
- some ports have switched
they end up mis-ordering tm files.
revert the rs6000/netbsd64.h change and put it back as
SUBSUBTARGET_EXTRA_SPECS.
this seems to make the build work again, though mknative will
need a re-run for ppc*.
so that assembly specs get propagated (they were lost before)
- adjust the block register padding (like the other OS's) so that code compiles
- XXX: linker still broken for shared libraries because the os specific spec
is not chosen
libsanitizer needs to match with the compiler concept of
TARGET_ASAN_SHADOW_OFFSET, since the compiler generates instructions
to access memory at that offset in the code, and expects the
sanitizer library to have mapped something there. If there is
disagreement, Mr. Segmentation Fault comes and resolves it for you.
Remove const from the 2nd argument.
const char ** and char ** are incompatible types and it was a cost to keep
the technically incompatible form for a more purist variation. NetBSD was
almost the last alive OS to still keep the const argument (known leftovers:
Minix and Illumos).
Keep the const form for the internal purposes inside citrus and rump.
Address the build breakage fallout in the same change.
There are no ABI changes.
Change accepted by core@.
GCC_NO_FORMAT_TRUNCATION -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE -Wno-cast-function-type (GCC 8)
use these to turn off warnings for most GCC-8 complaints. many
of these are false positives, most of the real bugs are already
commited, or are yet to come.
we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
- netbsd/arm64 uses 64 byte malloc alignment
- make lsan compile on sparc*, mips*, ppc and arm64 again
- add missing sparc, alpha and i386 abi compat for struct __sanitizer_addrinfo
- avoid linux includes on arm64
- avoid multiply defined __ubsan_handle_cfi_bad_type when UBSAN_CAN_USE_CXXABI
isn't defined, and, undefine it
- bad_array_length.cc and bad_array_new.cc lose special build rules
- regen arm64 mknative
- sanitizer_procmaps_netbsd.cc is obsolete.
- fix merge botches where upstrem has as slightly different version
is upstream than prior local
- libstdc++ default is now gnu++17
- ubsan needs UBSAN_CAN_USE_CXXABI set
- properly use $G_RTL_BASE_H not (empty) $RTL_BASE_H
- libbackend HH gains new generated insn-modes-inline.h, and read-md.c
gains the HH dep.
- update sanitizer makefiles
also, reduce diffs to upstream:
- remove or1k support
- re-order various lines to match upstream
- move regex map code into file-prefix-map.[ch]
XXX: our change for e500 has moved into 'powerpcspe' port, which has
XXX: been marked deprecated in GCC 8. this may affect what ppc ports
XXX: can update to GCC 8 easily, and we may need to add support for
XXX: 'powerpcspe' while we can.
- many optimisations improved: inter-procedural, profile-directed,
LTO, loops including user-controllable unroll support, and more.
- columns numbers added to line numbers in dwarf
- gcov extended significantly
- many sanitizer updates
- many new warning messages
- many better hints and more useful error messages
- minor ABI changes on x86-64 libstdc++, and some c++17 modes
- draft c++2a features
- better c++17 experimental support
- Armv8.4-A supported, better 8.2-A and 8.3-A support, including
32 bit arm port. cortex a-55, a-75 and a-55.a-75 combo support.
- in the GCC bugzilla, 8.1 shows 1149 bugs fixed, 8.2 shows 100, and
8.3 shows 158.
"VAX does not fully populate the register move costs table, so do not
access it w/o checks.
Hack to work around PR toolchain/53176."
Will commit a more upstream-friendly variant shortly.
Fixes toolchain/54508 by Tobias Ulmer
commit 766f883622ef008230250aa5aecef9fb9b29f233
Author: Alan Hayward <alan.hayward@arm.com>
Date: Tue May 28 10:07:54 2019 +0100
Suppress SIGTTOU when handling errors
Calls to error () can cause SIGTTOU to send gdb to the background.
For example, on an Arm build:
(gdb) b main
Breakpoint 1 at 0x10774: file /build/gdb/testsuite/../../../src/binutils-gdb/gdb/testsuite/gdb.base/watchpoint.c, line 174.
(gdb) r
Starting program: /build/gdb/testsuite/outputs/gdb.base/watchpoint/watchpoint
[1]+ Stopped ../gdb ./outputs/gdb.base/watchpoint/watchpoint
localhost$ fg
../gdb ./outputs/gdb.base/watchpoint/watchpoint
Cannot parse expression `.L1199 4@r4'.
warning: Probes-based dynamic linker interface failed.
Reverting to original interface.
The SIGTTOU is raised whilst inside a syscall during the call to tcdrain.
Fix is to use scoped_ignore_sigttou to ensure SIGTTOU is blocked.
In addition fix include comments - job_control is not included via terminal.h
gdb/ChangeLog:
* event-top.c: Remove include comment.
* inflow.c (class scoped_ignore_sigttou): Move from here...
* inflow.h (class scoped_ignore_sigttou): ...to here.
* ser-unix.c (hardwire_drain_output): Block SIGTTOU during drain.
* top.c: Remove include comment.
When we build netbsd on another OS, we produce a cross compiler without
these definitions.
Fixes some compiler crashes when building netbsd/vax on linux.
- NETBSD_ENABLE_PTHREADS removed (default always)
- HAVE_GNU_INDIRECT_FUNCTION enabled for some platforms
- switch to dragondfly bsd locale routines after christos made them work for us
thread. When attaching to a process that has threads make sure that we
mutate the inferior_ptid (that currently has lwpid == 0 to the first thread
we encounter.
- gdb_assert.h has moved into common/gdb_assert.h.
- force promotion to avoid compile errors
XXX why aren't these files built into the native binary, and
triggered normal build failures.
The latest version of GDB, version 8.3, is available for
download.
This version of GDB includes the following changes and
enhancements:
+ Support for new native configurations (also available as a
target configuration):
o RISC-V GNU/Linux (riscv*-*-linux*)
o RISC-V FreeBSD (riscv*-*-freebsd*)
+ Support for new target configurations:
o CSKY ELF (csky*-*-elf)
o CSKY GNU/Linux (csky*-*-linux)
o NXP S12Z ELF (s12z-*-elf)
o OpenRISC GNU/Linux (or1k*-*-linux*)
+ Native Windows debugging is only supported on Windows XP or
later.
+ The Python API in GDB now requires Python 2.6 or later.
+ GDB now supports terminal styling for the CLI and TUI. Source
highlighting is also supported by building GDB with GNU
Highlight.
+ Experimental support for compilation and injection of C++
source code into the inferior (requires GCC 7.1 or higher,
built with libcp1.so).
+ GDB and GDBserver now support IPv6 connections.
+ Target description support on RISC-V targets.
+ Various enhancements to several commands:
o "frame", "select-frame" and "info frame" commands
o "info functions", "info types", "info variables"
o "info thread"
o "info proc"
o System call alias catchpoint support on FreeBSD
o "target remote" support for Unix Domain sockets.
+ Support for displaying all files opened by a process
+ DWARF index cache: GDB can now automatically save indices of
DWARF symbols on disk to speed up further loading of the same
binaries.
+ Various GDB/MI enhancements.
+ GDBserver on PowerPC GNU/Linux now supports access to the PPR,
DSCR, TAR, EBB/PMU, and HTM registers.
+ Ada task switching support when debugging programs built with
the Ravenscar profile added to aarch64-elf.
+ GDB in batch mode now exits with status 1 if the last executed
command failed.
+ Support for building GDB with GCC's Undefined Behavior
Sanitizer.
See the NEWS file for a more complete and detailed list of what
this release includes.
February 27th, 2019: GDB 8.3 branch created
The GDB 8.3 branch (gdb-8.3-branch) has been created. To check
out a copy of the branch use:
git clone --branch gdb-8.3-branch ssh://sourceware.org/git/binutils-gdb.git
December 23rd, 2018: GDB 8.2.1 Released!
The latest version of GDB, version 8.2.1, is available for
download.
This is a minor corrective release over GDB 8.2, fixing the
following issues:
+ PR build/23516 (gdb build error under msys+mingw: strip can't
handle gdb-add-index.exe)
+ PR build/23623 (install-strip fails)
+ PR rust/23626 (gdb crashes in upstream rust nil-enum test)
+ PR rust/23650 (rust field name access error mentions "foo")
+ PR gdb/23663 (gdb 8.1.1: undefined rpl_stat function with musl
toolchains)
+ PR python/23669 (gdb.execute("show commands") doesn't work)
+ PR python/23714 (Command repetition stops working after
gdb.execute)
+ PR gdb/23838 (8.2 regression for invalid -data-directory)
+ PR gdb/23974 ("info os" crash when specifying invalid object)
+ PR gdb/23999 (SYMBOL_LANGUAGE assertion failure on AIX)
+ PR gdb/24003 (Error when binary searching CUs for a specific
DIE when using DWZ)
September 5th, 2018: GDB 8.2 Released!
The latest version of GDB, version 8.2, is available for
download.
This version of GDB includes the following changes and
enhancements:
+ Support for the following target has been added:
o RiscV ELF (riscv*-*-elf)
+ Support for following targets and native configurations has
been removed:
o m88k running OpenBSD (m88*-*-openbsd*)
o SH-5/SH64 ELF (sh64-*-elf*)
o SH-5/SH64 (sh*)
o SH-5/SH64 running GNU/Linux (sh*-*-linux*)
o SH-5/SH64 running OpenBSD (sh*-*-openbsd*)
+ Various Python API enhancements
+ Aarch64/Linux enhancements:
o SVE support.
o Hardware watchpoints improvements for entities stored at
unaligned addresses.
# New "c" response to disable the pager for the rest
of the current command.
# C expressions can now use _Alignof, and C++
expressions can now use alignof.
# Improved flexibility for loading symbol files.
# The 'info proc' command nows works on running
processes on FreeBSD systems as well as core files
created on FreeBSD systems.
# A new --enable-codesign=CERT configure option to
automatically codesign GDB after build (useful on
MacOS X).
See the NEWS file for a more complete and detailed list
of what this release includes.
July 31st, 2018: GDB 8.1.1 Released!
The latest version of GDB, version 8.1.1, is available
for download.
This is a minor corrective release over GDB 8.1, fixing
the following issues:
# PR gdb/22824 (misleading description of new rbreak
Python function in GDB 8.1 NEWS file)
# PR gdb/22849 (ctrl-c doesn't work in
extended-remote)
# PR gdb/22907 ([Regression] gdbserver doesn't work
with filename-only binaries)
# PR gdb/23028 (inconsistent disassemble of vcvtpd2dq)
# PR gdb/23053 (Fix -D_GLIBCXX_DEBUG gdb-add-index
regression)
# PR gdb/23127 ([AArch64] GDB cannot be used for
debugging software that uses high Virtual Addresses)
# PR server/23158 (gdbserver no longer functional on
Windows)
# PR breakpoints/23210 ([8.1/8.2 Regression] Bogus
Breakpoint address adjusted from 0xf7fe7dd3 to
0xfffffffff7fe7dd3)
July 4th, 2018: GDB 8.2 branch created
The GDB 8.2 branch (gdb-8.2-branch) has been created. To
check out a copy of the branch use:
git clone --branch gdb-8.2-branch ssh://sourceware.org/git/binutils-gdb.git
January 31st, 2018: GDB 8.1 Released!
The latest version of GDB, version 8.1, is available for
download.
Changes in this release include:
# Breakpoints on C++ functions are now set on all
scopes by default ("wild" matching);
# Support for inserting breakpoints on functions
marked with C++ ABI tags;
# Target floating-point arithmetic emulation during
expression evaluation (requires MPFR 3.1 or later);
# Various Python Scripting enhancements;
# Improved Rust support; in particular, Trait objects
can now be inspected when debugging Rust code;
# GDB no longer makes assumptions about the type of
symbols without debugging information to avoid
producing erroneous and often confusing results;
# The 'enable' and 'disable' commands now accept a
range of breakpoint locations;
# New 'starti' command to start the program at the
first instruction;
# New 'rbreak' command to insert a number of
breakpoints via a regular expression pattern
(requires Python);
# The 'ptype' command now supports printing the offset
and size of the fields in a struct;
# The 'gcore' command now supports dumping all the
memory mappings ('-a' command-line option);
# New shortcuts for TUI Single-Key mode: 'i' for
stepi, and 'o' for nexti;
# GDBserver enhancements:
@ Support for transmitting environment variables
to GDBserver;
@ Support for starting inferior processes with a
specified initial working directory;
@ On Unix systems, support for globbing expansion
and variable substitution of inferior
command-line arguments;
# Various completion enhancements;
# The command used to compile and inject code with the
'compile' command is now configurable;
# New '--readnever' command-line option to speed the
GDB startup when debugging information is not
needed;
# Support for the following new native configurations:
@ FreeBSD/aarch64 (aarch64*-*-freebsd*);
@ FreeBSD/arm (arm*-*-freebsd*);
# Support for the following new targets:
@ FreeBSD/aarch64 (aarch64*-*-freebsd*);
@ FreeBSD/arm (arm*-*-freebsd*);
@ OpenRISC ELF (or1k*-*-elf)
# Removed support for the following targets and native
configurations:
@ Solaris2/x86 (i?86-*-solaris2.[0-9]);
@ Solaris2/sparc (sparc*-*-solaris2.[0-9]);
See the NEWS file for a more complete and detailed list
of what this release includes.
January 5th, 2018: GDB 8.1 branch created
The GDB 8.1 branch (gdb-8.1-branch) has been created. To
check out a copy of the branch use:
git clone --branch gdb-8.1-branch ssh://sourceware.org/git/binutils-gdb.git
November 1st, 2017: Debugging Tools Devroom at FOSDEM 2018
We will have a Debugging Tools Devroom at FOSDEM 2018.
The Call for Participation has recently been announced.
The Devroom is on the first of the two FOSDEM days, on
Saturday 3 Feb 2018. See you all at FOSDEM in Brussels!
September 7th, 2017: GDB 8.0.1 Released!
The latest version of GDB, version 8.0.1, is available
for download.
This is a minor corrective release over GDB 8.0, fixing
the following issues:
# PR breakpoint/21886 (Compressed MIPS code debugging
impossible due to memory breakpoint misplacement)
# PR symtab/22002 (Assertion on debuggee built with
-gdwarf-5 -fdebug-types-section)
GDB News (p6 of 30)
# PR symtab/22003 (Incompatibility with -gdwarf-5 -
DW_FORM_implicit_const)
# PR gdb/22046 (Regression on older kernels for T
(stopped) processes)
# PR sim/20863 (gdb-7.12 powerpc-rtems4.12-gdb does
not build on FreeBSD)
# PR breakpoint/21555 ("error re-setting breakpoint"
on PIE executables)
# PR tdep/21717 ("print $fpscr" says "" until some VFP
data register is printed)
# PR exp/21827 (Regression: gdb command lookup became
case-sensitive; but definitions are forced into
lowercase)
# PR remote/22021 (Multi-arch exec fails with a remote
target)
Changes:
- always perform polling on inferior_ptid, never -1
-1 can cause catching fork/vfork events in random order
polling on pid will guarantee to report events in expected order
- assume availability of KERN_PROC_PATHNAME
- drop dead code for KERN_PROC_AUXV (FreeBSD-specific sysctl)
AUXV on NetBSD is handled with PIOD_READ_AUXV
- drop unused nbsd_fetch_kinfo_proc
- drop unneeded hacks for fork/vfork code
- drop support for FreeBSD specific flags returned for PT_LWPINFO
NetBSD uses PT_GET_SIGINFO / PT_GET_PROCESS_STATE for most pieces of
information
- port nbsd_thread_name to NetBSD
- enable LWP and FORK events in nbsd_enable_proc_events
- use NetBSD new batteries for distinguishing event type in to_wait
map most events into GDB types
breakpoint, single step, hw breakpoint/watchpoint ones are still not
used with the full power here
- add support for EXEC events
- clean up
This change makes GDB functional with threaded code and it is good enough
to pass t_regress / threads test.
It's possible to execute and step processes with multiple threads, use
scheduler-lock, follow-fork etc features.
What does not work:
- the LWP EXIT event and wait() are not synchronized and can deadlock
this has been observed with exiting go applications
- GDB VFORK code is still disabled and awaits kernel fixing
Short term goal is to correct LWP EXIT and follow up with VFORK fixes.
Long term goal is to rewrite NetBSD GDB support and write new support in
the remote process plugin (gdb-server) framework.
PR kern/53120
PR port-arm/51677
PR bin/54060
PR bin/49662
PR kern/52548
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.
libstdc++ and enable it for now only for the random archives but not for the
shared object (although it does not break anything that I've tested to enable
it for the shared object too). Fixes static linking, which does not handle
multiple versioned symbols properly.
- for riscv64-*netbsd* hosts and 32 bit target, set LIB_PATH
- build the other target emulations for riscv32 on riscv64
- regen riscv64 mknative for ld updates
- make LINK_SPEC more like other multi-line string defines
- update multilib stuff for GCC 7 riscv -- -m32/-m64 gone, -mabi and
-march now decide between several options
- define *intptr_t in terms of 'long int' always
- move fixtfdi.c, fixunstfdi.c, floatditf.c, and floatunditf.c into t-netbsd64
- remove duplicated riscv case in config.gcc, reducing upstream diff as well
- regen riscv64 mknative
we've been building dp-bit.c and fp-bit.c backwards, but as they
use the same input source, they just had opposite objects and
the right total was provided. oops.
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.
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)
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
(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.
note vax atf fails same as GCC 6. hppa mostly works but has an
atf issue also unrelated to the compiler version
note ia64 mostly builds, but the kernel fails earlier than GCC 6.
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.
unfortunately, we attempted to do this for netbsd-8 but we did
not actually end up having any ABI incompatibility with that,
as turning off dual ABI in libstdc++ means *only* enabling the
old ABI. however, enabling dual ABI with C11 defaults (ie,
a forward looking ABI) *is* an ABI-change for some special
cases and thus we should have bumped this a couple of weeks
ago when we re-enabled dual ABI.
call this "nb3 20190319".
mknative-gcc regen all switched ports and almost all of the
unswitched ports.
duplicate symbols on netbsd. see PR#54027.
with this disabled, turn on using the symver-config.h for the
gnu.ver processing so that other defines are handled.
fix some depends for gnu.ver processing.
crtbegin.o has a read-only .eh_frame, and libstdc++ builds.
2017-09-01 Joerg Sonnenberger <joerg@bec.de>
Jeff Law <law@redhat.com>
* 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 <jakub@redhat.com>
PR target/83100
* varasm.c (bss_initializer_p): Return true for DECL_COMMON
TREE_READONLY decls.
2018-02-09 Jakub Jelinek <jakub@redhat.com>
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.
having dozens of copies of the same thing in the tree.
- don't fetch any gthr*.h files.
- delete ancient gthr-tpf.h that was removed in GCC 4.8 or so.
this should fix the call_once tests for real now.
- sun2 an vax build now
- mips*, powerpc, and sparc64 are ready to switch
- mac68k has an untested and an uncommited change to build
- everything else except ia64 and powerpc64 builds