gcc17
LOW
maintainer RubenKelevra
0 votes
scanned 2026-10-07 06:05:09.924014
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: @RubenKelevra <rubenkelevra@gmail.com>
2
3
pkgname='gcc17'
4
pkgver='17.0.0.snapshot20261004'
5
_snapshot='17-20261004'
6
pkgrel=1
7
pkgdesc='GNU Compiler Collection 17 C/C++ development snapshot for parallel compiler validation'
8
arch=('x86_64')
9
license=(
10
'GPL-3.0-or-later WITH GCC-exception-3.1'
11
'GFDL-1.3-or-later'
12
)
13
url='https://gcc.gnu.org'
14
depends=(
15
'gmp'
16
'libisl.so'
17
'libmpc'
18
'mpfr'
19
'zlib'
20
'zstd'
21
)
22
makedepends=(
23
'doxygen'
24
'graphviz'
25
'patchelf'
26
'python'
27
)
28
checkdepends=(
29
'autogen'
30
'dejagnu'
31
'expect'
32
'gdb'
33
'inetutils'
34
'python-pytest'
35
'tcl'
36
)
37
options=(
38
'!emptydirs'
39
'!lto'
40
'staticlibs'
41
)
42
_libdir="usr/lib/gcc/${CHOST}/${pkgver%%.snapshot*}"
43
source=(
44
"gcc-${_snapshot}.tar.xz::https://gcc.gnu.org/pub/gcc/snapshots/${_snapshot}/gcc-${_snapshot}.tar.xz"
45
'check-memlock.py'
46
)
47
sha512sums=(
48
'0b033d6a618594bd70eb887e79affb9a7c77427438afdb3bd42286be4ad2231c2238d65c6e632e7e75d3869cd471185e49d4148455d7982b264b937539aae5d2'
49
'SKIP'
50
)
51
b2sums=(
52
'SKIP'
53
'bc20b249bc2aaf014832e3cb4f57e4d2b2be6b386ace28d561d4370587770ef667b0aa5063ac49bd5d222b2e1bbc81f3815e16906d5a02c7e3a661e98cae8b39'
54
)
55
56
_expected_failure_tests=(
57
# GCC PR testsuite/125766 and other known guality failures.
58
'gcc.dg/guality/loop-1.c'
59
'gcc.dg/guality/pr43051-1.c'
60
'gcc.dg/guality/pr43593.c'
61
'gcc.dg/guality/pr54519-1.c'
62
'gcc.dg/guality/pr54519-2.c'
63
'gcc.dg/guality/pr54519-3.c'
64
'gcc.dg/guality/pr54519-4.c'
65
'gcc.dg/guality/pr54519-5.c'
66
'gcc.dg/guality/pr54519-6.c'
67
'gcc.dg/guality/pr54693-2.c'
68
'gcc.dg/guality/pr54796.c'
69
'gcc.dg/guality/pr56154-1.c'
70
'gcc.dg/guality/pr59776.c'
71
'gcc.dg/guality/sra-1.c'
72
'gcc.dg/guality/vla-1.c'
73
'gcc.dg/guality/vla-2.c'
74
'g++.dg/guality/pr55665.C'
75
'g++.dg/guality/pr86687.C'
76
77
# GCC PR diagnostics/121876.
78
'gcc.dg/plugin/crash-test-nested-ice.c'
79
'gcc.dg/plugin/crash-test-nested-write-through-null.c'
80
81
# Known upstream x86_64 failures.
82
'c-c++-common/analyzer/omp-parallel-for-1.c'
83
'gcc.target/i386/pr115102.c'
84
'gcc.target/i386/xchg-4.c'
85
'gcc.dg/tree-ssa/ssa-sink-18.c'
86
87
# Reproduced by GCC's official 2026-10-06 x86_64-pc-linux-gnu results:
88
# https://gcc.gnu.org/pipermail/gcc-testresults/2026-October/888761.html
89
'g++.dg/tree-ssa/ssa-dse-1.C'
90
91
# Known libstdc++ pretty-printer failure on some test environments.
92
'libstdc++-prettyprinters/chrono.cc'
93
)
94
95
_insert_test_skip() {
96
local _dg_do_count
97
local _directive=$1
98
local _file=$2
99
100
if grep -qxF -- "${_directive}" "${_file}"; then
101
return 0
102
fi
103
104
_dg_do_count=$(grep -cF '{ dg-do ' "${_file}")
105
if (( _dg_do_count != 1 )); then
106
printf 'Expected exactly one dg-do directive in %s, found %d\n' "${_file}" "${_dg_do_count}" >&2
107
return 1
108
fi
109
sed -i "/{ dg-do /a\\${_directive}" "${_file}" || return 1
110
}
111
112
_insert_test_additional_options() {
113
local _dg_options_count
114
local _directive=$1
115
local _file=$2
116
117
if grep -qxF -- "${_directive}" "${_file}"; then
118
return 0
119
fi
120
_dg_options_count=$(grep -cF '{ dg-options ' "${_file}")
121
if (( _dg_options_count != 1 )); then
122
printf 'Expected exactly one dg-options directive in %s, found %d\n' "${_file}" "${_dg_options_count}" >&2
123
return 1
124
fi
125
sed -i "/{ dg-options /a\\${_directive}" "${_file}" || return 1
126
}
127
128
prepare() {
129
local _default_option_test _fixinc_count _has_include_error_line _libbacktrace_count _libbacktrace_file _multilib_count
130
local _libbacktrace_assignment='strippedtest_LDFLAGS = $(libbacktrace_testing_ldflags) -static -Wl,-Bstatic'
131
local _default_pie_options='/* { dg-additional-options "-fno-pie -no-pie" } */'
132
local _default_pie_ssp_options='/* { dg-additional-options "-fno-pie -no-pie -fno-stack-protector" } */'
133
local _default_ssp_options='/* { dg-additional-options "-fno-stack-protector" } */'
134
local _default_pie_tests=(
135
'gcc.target/i386/builtin-memmove-12.c'
136
'gcc.target/i386/memset-pr70308-1b.c'
137
'gcc.target/i386/postreload-implicit-set-1.c'
138
'gcc.target/i386/pr122343-4a.c'
139
'gcc.target/i386/pr125355-2.c'
140
'gcc.target/i386/pr125355.c'
141
'gcc.target/i386/pr125893-2.c'
142
'gcc.target/i386/pr125893-4.c'
143
'gcc.target/i386/pr125893-5.c'
144
'gcc.target/i386/pr125893-6.c'
145
'gcc.target/i386/pr126784-4.c'
146
'gcc.target/i386/preserve-none-31a.c'
147
'gcc.target/i386/preserve-none-33a.c'
148
'gcc.target/i386/preserve-none-34a.c'
149
'gcc.target/i386/preserve-none-36a.c'
150
'gcc.target/i386/preserve-none-36b.c'
151
'gcc.target/i386/preserve-none-36c.c'
152
'gcc.target/i386/preserve-none-36d.c'
153
'gcc.target/i386/preserve-none-36e.c'
154
'gcc.target/i386/preserve-none-36f.c'
155
'gcc.target/i386/preserve-none-36g.c'
156
'gcc.target/i386/preserve-none-37a.c'
157
'gcc.target/i386/preserve-none-37b.c'
158
'gcc.target/i386/preserve-none-37c.c'
159
'gcc.target/i386/preserve-none-37d.c'
160
'gcc.target/i386/preserve-none-37e.c'
161
'gcc.target/i386/preserve-none-37f.c'
162
'gcc.target/i386/preserve-none-37g.c'
163
'gcc.target/i386/preserve-none-37h.c'
164
'gcc.target/i386/preserve-none-37i.c'
165
'gcc.target/i386/preserve-none-37j.c'
166
'g++.target/i386/mvc-symbols1.C'
167
'g++.target/i386/mvc-symbols3.C'
168
'g++.target/i386/mv-symbols1.C'
169
'g++.target/i386/mv-symbols3.C'
170
'g++.target/i386/mv-symbols4.C'
171
'g++.target/i386/mv-symbols5.C'
172
)
173
local _default_pie_ssp_tests=(
174
'gcc.target/i386/preserve-none-35a.c'
175
'gcc.target/i386/preserve-none-35b.c'
176
'gcc.target/i386/preserve-none-35c.c'
177
'gcc.target/i386/preserve-none-35d.c'
178
'gcc.target/i386/preserve-none-35e.c'
179
'gcc.target/i386/preserve-none-35f.c'
180
'gcc.target/i386/preserve-none-35g.c'
181
)
182
local _default_ssp_tests=(
183
'g++.target/i386/pr112824-2.C'
184
)
185
cd -- "${srcdir}/gcc-${_snapshot}" || return 1
186
187
# Do not run fixincludes. Fail closed if upstream changes the generated
188
# invocation instead of silently carrying a no-op rewrite into a new snapshot.
189
_fixinc_count=$(grep -cF './fixinc.sh' gcc/Makefile.in || true)
190
if (( _fixinc_count != 1 )); then
191
printf 'Expected exactly one fixinc.sh invocation, found %d\n' "${_fixinc_count}" >&2
192
return 1
193
fi
194
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in || return 1
195
if grep -qF './fixinc.sh' gcc/Makefile.in; then
196
printf 'Failed to disable fixinc.sh invocation\n' >&2
197
return 1
198
fi
199
200
# Arch Linux installs 64-bit libraries in /usr/lib. Guard the exact upstream
201
# layout so an automated snapshot update cannot silently miss this rewrite.
202
_multilib_count=$(grep -cFx 'MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)' gcc/config/i386/t-linux64 || true)
203
if (( _multilib_count != 1 )); then
204
printf 'Expected exactly one x86_64 lib64 multilib mapping, found %d\n' "${_multilib_count}" >&2
205
return 1
206
fi
207
sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64 || return 1
208
if ! grep -qxF 'MULTILIB_OSDIRNAMES = m64=../lib$(call if_multiarch,:x86_64-linux-gnu)' gcc/config/i386/t-linux64; then
209
printf 'Failed to rewrite x86_64 multilib mapping to /usr/lib\n' >&2
210
return 1
211
fi
212
213
# libbacktrace's strippedtest asks libtool for -static and also passes
214
# -Wl,-Bstatic. With GCC configured for default PIE, libtool consumes the
215
# driver-level -static and leaves GCC to create a PIE containing static
216
# glibc plus PT_INTERP, which crashes before main(). Force only this test
217
# to non-PIE so it becomes the fully static ET_EXEC upstream intended.
218
for _libbacktrace_file in libbacktrace/Makefile.am libbacktrace/Makefile.in; do
219
if grep -qF -- "${_libbacktrace_assignment} -no-pie" "${_libbacktrace_file}"; then
220
continue
221
fi
222
_libbacktrace_count=$(grep -cF -- "${_libbacktrace_assignment}" "${_libbacktrace_file}")
223
if (( _libbacktrace_count != 1 )); then
224
printf 'Expected exactly one libbacktrace strippedtest LDFLAGS assignment in %s, found %d\n' \
225
"${_libbacktrace_file}" "${_libbacktrace_count}" >&2
226
return 1
227
fi
228
sed -i '/strippedtest_LDFLAGS = /s/$/ -no-pie/' "${_libbacktrace_file}" || return 1
229
done
230
231
# PR preprocessor/121508 can cause spurious test failures while
232
# builtin_has_include_1 returns immediately after diagnosing use outside a
233
# directive, leaving parser state uninitialized. Skip only while that exact
234
# buggy early-return shape is present. Once upstream removes the return, the
235
# test automatically runs again and becomes the verification of the fix.
236
# Proposed upstream fix:
237
# https://gcc.gnu.org/pipermail/gcc-patches/2026-September/733109.html
238
_has_include_error_line=$(grep -nF '"%qs used outside of preprocessing directive", name);' libcpp/macro.cc | cut -d: -f1)
239
if [[ ${_has_include_error_line} =~ ^[0-9]+$ ]] \
240
&& sed -n "$((_has_include_error_line + 1))p" libcpp/macro.cc | grep -qxF ' return NULL;'; then
241
_insert_test_skip \
242
'/* { dg-skip-if "spurious test failures; include after upstream patch is merged" { *-*-* } } */' \
243
gcc/testsuite/c-c++-common/cpp/has-include-1.c || return 1
244
else
245
printf 'PR preprocessor/121508 early-return marker absent; running has-include-1.c\n' >&2
246
fi
247
248
# This compiler intentionally enables default PIE and SSP. A small set of
249
# upstream tests assumes those defaults are off when checking exact assembly
250
# or stack layout. Adapt only those tests; a global TEST_ALWAYS_FLAGS override
251
# breaks tests such as -fhardened that are explicitly meant to observe the
252
# configured defaults.
253
for _default_option_test in "${_default_pie_tests[@]}"; do
254
_insert_test_additional_options \
255
"${_default_pie_options}" \
256
"gcc/testsuite/${_default_option_test}" || return 1
257
done
258
for _default_option_test in "${_default_pie_ssp_tests[@]}"; do
259
_insert_test_additional_options \
260
"${_default_pie_ssp_options}" \
261
"gcc/testsuite/${_default_option_test}" || return 1
262
done
263
for _default_option_test in "${_default_ssp_tests[@]}"; do
264
_insert_test_additional_options \
265
"${_default_ssp_options}" \
266
"gcc/testsuite/${_default_option_test}" || return 1
267
done
268
269
mkdir -p -- "${srcdir}/gcc-build"
270
}
271
272
_build_gcc() {
273
local _file_prefix_map="-ffile-prefix-map=${srcdir}=/usr/src/debug/${pkgname}"
274
local _confflags=(
275
'--prefix=/usr'
276
'--libdir=/usr/lib'
277
'--libexecdir=/usr/lib'
278
'--mandir=/usr/share/man'
279
'--infodir=/usr/share/info'
280
'--with-bugurl=https://aur.archlinux.org/packages/gcc17'
281
'--with-linker-hash-style=gnu'
282
'--with-system-zlib'
283
'--enable-__cxa_atexit'
284
'--enable-cet=auto'
285
'--enable-checking=release'
286
'--enable-clocale=gnu'
287
'--enable-default-pie'
288
'--enable-default-ssp'
289
'--enable-gnu-indirect-function'
290
'--enable-gnu-unique-object'
291
'--enable-libstdcxx-backtrace'
292
'--enable-link-serialization=1'
293
'--enable-linker-build-id'
294
'--enable-lto'
295
'--with-build-config=bootstrap-lto-lean'
296
'--disable-multilib'
297
'--enable-plugin'
298
'--enable-shared'
299
'--enable-threads=posix'
300
'--disable-libssp'
301
'--disable-libstdcxx-pch'
302
'--disable-werror'
303
'--program-suffix=-17'
304
'--enable-version-specific-runtime-libs'
305
"--with-specs=%{!static:-Wl,-rpath,/${_libdir}}"
306
)
307
308
cd -- "${srcdir}/gcc-build" || return 1
309
310
CFLAGS=${CFLAGS/-Werror=format-security/}
311
CXXFLAGS=${CXXFLAGS/-Werror=format-security/}
312
# GCC runtimes such as libitm and libsanitizer deliberately add
313
# -fno-exceptions. A global -fexceptions appears later in their compile
314
# command and overrides that component-specific requirement.
315
CXXFLAGS=${CXXFLAGS/-fexceptions/}
316
CFLAGS+=" ${_file_prefix_map}"
317
CXXFLAGS+=" ${_file_prefix_map}"
318
319
"../gcc-${_snapshot}/configure" \
320
--enable-languages=c,c++ \
321
--enable-bootstrap \
322
"${_confflags[@]:?_confflags unset}"
323
324
make -O \
325
STAGE1_CFLAGS="-O2 ${_file_prefix_map}" \
326
BOOT_CFLAGS="${CFLAGS}" \
327
BOOT_LDFLAGS="${LDFLAGS}" \
328
LDFLAGS_FOR_TARGET="${LDFLAGS}" \
329
profiledbootstrap
330
331
make -O -C "${CHOST}/libstdc++-v3/doc" doc-man-doxygen
332
}
333
334
build() {
335
_build_gcc
336
}
337
338
check() {
339
local _check_cflags _check_cxxflags _check_target_cflags _check_target_cxxflags
340
local _automake_log _entry _expected_test _known_failure _memlock_status _result _sum _symbols
341
local _libbacktrace_summary='libbacktrace/test-suite.log'
342
local -a _automake_logs _suites _unexpected_results
343
local _memlock_skip='/* { dg-skip-if "mlock unavailable in test environment" { *-*-* } } */'
344
local _no_gxx_shared=(
345
"${CHOST}/libitm/.libs/libitm.so"
346
"${CHOST}/libsanitizer/asan/.libs/libasan.so"
347
"${CHOST}/libsanitizer/hwasan/.libs/libhwasan.so"
348
"${CHOST}/libsanitizer/lsan/.libs/liblsan.so"
349
"${CHOST}/libsanitizer/tsan/.libs/libtsan.so"
350
"${CHOST}/libsanitizer/ubsan/.libs/libubsan.so"
351
)
352
local _no_gxx_static=(
353
"${CHOST}/libitm/.libs/libitm.a"
354
"${CHOST}/libsanitizer/asan/.libs/libasan.a"
355
"${CHOST}/libsanitizer/hwasan/.libs/libhwasan.a"
356
"${CHOST}/libsanitizer/lsan/.libs/liblsan.a"
357
"${CHOST}/libsanitizer/tsan/.libs/libtsan.a"
358
"${CHOST}/libsanitizer/ubsan/.libs/libubsan.a"
359
)
360
local _pinned_tests=(
361
'libgomp.c/alloc-pinned-1.c'
362
'libgomp.c/alloc-pinned-2.c'
363
'libgomp.c/alloc-pinned-5.c'
364
'libgomp.c/alloc-pinned-8.c'
365
'libgomp.c++/allocator-1.C'
366
'libgomp.c++/allocator-2.C'
367
)
368
local _required_suites=(
369
'gcc/testsuite/gcc/gcc.sum'
370
'gcc/testsuite/g++/g++.sum'
371
"${CHOST}/libatomic/testsuite/libatomic.sum"
372
"${CHOST}/libgomp/testsuite/libgomp.sum"
373
"${CHOST}/libitm/testsuite/libitm.sum"
374
"${CHOST}/libstdc++-v3/testsuite/libstdc++.sum"
375
)
376
377
cd -- "${srcdir}/gcc-build" || return 1
378
379
# The pinned allocator tests require a working mlock syscall. Sandboxes such
380
# as makechrootpkg's systemd-nspawn can deny @memlock via seccomp even when
381
# RLIMIT_MEMLOCK is sufficient. Probe the required capability directly
382
# instead of guessing from container markers so this remains correct for
383
# other sandboxes and future nspawn configurations.
384
# Always remove our environment-specific directive first. This makes check()
385
# safe to rerun in a reused srcdir after moving between restricted and
386
# unrestricted environments.
387
for _entry in "${_pinned_tests[@]}"; do
388
sed -i '/dg-skip-if "mlock unavailable in test environment"/d' \
389
"${srcdir}/gcc-${_snapshot}/libgomp/testsuite/${_entry}" || return 1
390
done
391
392
if python "${srcdir}/check-memlock.py"; then
393
_memlock_status=0
394
else
395
_memlock_status=$?
396
fi
397
case ${_memlock_status} in
398
0)
399
;;
400
77)
401
printf 'Skipping libgomp pinned allocator tests: mlock is unavailable in this test environment\n' >&2
402
for _entry in "${_pinned_tests[@]}"; do
403
_insert_test_skip \
404
"${_memlock_skip}" \
405
"${srcdir}/gcc-${_snapshot}/libgomp/testsuite/${_entry}" || return 1
406
done
407
;;
408
*)
409
printf 'Unexpected memlock probe failure: exit status %d\n' "${_memlock_status}" >&2
410
return 1
411
;;
412
esac
413
414
# Package build flags describe the shipped compiler build, not the testsuite
415
# programs. Keep test helpers and target runtimes on a neutral optimization
416
# baseline. Tests that require upstream's non-PIE/non-SSP defaults are
417
# adapted individually in prepare() so tests of configured defaults remain
418
# meaningful.
419
_check_cflags='-O2'
420
_check_cxxflags='-O2'
421
_check_target_cflags='-g -O2'
422
_check_target_cxxflags='-g -O2 -D_GNU_SOURCE -Wno-aggressive-loop-optimizations'
423
424
# fixincludes uses AutoGen and does not produce a DejaGNU summary. Check it
425
# separately so its harness status is explicit even if top-level wiring changes.
426
make -O -C fixincludes check || return 1
427
428
# Run the complete testsuite apart from the environment-only memlock skips.
429
# DejaGNU itself exits successfully even when individual tests report FAIL, so
430
# a non-zero top-level make status represents a harness/build failure and must
431
# never be discarded. Known test FAILs are classified from the summaries below.
432
# Aggregate PASS/XFAIL/UNSUPPORTED counts are deliberately not pinned so a
433
# new GCC snapshot can add, remove, or reclassify tests without manual edits.
434
# Remove every prior summary first so a failed rerun cannot reuse stale data.
435
find . -type f \( -name '*.sum' -o -name 'test-suite.log' \) -delete || return 1
436
make -O -k \
437
CFLAGS="${_check_cflags}" \
438
CXXFLAGS="${_check_cxxflags}" \
439
CFLAGS_FOR_TARGET="${_check_target_cflags}" \
440
CXXFLAGS_FOR_TARGET="${_check_target_cxxflags}" \
441
check || return 1
442
443
for _sum in "${_required_suites[@]}"; do
444
if [[ ! -s "${_sum}" ]]; then
445
printf 'Missing required GCC testsuite summary: %s\n' "${_sum}" >&2
446
return 1
447
fi
448
done
449
if [[ ! -s "${_libbacktrace_summary}" ]]; then
450
printf 'Missing libbacktrace testsuite summary: %s\n' "${_libbacktrace_summary}" >&2
451
return 1
452
fi
453
454
mapfile -d '' -t _automake_logs < <(find . -type f -name 'test-suite.log' -print0 | sort -z)
455
for _automake_log in "${_automake_logs[@]}"; do
456
if ! grep -Eq '^# TOTAL:[[:space:]]+[1-9][0-9]*$' "${_automake_log}"; then
457
printf 'Incomplete Automake testsuite summary: %s\n' "${_automake_log}" >&2
458
return 1
459
fi
460
if grep -Eq '^# (FAIL|ERROR):[[:space:]]+[1-9][0-9]*$' "${_automake_log}"; then
461
printf 'Unexpected Automake testsuite result in %s:\n' "${_automake_log}" >&2
462
grep -E '^# (FAIL|ERROR):' "${_automake_log}" >&2
463
return 1
464
fi
465
done
466
467
mapfile -d '' -t _suites < <(find . -type f -name '*.sum' -print0 | sort -z)
468
469
# Restore the extracted source tree after the environment-specific test
470
# adaptation. The pre-run cleanup above still protects interrupted reruns.
471
for _entry in "${_pinned_tests[@]}"; do
472
sed -i '/dg-skip-if "mlock unavailable in test environment"/d' \
473
"${srcdir}/gcc-${_snapshot}/libgomp/testsuite/${_entry}" || return 1
474
done
475
476
for _entry in "${_no_gxx_shared[@]}"; do
477
if [[ ! -s "${_entry}" ]]; then
478
printf 'Missing GCC runtime for C++ personality check: %s\n' "${_entry}" >&2
479
return 1
480
fi
481
if ! _symbols=$(readelf -Ws "${_entry}"); then
482
printf 'Unable to read GCC runtime symbols: %s\n' "${_entry}" >&2
483
return 1
484
fi
485
if grep -q 'UND __gxx_personality_v0' <<<"${_symbols}"; then
486
printf 'GCC runtime unexpectedly depends on the C++ exception personality: %s\n' "${_entry}" >&2
487
return 1
488
fi
489
done
490
for _entry in "${_no_gxx_static[@]}"; do
491
if [[ ! -s "${_entry}" ]]; then
492
printf 'Missing static GCC runtime for C++ personality check: %s\n' "${_entry}" >&2
493
return 1
494
fi
495
if ! _symbols=$(nm -u "${_entry}"); then
496
printf 'Unable to read static GCC runtime symbols: %s\n' "${_entry}" >&2
497
return 1
498
fi
499
if grep -q ' U __gxx_personality_v0$' <<<"${_symbols}"; then
500
printf 'Static GCC runtime unexpectedly depends on the C++ exception personality: %s\n' "${_entry}" >&2
501
return 1
502
fi
503
done
504
505
_unexpected_results=()
506
for _entry in "${_suites[@]}"; do
507
_sum=${_entry}
508
if [[ ! -s "${_sum}" ]]; then
509
printf 'Missing GCC testsuite summary: %s\n' "${_sum}" >&2
510
return 1
511
fi
512
if ! grep -q '^# of expected passes' "${_sum}"; then
513
printf 'Incomplete GCC testsuite summary: %s\n' "${_sum}" >&2
514
return 1
515
fi
516
517
while IFS= read -r _result; do
518
_known_failure=0
519
if [[ ${_result} == FAIL:* ]]; then
520
for _expected_test in "${_expected_failure_tests[@]}"; do
521
if [[ ${_result} == "FAIL: ${_expected_test}" || ${_result} == "FAIL: ${_expected_test}"[[:space:]]* ]]; then
522
_known_failure=1
523
printf 'Accepting known GCC testsuite failure: %s\n' "${_result}" >&2
524
break
525
fi
526
done
527
fi
528
if (( ! _known_failure )); then
529
_unexpected_results+=("${_sum}: ${_result}")
530
fi
531
done < <(grep -E '^(FAIL|ERROR|UNRESOLVED):' "${_sum}" || true)
532
done
533
534
if (( ${#_unexpected_results[@]} != 0 )); then
535
printf 'Unexpected GCC testsuite results:\n' >&2
536
printf '%s\n' "${_unexpected_results[@]}" >&2
537
return 1
538
fi
539
540
if (( _memlock_status == 77 )); then
541
for _entry in "${_pinned_tests[@]}"; do
542
if ! grep -qFx -- "UNSUPPORTED: ${_entry}" "${CHOST}/libgomp/testsuite/libgomp.sum"; then
543
printf 'Expected libgomp pinned allocator test to be unsupported: %s\n' "${_entry}" >&2
544
return 1
545
fi
546
done
547
fi
548
549
"${srcdir}/gcc-${_snapshot}/contrib/test_summary"
550
}
551
552
553
package() {
554
local binary _manpage _py_count _pyc_count _runtime _tool
555
556
cd -- "${srcdir}/gcc-build" || return 1
557
558
make -C gcc DESTDIR="${pkgdir}" \
559
install-driver \
560
install-cpp \
561
install-gcc-ar \
562
c++.install-common \
563
install-headers \
564
install-plugin \
565
install-lto-wrapper
566
567
# Keep GCC's user-facing auxiliary tools parallel-installable as well.
568
for _tool in gcov gcov-tool gcov-dump lto-dump; do
569
install -Dm755 -- "gcc/${_tool}" "${pkgdir}/usr/bin/${_tool}-17"
570
[[ -s "${pkgdir}/usr/bin/${_tool}-17" ]] || return 1
571
done
572
573
# install-man applies --program-suffix=-17 to command manpages. GCC also
574
# installs generic license man7 pages; keep those owned by the system GCC.
575
make -C gcc DESTDIR="${pkgdir}" install-man
576
rm -f -- "${pkgdir}/usr/share/man/man7/"{fsf-funding,gfdl,gpl}.7
577
if find "${pkgdir}/usr/share/man/man7" -type f -print -quit | grep -q .; then
578
printf 'Unexpected unversioned GCC man7 page installed\n' >&2
579
return 1
580
fi
581
rmdir -- "${pkgdir}/usr/share/man/man7" || return 1
582
for _manpage in gcc g++ cpp gcov gcov-tool gcov-dump lto-dump; do
583
[[ -s "${pkgdir}/usr/share/man/man1/${_manpage}-17.1" ]] || return 1
584
done
585
if find "${pkgdir}/usr/share/man/man1" -type f ! -name '*-17.1' -print -quit | grep -q .; then
586
printf 'Unexpected unversioned GCC man1 page installed\n' >&2
587
return 1
588
fi
589
590
install -m755 -t "${pkgdir}/${_libdir}/" gcc/{cc1,cc1plus,collect2,lto1,gcov,gcov-tool}
591
592
make -C "${CHOST}/libgcc" DESTDIR="${pkgdir}" install
593
mv -- "${pkgdir}/${_libdir}"/../lib/* "${pkgdir}/${_libdir}"
594
rmdir -- "${pkgdir}/${_libdir}"/../lib
595
596
make -C "${CHOST}/libstdc++-v3/src" DESTDIR="${pkgdir}" install
597
make -C "${CHOST}/libstdc++-v3/include" DESTDIR="${pkgdir}" install
598
make -C "${CHOST}/libstdc++-v3/libsupc++" DESTDIR="${pkgdir}" install
599
make -C "${CHOST}/libstdc++-v3/python" DESTDIR="${pkgdir}" install
600
601
# Keep GCC 17's shared runtimes in its compiler-specific directory. This is
602
# the layout provided by --enable-version-specific-runtime-libs.
603
make -C "${CHOST}/libatomic" DESTDIR="${pkgdir}" install-asneeded
604
[[ -s "${pkgdir}/${_libdir}/libatomic_asneeded.so" ]] || return 1
605
[[ -L "${pkgdir}/${_libdir}/libatomic_asneeded.a" ]] || return 1
606
make -C "${CHOST}/libgomp" DESTDIR="${pkgdir}" install-toolexeclibLTLIBRARIES
607
make -C "${CHOST}/libitm" DESTDIR="${pkgdir}" install-toolexeclibLTLIBRARIES
608
make -C "${CHOST}/libsanitizer/asan" DESTDIR="${pkgdir}" install-toolexeclibLTLIBRARIES
609
make -C "${CHOST}/libsanitizer/hwasan" DESTDIR="${pkgdir}" install-toolexeclibLTLIBRARIES
610
make -C "${CHOST}/libsanitizer/lsan" DESTDIR="${pkgdir}" install-toolexeclibLTLIBRARIES
611
make -C "${CHOST}/libsanitizer/tsan" DESTDIR="${pkgdir}" install-toolexeclibLTLIBRARIES
612
make -C "${CHOST}/libsanitizer/ubsan" DESTDIR="${pkgdir}" install-toolexeclibLTLIBRARIES
613
614
# Private GCC runtimes depend on each other. Give every installed shared
615
# object a self-relative RUNPATH so indirect dependencies stay within GCC 17.
616
while IFS= read -r -d '' _runtime; do
617
if readelf -h "${_runtime}" >/dev/null 2>&1; then
618
patchelf --set-rpath '$ORIGIN' "${_runtime}" || return 1
619
fi
620
done < <(find "${pkgdir}/${_libdir}" -type f -name '*.so.*' -print0)
621
622
make DESTDIR="${pkgdir}" install-fixincludes
623
make -C gcc DESTDIR="${pkgdir}" install-mkheaders
624
625
make -C lto-plugin DESTDIR="${pkgdir}" install
626
install -dm755 -- "${pkgdir}/${_libdir}/bfd-plugins/"
627
ln -s -- "/${_libdir}/liblto_plugin.so" "${pkgdir}/${_libdir}/bfd-plugins/"
628
rm -rf -- "${pkgdir}/usr/lib/bfd-plugins"
629
630
make -C "${CHOST}/libgomp" DESTDIR="${pkgdir}" install-nodist_{libsubinclude,toolexeclib}HEADERS
631
make -C "${CHOST}/libitm" DESTDIR="${pkgdir}" install-nodist_toolexeclibHEADERS
632
make -C "${CHOST}/libsanitizer" DESTDIR="${pkgdir}" install-nodist_{saninclude,toolexeclib}HEADERS
633
make -C "${CHOST}/libsanitizer/asan" DESTDIR="${pkgdir}" install-nodist_toolexeclibHEADERS
634
make -C "${CHOST}/libsanitizer/tsan" DESTDIR="${pkgdir}" install-nodist_toolexeclibHEADERS
635
make -C "${CHOST}/libsanitizer/lsan" DESTDIR="${pkgdir}" install-nodist_toolexeclibHEADERS
636
637
make -C "${CHOST}/libstdc++-v3/doc" DESTDIR="${pkgdir}" doc-install-man
638
while IFS= read -r -d '' _manpage; do
639
sed -i -E 's@^(\.so[[:space:]]+man3/.*)\.3$@\1-17.3@' "${_manpage}" || return 1
640
mv -- "${_manpage}" "${_manpage%.3}-17.3" || return 1
641
done < <(find "${pkgdir}/usr/share/man/man3" -type f -name '*.3' -print0)
642
643
make -C libcpp DESTDIR="${pkgdir}" install
644
make -C gcc DESTDIR="${pkgdir}" install-po
645
646
ln -s -- 'gcc-17' "${pkgdir}/usr/bin/cc-17"
647
648
for binary in c++ g++ gcc gcc-ar gcc-nm gcc-ranlib; do
649
ln -s -- "/usr/bin/${binary}-17" "${pkgdir}/usr/bin/${CARCH}-linux-gnu-${binary}-17"
650
done
651
652
env -u PYTHONPYCACHEPREFIX python -m compileall \
653
-o 0 \
654
-o 2 \
655
-s "${pkgdir}" \
656
-p / \
657
"${pkgdir}/usr/share/gcc-${pkgver%%.snapshot*}/"
658
659
_py_count=$(find "${pkgdir}/usr/share/gcc-${pkgver%%.snapshot*}/" -type f -name '*.py' -print | wc -l)
660
_pyc_count=$(find "${pkgdir}/usr/share/gcc-${pkgver%%.snapshot*}/" -type f -name '*.pyc' -print | wc -l)
661
if (( _pyc_count != _py_count * 2 )); then
662
printf 'Expected two bytecode files per Python source, found %d for %d sources\n' "${_pyc_count}" "${_py_count}" >&2
663
return 1
664
fi
665
666
install -Dm644 \
667
"${srcdir}/gcc-${_snapshot}/COPYING.RUNTIME" \
668
"${pkgdir}/usr/share/licenses/${pkgname}/RUNTIME.LIBRARY.EXCEPTION"
669
670
rm -rf -- "${pkgdir}/usr/share/locale"
671
}
672
Changes since previous scan
--- PKGBUILD @ 2026-10-06 00:13+++ PKGBUILD @ 2026-10-07 06:05@@ -1,9 +1,8 @@ # Maintainer: @RubenKelevra <rubenkelevra@gmail.com> pkgname='gcc17'-pkgver='17.0.0.snapshot20260927'-_snapshot='17-20260927'-_testsuite_contract_snapshot='17-20260927'+pkgver='17.0.0.snapshot20261004'+_snapshot='17-20261004' pkgrel=1 pkgdesc='GNU Compiler Collection 17 C/C++ development snapshot for parallel compiler validation' arch=('x86_64')@@ -27,8 +26,10 @@ 'python' ) checkdepends=(+ 'autogen' 'dejagnu' 'expect'+ 'gdb' 'inetutils' 'python-pytest' 'tcl'@@ -44,12 +45,51 @@ 'check-memlock.py' ) sha512sums=(- '14526b6287dfa0197ebb4c5b56c6a68c92f44062cdc87d2391c8d5d04b0e01fcda94ac370f70c4f13a11a110f04a36ed2b792b64f791ca996c4e1df646ec71b6'+ '0b033d6a618594bd70eb887e79affb9a7c77427438afdb3bd42286be4ad2231c2238d65c6e632e7e75d3869cd471185e49d4148455d7982b264b937539aae5d2' 'SKIP' ) b2sums=( 'SKIP' 'bc20b249bc2aaf014832e3cb4f57e4d2b2be6b386ace28d561d4370587770ef667b0aa5063ac49bd5d222b2e1bbc81f3815e16906d5a02c7e3a661e98cae8b39'+)++_expected_failure_tests=(+ # GCC PR testsuite/125766 and other known guality failures.+ 'gcc.dg/guality/loop-1.c'+ 'gcc.dg/guality/pr43051-1.c'+ 'gcc.dg/guality/pr43593.c'+ 'gcc.dg/guality/pr54519-1.c'+ 'gcc.dg/guality/pr54519-2.c'+ 'gcc.dg/guality/pr54519-3.c'+ 'gcc.dg/guality/pr54519-4.c'+ 'gcc.dg/guality/pr54519-5.c'+ 'gcc.dg/guality/pr54519-6.c'+ 'gcc.dg/guality/pr54693-2.c'+ 'gcc.dg/guality/pr54796.c'+ 'gcc.dg/guality/pr56154-1.c'+ 'gcc.dg/guality/pr59776.c'+ 'gcc.dg/guality/sra-1.c'+ 'gcc.dg/guality/vla-1.c'+ 'gcc.dg/guality/vla-2.c'+ 'g++.dg/guality/pr55665.C'+ 'g++.dg/guality/pr86687.C'++ # GCC PR diagnostics/121876.+ 'gcc.dg/plugin/crash-test-nested-ice.c'+ 'gcc.dg/plugin/crash-test-nested-write-through-null.c'++ # Known upstream x86_64 failures.+ 'c-c++-common/analyzer/omp-parallel-for-1.c'+ 'gcc.target/i386/pr115102.c'+ 'gcc.target/i386/xchg-4.c'+ 'gcc.dg/tree-ssa/ssa-sink-18.c'++ # Reproduced by GCC's official 2026-10-06 x86_64-pc-linux-gnu results:+ # https://gcc.gnu.org/pipermail/gcc-testresults/2026-October/888761.html+ 'g++.dg/tree-ssa/ssa-dse-1.C'++ # Known libstdc++ pretty-printer failure on some test environments.+ 'libstdc++-prettyprinters/chrono.cc' ) _insert_test_skip() {@@ -69,20 +109,6 @@ sed -i "/{ dg-do /a\\${_directive}" "${_file}" || return 1 } -_insert_implicit_compile_skip() {- local _directive=$1- local _file=$2-- if grep -qxF -- "${_directive}" "${_file}"; then- return 0- fi- if grep -qF '{ dg-do ' "${_file}"; then- printf 'Expected no dg-do directive in implicit-compile test: %s\n' "${_file}" >&2- return 1- fi- sed -i "1i\\${_directive}" "${_file}" || return 1-}- _insert_test_additional_options() { local _dg_options_count local _directive=$1@@ -99,30 +125,8 @@ sed -i "/{ dg-options /a\\${_directive}" "${_file}" || return 1 } -_require_testsuite_count() {- local _actual _matches- local _file=$1- local _label=$2- local _expected=$3-- _matches=$(grep -Ec "^# of ${_label}[[:space:]]+[0-9]+$" "${_file}" || true)- if (( _matches == 0 )); then- _actual=0- elif (( _matches == 1 )); then- _actual=$(awk -v label="# of ${_label}" '$0 ~ "^" label "[[:space:]]+" { print $NF }' "${_file}")- else- printf 'Expected at most one testsuite count for %s in %s, found %d\n' "${_label}" "${_file}" "${_matches}" >&2- return 1- fi- if [[ ! ${_actual} =~ ^[0-9]+$ ]] || (( _actual != _expected )); then- printf 'Unexpected testsuite count in %s: %s=%s, expected %d\n' \- "${_file}" "${_label}" "${_actual}" "${_expected}" >&2- return 1- fi-}- prepare() {- local _default_option_test _guality_skip _libbacktrace_count _libbacktrace_file+ local _default_option_test _fixinc_count _has_include_error_line _libbacktrace_count _libbacktrace_file _multilib_count local _libbacktrace_assignment='strippedtest_LDFLAGS = $(libbacktrace_testing_ldflags) -static -Wl,-Bstatic' local _default_pie_options='/* { dg-additional-options "-fno-pie -no-pie" } */' local _default_pie_ssp_options='/* { dg-additional-options "-fno-pie -no-pie -fno-stack-protector" } */'@@ -178,42 +182,33 @@ local _default_ssp_tests=( 'g++.target/i386/pr112824-2.C' )- local _guality_skips=(- 'gcc.dg/guality/loop-1.c'- 'gcc.dg/guality/pr43051-1.c'- 'gcc.dg/guality/pr43593.c'- 'gcc.dg/guality/pr54519-1.c'- 'gcc.dg/guality/pr54519-2.c'- 'gcc.dg/guality/pr54519-3.c'- 'gcc.dg/guality/pr54519-4.c'- 'gcc.dg/guality/pr54519-5.c'- 'gcc.dg/guality/pr54519-6.c'- 'gcc.dg/guality/pr54693-2.c'- 'gcc.dg/guality/pr54796.c'- 'gcc.dg/guality/pr56154-1.c'- 'gcc.dg/guality/pr59776.c'- 'gcc.dg/guality/sra-1.c'- 'gcc.dg/guality/vla-1.c'- 'gcc.dg/guality/vla-2.c'- 'g++.dg/guality/pr55665.C'- )- cd -- "${srcdir}/gcc-${_snapshot}" || return 1 - # This package carries snapshot-specific test classifications. Force an- # explicit review whenever the upstream snapshot changes instead of silently- # carrying forward skips, XFAILs, or expected-XPASS assumptions.- if [[ ${_snapshot} != "${_testsuite_contract_snapshot}" ]]; then- printf 'GCC testsuite contract needs review for snapshot %s (validated for %s)\n' \- "${_snapshot}" "${_testsuite_contract_snapshot}" >&2- return 1- fi-- # Do not run fixincludes.- sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in-- # Arch Linux installs 64-bit libraries in /usr/lib.- sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64+ # Do not run fixincludes. Fail closed if upstream changes the generated+ # invocation instead of silently carrying a no-op rewrite into a new snapshot.+ _fixinc_count=$(grep -cF './fixinc.sh' gcc/Makefile.in || true)+ if (( _fixinc_count != 1 )); then+ printf 'Expected exactly one fixinc.sh invocation, found %d\n' "${_fixinc_count}" >&2+ return 1+ fi+ sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in || return 1+ if grep -qF './fixinc.sh' gcc/Makefile.in; then+ printf 'Failed to disable fixinc.sh invocation\n' >&2+ return 1+ fi++ # Arch Linux installs 64-bit libraries in /usr/lib. Guard the exact upstream+ # layout so an automated snapshot update cannot silently miss this rewrite.+ _multilib_count=$(grep -cFx 'MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)' gcc/config/i386/t-linux64 || true)+ if (( _multilib_count != 1 )); then+ printf 'Expected exactly one x86_64 lib64 multilib mapping, found %d\n' "${_multilib_count}" >&2+ return 1+ fi+ sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64 || return 1+ if ! grep -qxF 'MULTILIB_OSDIRNAMES = m64=../lib$(call if_multiarch,:x86_64-linux-gnu)' gcc/config/i386/t-linux64; then+ printf 'Failed to rewrite x86_64 multilib mapping to /usr/lib\n' >&2+ return 1+ fi # libbacktrace's strippedtest asks libtool for -static and also passes # -Wl,-Bstatic. With GCC configured for default PIE, libtool consumes the@@ -233,38 +228,22 @@ sed -i '/strippedtest_LDFLAGS = /s/$/ -no-pie/' "${_libbacktrace_file}" || return 1 done - # Do not run longstanding upstream guality failures during package QA.- # GCC PR testsuite/125766 tracks this class of failures:- # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125766- for _guality_skip in "${_guality_skips[@]}"; do+ # PR preprocessor/121508 can cause spurious test failures while+ # builtin_has_include_1 returns immediately after diagnosing use outside a+ # directive, leaving parser state uninitialized. Skip only while that exact+ # buggy early-return shape is present. Once upstream removes the return, the+ # test automatically runs again and becomes the verification of the fix.+ # Proposed upstream fix:+ # https://gcc.gnu.org/pipermail/gcc-patches/2026-September/733109.html+ _has_include_error_line=$(grep -nF '"%qs used outside of preprocessing directive", name);' libcpp/macro.cc | cut -d: -f1)+ if [[ ${_has_include_error_line} =~ ^[0-9]+$ ]] \+ && sed -n "$((_has_include_error_line + 1))p" libcpp/macro.cc | grep -qxF ' return NULL;'; then _insert_test_skip \- '/* { dg-skip-if "Known upstream guality failure; GCC PR testsuite/125766" { *-*-* } } */' \- "gcc/testsuite/${_guality_skip}" || return 1- done-- # These nested-crash diagnostics tests are tracked by GCC PR diagnostics/121876.- # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121876- for _guality_skip in \- 'gcc.dg/plugin/crash-test-nested-ice.c' \- 'gcc.dg/plugin/crash-test-nested-write-through-null.c'; do- _insert_test_skip \- '/* { dg-skip-if "Known upstream nested-crash diagnostics failure; GCC PR diagnostics/121876" { *-*-* } } */' \- "gcc/testsuite/${_guality_skip}" || return 1- done-- # Three additional failures are still present in GCC's x86_64 result for the- # 20260927 snapshot track, independent of this package's build environment:- # https://gcc.gnu.org/pipermail/gcc-testresults/2026-September/888222.html- _insert_implicit_compile_skip \- '/* { dg-skip-if "Known upstream 17-20260927 x86_64 testsuite failure" { *-*-* } } */' \- gcc/testsuite/c-c++-common/analyzer/omp-parallel-for-1.c || return 1- for _guality_skip in \- 'gcc.target/i386/pr115102.c' \- 'gcc.target/i386/xchg-4.c'; do- _insert_test_skip \- '/* { dg-skip-if "Known upstream 17-20260927 x86_64 testsuite failure" { *-*-* } } */' \- "gcc/testsuite/${_guality_skip}" || return 1- done+ '/* { dg-skip-if "spurious test failures; include after upstream patch is merged" { *-*-* } } */' \+ gcc/testsuite/c-c++-common/cpp/has-include-1.c || return 1+ else+ printf 'PR preprocessor/121508 early-return marker absent; running has-include-1.c\n' >&2+ fi # This compiler intentionally enables default PIE and SSP. A small set of # upstream tests assumes those defaults are off when checking exact assembly@@ -286,14 +265,6 @@ "${_default_ssp_options}" \ "gcc/testsuite/${_default_option_test}" || return 1 done-- # ssa-sink-18 currently has no GCC Bugzilla PR. Upstream explicitly records- # that the architecture-independent ivopts change makes this test fail and- # discusses marking it XFAIL here:- # https://gcc.gnu.org/pipermail/gcc-patches/2026-June/719949.html- _insert_test_skip \- '/* { dg-skip-if "Known upstream ssa-sink-18 testsuite failure; see gcc-patches/719949" { *-*-* } } */' \- gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-18.c || return 1 mkdir -p -- "${srcdir}/gcc-build" }@@ -365,35 +336,11 @@ } check() {- local _check_cflags _check_cxxflags _check_target_cflags _check_target_cxxflags _entry _memlock_status _sum _symbols _xpass_count _xpass_index- local -a _actual_xpass+ local _check_cflags _check_cxxflags _check_target_cflags _check_target_cxxflags+ local _automake_log _entry _expected_test _known_failure _memlock_status _result _sum _symbols+ local _libbacktrace_summary='libbacktrace/test-suite.log'+ local -a _automake_logs _suites _unexpected_results local _memlock_skip='/* { dg-skip-if "mlock unavailable in test environment" { *-*-* } } */'- local _expected_xpass=(- 'XPASS: gcc.dg/guality/example.c -O0 execution test'- 'XPASS: gcc.dg/guality/example.c -O1 -DPREVENT_OPTIMIZATION execution test'- 'XPASS: gcc.dg/guality/example.c -Og -DPREVENT_OPTIMIZATION execution test'- 'XPASS: gcc.dg/guality/guality.c -O0 execution test'- 'XPASS: gcc.dg/guality/guality.c -O1 -DPREVENT_OPTIMIZATION execution test'- 'XPASS: gcc.dg/guality/guality.c -O2 -DPREVENT_OPTIMIZATION execution test'- 'XPASS: gcc.dg/guality/guality.c -O2 -flto -fno-use-linker-plugin -flto-partition=none -DPREVENT_OPTIMIZATION execution test'- 'XPASS: gcc.dg/guality/guality.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects -DPREVENT_OPTIMIZATION execution test'- 'XPASS: gcc.dg/guality/guality.c -O3 -g -DPREVENT_OPTIMIZATION execution test'- 'XPASS: gcc.dg/guality/guality.c -Og -DPREVENT_OPTIMIZATION execution test'- 'XPASS: gcc.dg/guality/guality.c -Os -DPREVENT_OPTIMIZATION execution test'- 'XPASS: gcc.dg/guality/inline-params.c -O2 -DPREVENT_OPTIMIZATION execution test'- 'XPASS: gcc.dg/guality/inline-params.c -O2 -flto -fno-use-linker-plugin -flto-partition=none -DPREVENT_OPTIMIZATION execution test'- 'XPASS: gcc.dg/guality/inline-params.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects -DPREVENT_OPTIMIZATION execution test'- 'XPASS: gcc.dg/guality/inline-params.c -O3 -g -DPREVENT_OPTIMIZATION execution test'- 'XPASS: gcc.dg/guality/inline-params.c -Os -DPREVENT_OPTIMIZATION execution test'- 'XPASS: gcc.dg/guality/pr41353-1.c -O1 -DPREVENT_OPTIMIZATION line 28 j == 28 + 37'- 'XPASS: gcc.dg/guality/pr41353-1.c -O2 -DPREVENT_OPTIMIZATION line 28 j == 28 + 37'- 'XPASS: gcc.dg/guality/pr41353-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none -DPREVENT_OPTIMIZATION line 28 j == 28 + 37'- 'XPASS: gcc.dg/guality/pr41353-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects -DPREVENT_OPTIMIZATION line 28 j == 28 + 37'- 'XPASS: gcc.dg/guality/pr41353-1.c -O3 -g -DPREVENT_OPTIMIZATION line 28 j == 28 + 37'- 'XPASS: gcc.dg/guality/pr41353-1.c -Og -DPREVENT_OPTIMIZATION line 28 j == 28 + 37'- 'XPASS: gcc.dg/guality/pr41353-1.c -Os -DPREVENT_OPTIMIZATION line 28 j == 28 + 37'- 'XPASS: gcc.target/i386/pr89618-2.c scan-tree-dump vect "loop vectorized using 16 byte vectors"'- ) local _no_gxx_shared=( "${CHOST}/libitm/.libs/libitm.so" "${CHOST}/libsanitizer/asan/.libs/libasan.so"@@ -418,7 +365,7 @@ 'libgomp.c++/allocator-1.C' 'libgomp.c++/allocator-2.C' )- local _suites=(+ local _required_suites=( 'gcc/testsuite/gcc/gcc.sum' 'gcc/testsuite/g++/g++.sum' "${CHOST}/libatomic/testsuite/libatomic.sum"@@ -474,19 +421,50 @@ _check_target_cflags='-g -O2' _check_target_cxxflags='-g -O2 -D_GNU_SOURCE -Wno-aggressive-loop-optimizations' - # Run every test except the explicitly documented upstream-known and- # environment-specific skips. Any remaining FAIL, ERROR, or UNRESOLVED is a- # package QA failure. Known upstream XPASS results are tracked separately- # below so a new unexpected-success class also requires review.- # Remove previous summaries first so a failed rerun cannot satisfy the QA- # contract with stale evidence from an older test execution.- rm -f -- "${_suites[@]}"+ # fixincludes uses AutoGen and does not produce a DejaGNU summary. Check it+ # separately so its harness status is explicit even if top-level wiring changes.+ make -O -C fixincludes check || return 1++ # Run the complete testsuite apart from the environment-only memlock skips.+ # DejaGNU itself exits successfully even when individual tests report FAIL, so+ # a non-zero top-level make status represents a harness/build failure and must+ # never be discarded. Known test FAILs are classified from the summaries below.+ # Aggregate PASS/XFAIL/UNSUPPORTED counts are deliberately not pinned so a+ # new GCC snapshot can add, remove, or reclassify tests without manual edits.+ # Remove every prior summary first so a failed rerun cannot reuse stale data.+ find . -type f \( -name '*.sum' -o -name 'test-suite.log' \) -delete || return 1 make -O -k \ CFLAGS="${_check_cflags}" \ CXXFLAGS="${_check_cxxflags}" \ CFLAGS_FOR_TARGET="${_check_target_cflags}" \ CXXFLAGS_FOR_TARGET="${_check_target_cxxflags}" \- check || true+ check || return 1++ for _sum in "${_required_suites[@]}"; do+ if [[ ! -s "${_sum}" ]]; then+ printf 'Missing required GCC testsuite summary: %s\n' "${_sum}" >&2+ return 1+ fi+ done+ if [[ ! -s "${_libbacktrace_summary}" ]]; then+ printf 'Missing libbacktrace testsuite summary: %s\n' "${_libbacktrace_summary}" >&2+ return 1+ fi++ mapfile -d '' -t _automake_logs < <(find . -type f -name 'test-suite.log' -print0 | sort -z)+ for _automake_log in "${_automake_logs[@]}"; do+ if ! grep -Eq '^# TOTAL:[[:space:]]+[1-9][0-9]*$' "${_automake_log}"; then+ printf 'Incomplete Automake testsuite summary: %s\n' "${_automake_log}" >&2+ return 1+ fi+ if grep -Eq '^# (FAIL|ERROR):[[:space:]]+[1-9][0-9]*$' "${_automake_log}"; then+ printf 'Unexpected Automake testsuite result in %s:\n' "${_automake_log}" >&2+ grep -E '^# (FAIL|ERROR):' "${_automake_log}" >&2+ return 1+ fi+ done++ mapfile -d '' -t _suites < <(find . -type f -name '*.sum' -print0 | sort -z) # Restore the extracted source tree after the environment-specific test # adaptation. The pre-run cleanup above still protects interrupted reruns.@@ -524,6 +502,7 @@ fi done + _unexpected_results=() for _entry in "${_suites[@]}"; do _sum=${_entry} if [[ ! -s "${_sum}" ]]; then@@ -534,82 +513,29 @@ printf 'Incomplete GCC testsuite summary: %s\n' "${_sum}" >&2 return 1 fi- if grep -Eq '^(FAIL|ERROR|UNRESOLVED):' "${_sum}"; then- printf 'Unexpected GCC testsuite result in %s:\n' "${_sum}" >&2- grep -E '^(FAIL|ERROR|UNRESOLVED):' "${_sum}" >&2- return 1- fi- done-- # Pin the aggregate outcome counts for this exact snapshot. This catches- # harness or dependency drift that silently turns large parts of a suite- # into UNSUPPORTED while still producing a superficially successful summary.- _require_testsuite_count gcc/testsuite/g++/g++.sum 'expected passes' 280053 || return 1- _require_testsuite_count gcc/testsuite/g++/g++.sum 'expected failures' 2534 || return 1- _require_testsuite_count gcc/testsuite/g++/g++.sum 'unsupported tests' 2071 || return 1- _require_testsuite_count gcc/testsuite/gcc/gcc.sum 'expected passes' 228642 || return 1- _require_testsuite_count gcc/testsuite/gcc/gcc.sum 'unexpected successes' 24 || return 1- _require_testsuite_count gcc/testsuite/gcc/gcc.sum 'expected failures' 1641 || return 1- _require_testsuite_count gcc/testsuite/gcc/gcc.sum 'unsupported tests' 4324 || return 1- _require_testsuite_count "${CHOST}/libatomic/testsuite/libatomic.sum" 'expected passes' 54 || return 1- _require_testsuite_count "${CHOST}/libatomic/testsuite/libatomic.sum" 'expected failures' 0 || return 1- _require_testsuite_count "${CHOST}/libatomic/testsuite/libatomic.sum" 'unsupported tests' 0 || return 1- if (( _memlock_status == 77 )); then- _require_testsuite_count "${CHOST}/libgomp/testsuite/libgomp.sum" 'expected passes' 6376 || return 1- _require_testsuite_count "${CHOST}/libgomp/testsuite/libgomp.sum" 'unsupported tests' 510 || return 1- else- # The unrestricted baseline executes the six pinned allocator tests:- # compared with the sandboxed result this adds 12 PASS and removes- # six UNSUPPORTED entries.- _require_testsuite_count "${CHOST}/libgomp/testsuite/libgomp.sum" 'expected passes' 6388 || return 1- _require_testsuite_count "${CHOST}/libgomp/testsuite/libgomp.sum" 'unsupported tests' 504 || return 1- fi- _require_testsuite_count "${CHOST}/libgomp/testsuite/libgomp.sum" 'expected failures' 47 || return 1- _require_testsuite_count "${CHOST}/libitm/testsuite/libitm.sum" 'expected passes' 44 || return 1- _require_testsuite_count "${CHOST}/libitm/testsuite/libitm.sum" 'expected failures' 3 || return 1- _require_testsuite_count "${CHOST}/libitm/testsuite/libitm.sum" 'unsupported tests' 1 || return 1- _require_testsuite_count "${CHOST}/libstdc++-v3/testsuite/libstdc++.sum" 'expected passes' 20021 || return 1- _require_testsuite_count "${CHOST}/libstdc++-v3/testsuite/libstdc++.sum" 'expected failures' 129 || return 1- _require_testsuite_count "${CHOST}/libstdc++-v3/testsuite/libstdc++.sum" 'unsupported tests' 831 || return 1-- # Compare every normalized XPASS line for this snapshot. Pinning only the- # total and file names would allow a newly introduced XPASS to replace a- # resolved one in the same source file without failing QA.- mapfile -t _actual_xpass < <(- grep '^XPASS:' gcc/testsuite/gcc/gcc.sum |- sed -E 's/[[:space:]]+/ /g; s/ $//' |- LC_ALL=C sort- )- _xpass_count=${#_actual_xpass[@]}- if (( _xpass_count != ${#_expected_xpass[@]} )); then- printf 'Expected %d known GCC XPASS results, found %d\n' \- "${#_expected_xpass[@]}" "${_xpass_count}" >&2- printf 'Actual normalized XPASS results:\n' >&2- printf '%s\n' "${_actual_xpass[@]}" >&2- return 1- fi- for (( _xpass_index = 0; _xpass_index < _xpass_count; ++_xpass_index )); do- if [[ ${_actual_xpass[${_xpass_index}]} != "${_expected_xpass[${_xpass_index}]}" ]]; then- printf 'Unexpected GCC XPASS at index %d:\nexpected: %s\nactual: %s\n' \- "${_xpass_index}" \- "${_expected_xpass[${_xpass_index}]}" \- "${_actual_xpass[${_xpass_index}]}" >&2- return 1- fi- done- - for _sum in \- gcc/testsuite/g++/g++.sum \- "${CHOST}/libatomic/testsuite/libatomic.sum" \- "${CHOST}/libgomp/testsuite/libgomp.sum" \- "${CHOST}/libitm/testsuite/libitm.sum" \- "${CHOST}/libstdc++-v3/testsuite/libstdc++.sum"; do- if grep -q '^XPASS:' "${_sum}"; then- printf 'Unexpected XPASS result in %s:\n' "${_sum}" >&2- grep '^XPASS:' "${_sum}" >&2- return 1- fi- done++ while IFS= read -r _result; do+ _known_failure=0+ if [[ ${_result} == FAIL:* ]]; then+ for _expected_test in "${_expected_failure_tests[@]}"; do+ if [[ ${_result} == "FAIL: ${_expected_test}" || ${_result} == "FAIL: ${_expected_test}"[[:space:]]* ]]; then+ _known_failure=1+ printf 'Accepting known GCC testsuite failure: %s\n' "${_result}" >&2+ break+ fi+ done+ fi+ if (( ! _known_failure )); then+ _unexpected_results+=("${_sum}: ${_result}")+ fi+ done < <(grep -E '^(FAIL|ERROR|UNRESOLVED):' "${_sum}" || true)+ done++ if (( ${#_unexpected_results[@]} != 0 )); then+ printf 'Unexpected GCC testsuite results:\n' >&2+ printf '%s\n' "${_unexpected_results[@]}" >&2+ return 1+ fi if (( _memlock_status == 77 )); then for _entry in "${_pinned_tests[@]}"; doScan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-10-07 06:05:09 | Low | 1 |
| 2026-10-06 00:13:36 | Clean | 2 |
| 2026-10-05 23:40:58 | Low | 1 |