Commit Graph

2137 Commits

Author SHA1 Message Date
joerg
723199159f Use C++ syntax for defining types, not C one. 2020-02-23 02:06:01 +00:00
fox
02cd2e9449 external/gpl3/gcc: Fix build failure under LLVM.
-Wno-error= flag now only applies to gcc 8 and not to LLVM based builds.

Reviewed by: kamil@
2020-02-12 00:36:37 +00:00
fox
5b7a3dc736 external/gpl3/gcc: Suppress -Werror=format-overflow error.
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@
2020-02-09 08:04:40 +00:00
mrg
86ab731f62 powerpc switched. 2020-02-07 07:16:32 +00:00
joerg
68f38f2c72 Don't implicitly cast away const char * when using correct C++ string.h
implementations. Those have overloaded string operations that preserve
constness.
2020-01-30 20:38:12 +00:00
uwe
109609bc84 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.
2020-01-22 21:39:43 +00:00
mgorny
26a48dd100 Install gcc's unwind.h instead of libexecinfo's
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.
2020-01-22 15:10:31 +00:00
kamil
4f79a48470 Introduce PT_LWPSTATUS + PT_LWPNEXT, obsolete PT_LWPINFO
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@.
2019-12-24 14:50:59 +00:00
rin
f2a119be2e Fix 'nm /dev/ksyms' (noticed by ryo).
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.
2019-11-30 22:50:11 +00:00
mrg
f3e1e5aaf8 note that earm and riscv switched to GCC 8. 2019-11-28 19:31:27 +00:00
christos
54e278d262 more regen stuff. 2019-11-22 14:57:01 +00:00
christos
01b509c1c7 regen x86_64 for i386 support 2019-11-22 01:52:20 +00:00
christos
356e78ed45 add missing files for 32 bit debugging on 64 bit host. 2019-11-22 01:49:20 +00:00
christos
e1c84f8601 Support for compat-32 type shared library paths. 2019-11-22 01:48:50 +00:00
mrg
e881204900 few gcc 8 clean ups:
- 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
2019-11-18 01:13:39 +00:00
mrg
a8b195cdfe note i386 and sparc* conversion. note arm32 issues. 2019-11-16 11:50:58 +00:00
mrg
a782ceec24 duplicate a some of Makefile.gnuhost.
should fix PR#53561.
2019-11-14 09:27:08 +00:00
mrg
5052e4c83f update a bunch of reality. 2019-11-10 10:31:38 +00:00
mrg
2c291b342a oops, regen these again with right iconv prototype present. 2019-11-06 21:33:07 +00:00
mrg
88ed255da2 regen mknative for powerpc and powerpc64. 2019-11-06 19:14:29 +00:00
mrg
96ef73dee0 update the comment above LIB_SPEC to remove 2 wrong things we fixed. 2019-11-06 10:42:00 +00:00
mrg
7c07e1db8f revert the powerpc config.gcc changes i made while merging,
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*.
2019-11-06 09:10:50 +00:00
christos
1bfb63bfe1 regen powerpc64 2019-11-05 20:07:20 +00:00
christos
9c9fe86bc2 - Use EXTRA_SPECS like we did for aarch64 instead of SUBSUBTARGET_EXTRA_SPECS
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
2019-11-05 20:06:41 +00:00
mrg
c3f2d15f93 netbsd/hppa uses 16 byte alignment. the inherited default changed.. 2019-11-03 01:03:30 +00:00
mrg
304edd729a regen mknative for all arm after christos fixes. 2019-10-30 00:07:33 +00:00
skrll
6c41bebf88 G/C 2019-10-29 07:57:29 +00:00
christos
fbb09d761c Add more -O0 files for vax, sort 2019-10-29 02:49:05 +00:00
christos
f3b58f9273 vaxinate sanitizer_file.cc against the optimizer virus. 2019-10-28 16:25:05 +00:00
christos
b83b36aedd remove build output. 2019-10-27 21:07:37 +00:00
christos
c61fe20bc9 add some more machines to the 32 bit part 2019-10-26 18:36:25 +00:00
christos
876570509c Unbreak the sanitizers for gcc. The sanitizer offset defined in
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.
2019-10-25 18:03:59 +00:00
christos
943bd98d5c arm-common.c uses bitmap stuff so put the common-target.a before common.a 2019-10-24 18:48:43 +00:00
christos
741a117e19 arm-common.c needs stack-protector treatment 2019-10-24 18:48:09 +00:00
kamil
77a1ad5f00 Switch the iconv(3) prototype to the POSIX conformant variation
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@.
2019-10-24 18:17:14 +00:00
christos
8cb33180ff mknative tries to build this file with c++ and c++ does not like types
inside offsetof() (a language limitation).
2019-10-24 03:31:38 +00:00
christos
d05d30e64c add new files
XXX: all the arms need regen
2019-10-24 03:26:06 +00:00
christos
ad28d61a37 Since add_debug_regex_map is used in opts-global.c unconditionally, we can't
disable the code with #ifndef __NetBSD__ because it breaks cross-building.
2019-10-23 18:55:36 +00:00
christos
9fb3a182b9 prevent DFmode re-definition. 2019-10-16 15:01:56 +00:00
mrg
4c9e8c010a regen arm ports for config.gcc fix. 2019-10-16 07:38:02 +00:00
mrg
c1069780e3 make sure to include bpabi.h before arm.h. 2019-10-16 07:35:14 +00:00
mrg
669eddb156 use sanitizer_platform_limits_netbsd.cc.
link asan with libm so it can find signgam.

basic libasan works now.
2019-10-13 21:18:20 +00:00
mrg
de11d87641 introduce some common variables for use in GCC warning disables:
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."
2019-10-13 07:28:04 +00:00
mrg
31fd77d90f remove ubsan_handlers_cxx.cc from sources. shouldn't be used with gcc. 2019-10-06 00:15:22 +00:00
maya
6b43361992 We might've switched modes, re-init the move cost table again if necessary.
Fixes unlikely segfault on VAX.
2019-10-04 12:46:43 +00:00
mrg
5e850be408 - update README.gcc8 to include current status
- netbsd/arm64 uses 64 byte malloc alignment
- make lsan compile on sparc*, mips*, ppc and arm64 again
- add missing sparc, alpha and i386 abi compat for struct __sanitizer_addrinfo
- avoid linux includes on arm64
- avoid multiply defined __ubsan_handle_cfi_bad_type when UBSAN_CAN_USE_CXXABI
  isn't defined, and, undefine it
- bad_array_length.cc and bad_array_new.cc lose special build rules
- regen arm64 mknative
2019-10-04 08:51:32 +00:00
christos
0ce1e4fd59 Fix core-dump register fetching. 2019-10-02 15:15:09 +00:00
skrll
c3fbc82630 Remove garbage. Maybe something is wrong with mknative or mrg's script? 2019-10-02 10:34:48 +00:00
mrg
41cead3c75 mknative-gcc for GCC 8.3 and all ports. 2019-10-02 07:14:31 +00:00
mrg
c79e82c597 make most of this compile:
- 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.
2019-10-02 06:51:59 +00:00