Re: git: e959f2a7d8a8 - main - ctf*: exit with error upon terminate()

From: Ryan Libby <rlibby_at_freebsd.org>
Date: Fri, 20 Nov 2026 22:43:42 UTC
On Fri, Oct 9, 2026 at 11:47 AM Ed Maste <emaste@freebsd.org> wrote:
>
> The branch main has been updated by emaste:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=e959f2a7d8a8ac942983328f91cd5c566e3f72cb
>
> commit e959f2a7d8a8ac942983328f91cd5c566e3f72cb
> Author:     Ed Maste <emaste@FreeBSD.org>
> AuthorDate: 2024-02-04 21:47:50 +0000
> Commit:     Ed Maste <emaste@FreeBSD.org>
> CommitDate: 2026-10-09 18:23:42 +0000
>
>     ctf*: exit with error upon terminate()
>
>     The initial port of the CTF tools had a FreeBSD-specific patch to print
>     the termination message but exit with a 0 status, with a goal of getting
>     as much to build as possible and silently ignoring any issues.
>
>     We're now past the point where silently ignoring failures makes sense.
>     Any future issues need to be found and addressed.
>
>     PR:             276826
>     PR:             276930 [exp-run]
>     Reviewed by:    markj
>     Sponsored by:   The FreeBSD Foundation
>     Differential Revision: https://reviews.freebsd.org/D43743
> ---
>  cddl/contrib/opensolaris/tools/ctf/cvt/util.c | 10 ----------
>  1 file changed, 10 deletions(-)
>
> diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/util.c b/cddl/contrib/opensolaris/tools/ctf/cvt/util.c
> index 0eda56dbf65a..5139725bb9cf 100644
> --- a/cddl/contrib/opensolaris/tools/ctf/cvt/util.c
> +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/util.c
> @@ -149,17 +149,7 @@ terminate(const char *format, ...)
>
>         if (getenv("CTF_ABORT_ON_TERMINATE") != NULL)
>                 abort();
> -#if defined(__FreeBSD__)
> -/*
> - * For the time being just output the termination message, but don't
> - * return an exit status that would cause the build to fail. We need
> - * to get as much stuff built as possible before going back and
> - * figuring out what is wrong with certain files.
> - */
> -       exit(0);
> -#else
>         exit(1);
> -#endif
>  }
>
>  /*PRINTFLIKE1*/
>

It appears that the gcc builds have not succeeded since this went in.

I see a few fixes have gone in since then, including 40371e514185, but
there are a few more problems I am hitting.

1: There are some asm files that pass the check for having any debug
info, but then don't have child DIEs, I guess because they have ENTRY()
macros but nothing else, e.g. exception.S.  We could just warn and skip
such files.

2: There are some asm files that end up as entirely empty, for which gcc
produces no .symtab, and we now balk at that, e.g. how we build
aesni-gcm-avx2-vaes.S, resulting in "cannot convert stripped objects".
Again, we could warn and skip.

3: gcc emits debug info for typedef types even if they aren't otherwise
used, and some of those types aren't supported by ctf, e.g. from
intel_sha256.c a 2-byte float introduced via headers but not used.  We
could sub in an opaque type or something?  I assume no one actually
cares about 2-byte floats.

We can make ctfconvert handle each of these cases more gracefully, or
maybe you all have something else in mind for how these should be fixed
(maybe elsewhere in the toolchain?).

I have a small diff to cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
and ctfconvert.c from claude that allows the build to succeed, but I
don't want to assume that that direction is correct.  I think it would
probably be better if someone knowledgeable worked through the build
failures.  Here is an example build recipe that currently fails:

pkg install amd64-gcc14
env MAKEOBJDIRPREFIX=/usr/obj/amd64-gcc14 CROSS_TOOLCHAIN=amd64-gcc14
make kernel-toolchain -j$(sysctl -n hw.ncpu)
env MAKEOBJDIRPREFIX=/usr/obj/amd64-gcc14 CROSS_TOOLCHAIN=amd64-gcc14
make buildkernel -j$(sysctl -n hw.ncpu) KERNCONF=GENERIC

That should be enough to hit all the issues.

Last successful gcc build in CI:
https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc14_build/4887/
Next build includes e959f2a7d8a8ac942983328f91cd5c566e3f72cb and fails:
https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc14_build/4888/
All gcc builds have failed since.

Best,

Ryan