• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

dist/07-Feb-2025-6,025,9904,670,976

lib/06-May-2025-168,91770,847

usr.bin/07-Feb-2025-226,289154,377

MakefileD12-Feb-2019138 83

Makefile.autobuild_hD01-Aug-20231.2 KiB4329

Makefile.gcc_pathD12-Sep-2018405 197

Makefile.hooksD07-Feb-2025841 2919

Makefile.version_hD01-Aug-20231.7 KiB6749

README.gcc12D23-Sep-20246 KiB153134

README.warningsD07-Feb-20255.3 KiB172108

gcc2gcc.oldD27-Feb-20141.3 KiB6440

gcc2netbsdD07-Feb-20252.3 KiB8644

README.gcc12

1$NetBSD: README.gcc12,v 1.29 2024/09/23 10:28:54 rin Exp $
2
3
4new stuff:
5          libmpx
6          liboffloadmic
7          libvtv
8          libcet
9          libphobos
10          d
11          gfortran
12          libbacktrace: +dwarf5_CFLAGS = $(libbacktrace_TEST_CFLAGS) -gdwarf-5
13          c++tools
14
15todo:
16          - audit all uses of new warning-disable variables and
17            convert some from -Wno- to -Wno-error=
18
19arch/feature list.
20
21tools:              does build.sh tools work?
22kernels:  does a kernel run?  y (yes), b (builds/ready), p (partially), ? (not ready)
23libgcc:             does libgcc build?
24native-gcc:         does a full mknative-gcc complete?
25sani:               has sanitizer been ported to this CPU again for GCC 12?  b (build) y (works)
26make release:       does build.sh release complete?  (before sanitizer - bs)
27runs:               does the system boot with a full world?
28atf:                does atf run / compare well
29switched: has port switched?  y (yes), n (no/ready), ? (not ready)
30
31
32architecture        tools     kernels   libgcc    native-gcc/sani     make release        runs      atf       switched
33------------        -----     -------   ------    ---------------     ------------        ----      ---       --------
34aarch64             y         y         y         y         y[17]     y                   y         y         y
35aarch64eb y         y         y         y         y[17]     y                   y         y         y
36alpha               y         y         y         y         b         y                   y         y         y
37earmv4              y         b         ?         y         ?         ?                   ?         ?         y
38earmv4eb  y         b         ?         y         ?         ?                   ?         ?         y
39earmv5              y         y         y         y         b         y                   y         y         y
40earmv5eb  y         y         y         y         b         y                   y         y         y
41earmv5hf  y         b         ?         y         ?         ?                   ?         ?         y
42earmv5hfeb          y         b         ?         y         ?         ?                   ?         ?         y
43earmv6              y         b         ?         y         ?         ?                   ?         ?         y
44earmv6eb  y         b         ?         y         ?         ?                   ?         ?         y
45earmv6hf  y         y         y         y         b         y                   y         y         y
46earmv6hfeb          y         y         y         y         b         y                   y         y         y
47earmv7              y         b         y         y         ?         ?                   ?         ?         y
48earmv7eb  y         b         ?         y         ?         ?                   ?         ?         y
49earmv7hf  y         y         y         y         b         y                   y         y         y
50earmv7hfeb          y         y         y         y         b         y                   y         y         y
51hppa                y         y         y         y         ?         y                   y         y         y
52i386                y         y         y         y         y         y                   y         y         y
53ia64                y         b         y         y         y         y                   y[3]      n         y
54m68000              y         y         y         y         b         n                   y[14]     ?         y
55m68k                y         y         y         y         b         y                   y[14]     y[14]     y
56mipseb              y         b         y         y         b         y                   y         y         y
57mipsel              y         b         y         y         b         y                   y         ?         y
58mips64eb  y         b         y         y         b         y                   y         y         y
59mips64el  y         b         y         y         b         y                   y         ?         y
60powerpc             y         y         y         y         y         y                   y         y         y
61powerpc64 y         ?         ?         y         b         b                   ?         ?         y
62sh3eb               y         ?         y         y         b         y                   ?         ?         y
63sh3el               y         y         y         y         b         y                   y         y         y
64sparc               y         y         y         y         n[26]     y                   y         y         y
65sparc64             y         b         y         y         n[16]     y                   y         ?         y
66vax                 y         y         y         y         n[23]     n                   n[24,25] ?          ?
67x86_64              y         y         y         y         y[13]     y                   y         y         y
68riscv32             y         y         y         y         b         y                   n[2]      ?         y
69riscv64             y         y         y         y         b         y                   y         y         y
70------------        -----     -------   ------    ---------------     ------------        ----      ---
71architecture        tools     kernels   libgcc    native-gcc/sani     make release        runs      atf
72
73[2]: riscv32 kernels are not really implemented yet, not GCC 12 issue.
74[3]: GENERIC.SKI boots just as well as GCC 10.
75[13]: on amd64, with very basic test, lsan, ubsan, and asan work, but tsan crashes at start up:
76      ThreadSanitizer: CHECK failed: tsan_rtl.cpp:149 "((reinterpret_cast<uptr>(this) % 64)) == ((0))" (0x10, 0x0) (tid=21499)
77      ThreadSanitizer:DEADLYSIGNAL
78      ==21499==ERROR: ThreadSanitizer: SEGV on unknown address 0x000000000017 (pc 0x7f7ff4e5e14e bp 0x7f7fffffdbd0 sp 0x7f7fffffdb40 T21499)
79      ==21499==The signal is caused by a READ memory access.
80      ==21499==Hint: address points to the zero page.
81      ThreadSanitizer:DEADLYSIGNAL
82      ThreadSanitizer: nested bug in the same thread, aborting.
83[14]: "dd count=1", "env LC_CTYPE=en_US.UTF-8 locale", and "tests/crypto/libcrypto/h_evp_test evpmd_blake.txt" abort.
84      adding -fno-stack-protector to strsuftoll.c, citrus_module.c, and blake2_prov.c, respectively, works around the problem.
85      -- workarounds commited.
86[16]: sanitizers crash early:
87      Program received signal SIGSEGV, Segmentation fault.
88      (gdb) bt
89      #0  0x000000004064265c in __sanitizer::CheckASLR () at /usr/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cpp:2181
90      #1  0xffffffffffffc704 in ?? ()
91      Backtrace stopped: previous frame identical to this frame (corrupt stack?)
92      -- some wip patches make this less bad
93[17]: (NOT A REGRESSION) libtsan is newly introduced, which fails with:
94      FATAL: ThreadSanitizer: unexpected memory mapping 0x200100000-0x200101000
95[23]: sanitizers fail to build:
96      sanitizer_flag_parser.h:141:72: error: format '%zx' expects argument of type 'size_t', but argument 4 has type 'unsigned int' [-Werror=format=]
97[24]: (NOT A REGRESSION) c++ exception handling is broken. mechanically applying
98      http://www.execsw.org/netbsd/changeset.cgi?id=20140318T234341Z.c59ac4642e7d4b345f6dc5aa9887e9e1f9aa459a#src/gnu/dist/gcc4/gcc/config/vax/vax.c
99      does not help (with adjustments for gcc 10.5.0, which is broken, too):
100      (gdb) invalid-command
101      [1]   Illegal instruction (core dumped) gdb
102[25]: (maybe not related to [24]) native gcc is broken:
103      simh# cc hello.c
104      during RTL pass: final
105      hello.c: In function 'main':
106      hello.c:9:1: internal compiler error: Segmentation fault
107[26]: divide by zero with ubsan hits CheckLocked assertion failure, and stalls at LockSlow indefinitely:
108      (gdb) bt
109      #0 __sanitizer::StaticSpinMutex::LockSlow at sanitizer_mutex.cpp:24
110      ...
111      #17 __ubsan::ScopedReport::CheckLocked ubsan_diag.h:255
112      #18 __ubsan::Diag::~Diag ubsan_diag.cpp:347
113      #19 handleDivremOverflowImpl ubsan_diag.h:210
114      #20 __ubsan::__ubsan_handle_divrem_overflow ubsan_handlers.cpp:320
115
116
117CPU vs platform test table (for CPUs with multiple ports).  this is "make release" or just kernels.
118values:             y (yes), k (kernels only), n (failed), r (running), ? (not attempted), nx (yes, no x11), nk (no kernels available)
119
120CPU                 platform list
121---                 -------- ----
122                    acorn32             cats      epoc32    evbarm-eb evbarm-el hpcarm              iyonix              netwinder shark               zaurus
123earmv4:             k                   k         k         k                   k                   k                                       k                   y
124earm:                                                       nx                  nx                                      k                                                           k
125earmhf:                                                     k                   k
126earmv6:                                                     k                   k
127earmv6hf:                                         nx                  nx
128earmv7:                                                     k                   k
129earmv7hf:                                         nx                  nx
130
131                    amiga               atari     cesfic    hp300               luna68k             mac68k              mvme68k             news68k             next68k             sun3      x68k
132m68k:               nx                  k         k         k                   k                   nx                  k                   k                   k                   nx        k
133
134                    evbmips             emips               ews4800mips         mipsco              newsmips  sgimips
135mipseb:             k                   k                   k                   k                   k                   y
136
137                    evbmips             algor               arc                 cobalt              hpcmips             pmax
138mipsel:             k                   k                   k                   k                   k                   y
139
140                    algor               evbmips             pmax
141mips64eb:                     y
142mips64el: k                   y                   y
143
144                    amigappc  bebox     evbppc    ibmnws              macppc              mvmeppc             ofppc               prep                rs6000              sandpoint
145powerpc:  k                   k         k         k                   y                   k                   k                   k                   k                   k
146
147                    evbppc              macppc              ofppc
148powerpc64:          nk                  nk                  nk
149
150                    dreamcast evbsh3              hpcsh               landisk             mmeye
151sh3eb:                                  y                                                           k
152sh3el:              k                   y                   k                   k
153

README.warnings

1$NetBSD: README.warnings,v 1.5 2023/08/08 11:50:22 riastradh Exp $
2
3What to do about GCC warnings and NetBSD.
4
5
6New GCC releases always come with a host of new warnings and
7each new warning can find real bugs, find odd code, or simply
8be a pain of new useless warnings, or all three and more.
9
10As each warning has its own set of issues they each have their
11own section and it is expected that this document will be
12modified for updates to warnings and new warnings.
13
14
15<bsd.own.mk> provides several variables for use in Makefiles:
16   COPTS.foo.c += ${CC_WNO_FORMAT_TRUNCATION}
17   COPTS.foo.c += ${CC_WNO_FORMAT_OVERFLOW}
18   COPTS.foo.c += ${CC_WNO_STRINGOP_OVERFLOW}
19   COPTS.foo.c += ${CC_WNO_STRINGOP_TRUNCATION}
20   COPTS.foo.c += ${CC_WNO_CAST_FUNCTION_TYPE}
21   COPTS.foo.c += ${CC_WNO_IMPLICIT_FALLTHROUGH}
22   COPTS.foo.c += ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
23   COPTS.foo.c += ${CC_WNO_MAYBE_UNINITIALIZED}
24   COPTS.foo.c += ${CC_WNO_RETURN_LOCAL_ADDR}
25   COPTS.foo.c += ${CC_WNO_MISSING_TEMPLATE_KEYWORD}
26   COPTS.foo.c += ${CC_WNO_STRINGOP_OVERREAD}
27   COPTS.foo.c += ${CC_WNO_REGISTER}
28   COPTS.foo.c += ${CC_WNO_ARRAY_BOUNDS}
29
30
31new GCC 12 warnings:
32
33  -Wno-missing-template-keyword
34
35      This warning trips on older C++ code, and should only be applyed to 3rd
36      party code.
37
38      bsd.own.mk variable: ${CC_WNO_MISSING_TEMPLATE_KEYWORD}
39
40  -Wno-stringop-overread
41
42      This warning triggers when array bounds appear to be exceeded.  There
43      maybe some bugs related to this warning in GCC 12.
44
45      bsd.own.mk variable: ${CC_WNO_STRINGOP_OVERREAD}
46
47  -Wno-register
48
49      This warning triggers in C++17 mode where 'register' has been removed,
50      and should only be applied to 3rd party code.
51
52      bsd.own.mk variable: ${CC_WNO_REGISTER}
53
54  -Wno-array-bounds
55
56      This warning triggers with a number of code issues that tend to be real
57      problem but require careful adjustments to fix properly, when there are
58      platform related accesses beyond the immediately size and address of
59      known variables (real bugs to fix), but also may trigger when passing
60      C arrays vs C pointers to functions, often incorrectly.  See
61          https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110878
62
63      bsd.own.mk variable: ${CC_WNO_ARRAY_BOUNDS}
64
65
66new GCC 10 warnings:
67
68  GCC 10 switched the default from "-fcommon" to "-fno-common",
69  which can cause multiply defined symbol issues.  Ideally we
70  fix all of these, but "-fcommon" can be used otherwise.
71
72  -Wno-maybe-uninitialized
73
74      This warning was introduced in an ancient GCC but was
75      significantly enhanced in GCC 10, unfortunately, many of
76      the new instances are incorrect.
77
78      bsd.own.mk variable: ${CC_WNO_MAYBE_UNINITIALIZED}
79
80  -Wno-return-local-addr
81
82      This warning was introduced in GCC 5 and was enhanced in GCC
83      10.  Unfortunately, the new instances are failing to correctly
84      analyze code flow and miss that most of the are handled.
85
86      bsd.own.mk variable: ${CC_WNO_RETURN_LOCAL_ADDR}
87
88
89new GCC 9 warnings:
90
91  -Wno-address-of-packed-member
92
93      This warning was introduced in GCC 8.
94      This warning is similar to -Wformat-truncation, but for the
95      general family of string functions (str*(), etc.), and has
96      similar issues of false positives.
97
98      bsd.own.mk variable: ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
99
100
101new GCC 8 warnings:
102
103  -Wstringop-truncation
104
105      This warning was introduced in GCC 8.
106      This warning is similar to -Wformat-truncation, but for the
107      general family of string functions (str*(), etc.), and has
108      similar issues of false positives.
109
110      bsd.own.mk variable: ${CC_WNO_STRINGOP_TRUNCATION}
111
112
113  -Wcast-function-type
114
115      This warning was introduced in GCC 8.
116      This warning can find real problems.  Most instances are
117      false positives, and hopefully this warning will become
118      more useful in the future.  See __FPTRCAST().
119
120      bsd.own.mk variable: ${CC_WNO_CAST_FUNCTION_TYPE}
121
122
123new GCC 7 warnings:
124
125  -Wstringop-overflow
126
127      This warning was introduced in GCC 7.
128      This warning can find issues where source length is
129      passed as destination length (eg, strncpy() where the
130      length is strlen(src)) that are potential buffer overflow
131      cases and should always be inspected, but false positives
132      are also seen.
133
134      bsd.own.mk variable: ${CC_WNO_STRINGOP_OVERFLOW}
135
136
137  -Wformat-truncation
138
139    This warning was introduced in GCC 7.
140    This warning has many false positives where truncation is
141    either expected or unavoidable, but also finds several real
142    code bugs.
143
144    Code should always be manually inspected for this warning
145    as it does pick up real issues.
146
147    bsd.own.mk variable: ${CC_WNO_FORMAT_TRUNCATION}
148
149
150  -Wformat-overflow
151
152    This warning was introduced in GCC 7.
153    This warning typically identifies a real problem, but it may
154    fail to notice the code handles this case.
155
156    Code should always be manually inspected for this warning
157    as it does pick up real issues.
158
159    bsd.own.mk variable: ${CC_WNO_FORMAT_OVERFLOW}
160
161
162  -Wimplicit-fallthrough
163
164    This warning was introduced in GCC 7.
165    This warning has many false positives in GCC 7, and many are
166    fixed in newer GCC 10.  Old uses should be checked occasionally.
167
168    Code should always be manually inspected for this warning
169    as it does pick up real issues.
170
171    bsd.own.mk variable: ${CC_WNO_IMPLICIT_FALLTHROUGH}
172