Bug 267169

Summary: Build of recent -CURRENT fails with external GCC toolchain
Product: Base System Reporter: Yasuhiro Kimura <yasu>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: des, emaste, jhb, lwhsu
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description Yasuhiro Kimura freebsd_committer freebsd_triage 2022-10-18 10:12:58 UTC
Host: 13.1-RELEASE-p2 amd64
Toolchain: amd64-binutils-2.37_4,1, amd64-gcc9-9.5.0, amd64-gcc12-12.1.0
Source: base 713efe05429 (main branch)

Build log with amd64-gcc9:
https://people.freebsd.org/~yasu/make-buildworld-builkernel.713efe05429.amd64-gcc9.log

Build log with amd64-gcc12:
https://people.freebsd.org/~yasu/make-buildworld-builkernel.713efe05429.amd64-gcc12.log
Comment 1 Li-Wen Hsu freebsd_committer freebsd_triage 2022-10-18 12:19:53 UTC
ci.freebsd.org see the same error: https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc9_build/
Comment 2 Ed Maste freebsd_committer freebsd_triage 2022-10-24 13:41:52 UTC
From the log:

/usr/src/lib/libfetch/http.c: In function 'http_digest_auth':
/usr/src/lib/libfetch/http.c:1285:9: error: 'DigestCalcResponse' reading 33 bytes from a region of size 1 [-Werror=stringop-overread]
 1285 |         DigestCalcResponse(HA1, c->nonce, noncecount, cnonce, c->qop,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1286 |                            "GET", url->doc, "", digest);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/lib/libfetch/http.c:1285:9: note: referencing argument 8 of type 'const char[33]'
/usr/src/lib/libfetch/http.c:1285:9: note: referencing argument 9 of type 'char[33]'
/usr/src/lib/libfetch/http.c:1175:1: note: in a call to function 'DigestCalcResponse'
 1175 | DigestCalcResponse(
      | ^~~~~~~~~~~~~~~~~~
Comment 3 John Baldwin freebsd_committer freebsd_triage 2022-10-26 20:43:12 UTC
https://reviews.freebsd.org/D36825 (for the libfetch one)
Comment 4 Yasuhiro Kimura freebsd_committer freebsd_triage 2022-11-01 13:01:21 UTC
Host: 13.1-RELEASE-p2 amd64:
Toolchain: amd64-binutils-2.37_4,1, amd64-gcc12-12.1.0
Source: base d835a2f8be8 + review D36825

Build log: https://people.freebsd.org/~yasu/make-buildworld.d835a2f8be8+D36825.amd64-gcc12.log
Comment 5 John Baldwin freebsd_committer freebsd_triage 2022-11-01 21:28:57 UTC
You will have better luck trying the fixes from the branch at https://github.com/bsdjhb/freebsd/tree/gcc9_universe

Note that this disables C++ for GCC 9.  For GCC 12 kernels don't yet build as the patch to add support for -fformat-extensions is not working on GCC 12 and I haven't tracked down why yet.  Some of the patches from that branch are in review in various phabricator reviews.  C++ in userland needs the LLVM change that is kind of stuck on an upstream version of the change I need to get back to.
Comment 6 John Baldwin freebsd_committer freebsd_triage 2022-11-29 04:10:56 UTC
CI for GCC 9 is finally green.

https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc9_build/4870/

I have amd64 world + GENERIC building with GCC 12 which I hope to have added to CI soon (I have some pending patches for the GCC 12 build that still need review)