$NetBSD: README.gcc12,v 1.29 2024/09/23 10:28:54 rin Exp $


new stuff:
       libmpx
       liboffloadmic
       libvtv
       libcet
       libphobos
       d
       gfortran
       libbacktrace: +dwarf5_CFLAGS = $(libbacktrace_TEST_CFLAGS) -gdwarf-5
       c++tools

todo:
       - audit all uses of new warning-disable variables and
         convert some from -Wno- to -Wno-error=

arch/feature list.

tools:          does build.sh tools work?
kernels:        does a kernel run?  y (yes), b (builds/ready), p (partially), ? (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?  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)


architecture    tools   kernels libgcc  native-gcc/sani make release    runs    atf     switched
------------    -----   ------- ------  --------------- ------------    ----    ---     --------
aarch64         y       y       y       y       y[17]   y               y       y       y
aarch64eb       y       y       y       y       y[17]   y               y       y       y
alpha           y       y       y       y       b       y               y       y       y
earmv4          y       b       ?       y       ?       ?               ?       ?       y
earmv4eb        y       b       ?       y       ?       ?               ?       ?       y
earmv5          y       y       y       y       b       y               y       y       y
earmv5eb        y       y       y       y       b       y               y       y       y
earmv5hf        y       b       ?       y       ?       ?               ?       ?       y
earmv5hfeb      y       b       ?       y       ?       ?               ?       ?       y
earmv6          y       b       ?       y       ?       ?               ?       ?       y
earmv6eb        y       b       ?       y       ?       ?               ?       ?       y
earmv6hf        y       y       y       y       b       y               y       y       y
earmv6hfeb      y       y       y       y       b       y               y       y       y
earmv7          y       b       y       y       ?       ?               ?       ?       y
earmv7eb        y       b       ?       y       ?       ?               ?       ?       y
earmv7hf        y       y       y       y       b       y               y       y       y
earmv7hfeb      y       y       y       y       b       y               y       y       y
hppa            y       y       y       y       ?       y               y       y       y
i386            y       y       y       y       y       y               y       y       y
ia64            y       b       y       y       y       y               y[3]    n       y
m68000          y       y       y       y       b       n               y[14]   ?       y
m68k            y       y       y       y       b       y               y[14]   y[14]   y
mipseb          y       b       y       y       b       y               y       y       y
mipsel          y       b       y       y       b       y               y       ?       y
mips64eb        y       b       y       y       b       y               y       y       y
mips64el        y       b       y       y       b       y               y       ?       y
powerpc         y       y       y       y       y       y               y       y       y
powerpc64       y       ?       ?       y       b       b               ?       ?       y
sh3eb           y       ?       y       y       b       y               ?       ?       y
sh3el           y       y       y       y       b       y               y       y       y
sparc           y       y       y       y       n[26]   y               y       y       y
sparc64         y       b       y       y       n[16]   y               y       ?       y
vax             y       y       y       y       n[23]   n               n[24,25] ?      ?
x86_64          y       y       y       y       y[13]   y               y       y       y
riscv32         y       y       y       y       b       y               n[2]    ?       y
riscv64         y       y       y       y       b       y               y       y       y
------------    -----   ------- ------  --------------- ------------    ----    ---
architecture    tools   kernels libgcc  native-gcc/sani make release    runs    atf

[2]: riscv32 kernels are not really implemented yet, not GCC 12 issue.
[3]: GENERIC.SKI boots just as well as GCC 10.
[13]: on amd64, with very basic test, lsan, ubsan, and asan work, but tsan crashes at start up:
     ThreadSanitizer: CHECK failed: tsan_rtl.cpp:149 "((reinterpret_cast<uptr>(this) % 64)) == ((0))" (0x10, 0x0) (tid=21499)
     ThreadSanitizer:DEADLYSIGNAL
     ==21499==ERROR: ThreadSanitizer: SEGV on unknown address 0x000000000017 (pc 0x7f7ff4e5e14e bp 0x7f7fffffdbd0 sp 0x7f7fffffdb40 T21499)
     ==21499==The signal is caused by a READ memory access.
     ==21499==Hint: address points to the zero page.
     ThreadSanitizer:DEADLYSIGNAL
     ThreadSanitizer: nested bug in the same thread, aborting.
[14]: "dd count=1", "env LC_CTYPE=en_US.UTF-8 locale", and "tests/crypto/libcrypto/h_evp_test evpmd_blake.txt" abort.
     adding -fno-stack-protector to strsuftoll.c, citrus_module.c, and blake2_prov.c, respectively, works around the problem.
     -- workarounds commited.
[16]: sanitizers crash early:
     Program received signal SIGSEGV, Segmentation fault.
     (gdb) bt
     #0  0x000000004064265c in __sanitizer::CheckASLR () at /usr/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cpp:2181
     #1  0xffffffffffffc704 in ?? ()
     Backtrace stopped: previous frame identical to this frame (corrupt stack?)
     -- some wip patches make this less bad
[17]: (NOT A REGRESSION) libtsan is newly introduced, which fails with:
     FATAL: ThreadSanitizer: unexpected memory mapping 0x200100000-0x200101000
[23]: sanitizers fail to build:
     sanitizer_flag_parser.h:141:72: error: format '%zx' expects argument of type 'size_t', but argument 4 has type 'unsigned int' [-Werror=format=]
[24]: (NOT A REGRESSION) c++ exception handling is broken. mechanically applying
     http://www.execsw.org/netbsd/changeset.cgi?id=20140318T234341Z.c59ac4642e7d4b345f6dc5aa9887e9e1f9aa459a#src/gnu/dist/gcc4/gcc/config/vax/vax.c
     does not help (with adjustments for gcc 10.5.0, which is broken, too):
     (gdb) invalid-command
     [1]   Illegal instruction (core dumped) gdb
[25]: (maybe not related to [24]) native gcc is broken:
     simh# cc hello.c
     during RTL pass: final
     hello.c: In function 'main':
     hello.c:9:1: internal compiler error: Segmentation fault
[26]: divide by zero with ubsan hits CheckLocked assertion failure, and stalls at LockSlow indefinitely:
     (gdb) bt
     #0 __sanitizer::StaticSpinMutex::LockSlow at sanitizer_mutex.cpp:24
     ...
     #17 __ubsan::ScopedReport::CheckLocked ubsan_diag.h:255
     #18 __ubsan::Diag::~Diag ubsan_diag.cpp:347
     #19 handleDivremOverflowImpl ubsan_diag.h:210
     #20 __ubsan::__ubsan_handle_divrem_overflow ubsan_handlers.cpp:320


CPU vs platform test table (for CPUs with multiple ports).  this is "make release" or just kernels.
values:         y (yes), k (kernels only), n (failed), r (running), ? (not attempted), nx (yes, no x11), nk (no kernels available)

CPU             platform list
---             -------- ----
               acorn32         cats    epoc32  evbarm-eb       evbarm-el       hpcarm          iyonix          netwinder       shark           zaurus
earmv4:         k               k       k       k               k               k                               k               y
earm:                                           nx              nx                              k                                               k
earmhf:                                         k               k
earmv6:                                         k               k
earmv6hf:                                       nx              nx
earmv7:                                         k               k
earmv7hf:                                       nx              nx

               amiga           atari   cesfic  hp300           luna68k         mac68k          mvme68k         news68k         next68k         sun3    x68k
m68k:           nx              k       k       k               k               nx              k               k               k               nx      k

               evbmips         emips           ews4800mips     mipsco          newsmips        sgimips
mipseb:         k               k               k               k               k               y

               evbmips         algor           arc             cobalt          hpcmips         pmax
mipsel:         k               k               k               k               k               y

               algor           evbmips         pmax
mips64eb:                       y
mips64el:       k               y               y

               amigappc        bebox   evbppc  ibmnws          macppc          mvmeppc         ofppc           prep            rs6000          sandpoint
powerpc:        k               k       k       k               y               k               k               k               k               k

               evbppc          macppc          ofppc
powerpc64:      nk              nk              nk

               dreamcast       evbsh3          hpcsh           landisk         mmeye
sh3eb:                          y                                               k
sh3el:          k               y               k               k