Heads-up: Migrating to LLVM binutils tools (ar, nm, addr2line, etc.) for FreeBSD 15.0

From: Ed Maste <emaste_at_freebsd.org>
Date: Mon, 10 Jun 2024 15:43:48 UTC
On Mon, 5 Jul 2021 at 11:09, Ed Maste <emaste@freebsd.org> wrote:
>
> FreeBSD migrated from GNU binutils to versions from ELF Tool Chain,
> starting in 2014. At that time there were no usable LLVM versions of
> those tools, but they have been developing rapidly since then. Now I
> think it may be prudent to migrate to the LLVM tools where they exist,
> for both functionality and maintainability reasons.

For the rest of the context see the thread at
https://lists.freebsd.org/archives/freebsd-hackers/2021-July/000111.html

> Potential next steps are:
> - Introduce new build knob

This was done by Alex Richardson in commit 021385aba562.

> - Iterate on exp-runs and call for testing

The exp-run is PR258872. There are five open bugs for ports failing to
build with LLVM_BINUTILS:

1. PR270421 graphics/librsvg2-rust

This needs to be fixed in the port -- it combines ports LLVM with base
system nm / ar, and they're not compatible for LTO.

2. PR270962 sysutils/stressdisk

This is an issue in llvm-strip -
https://github.com/llvm/llvm-project/issues/53999. For FreeBSD ports
the short-term workaround is probably to have it use GNU binutils
instead

3. PR270963 textproc/sxml

The PR has a patch that addresses the issue, but has some issues that
need to be addressed before being committed.

4. PR278172 lang/racket*
5. PR278895 lang/ghc

It's not clear to me what's happening for these two. Likely switch to
GNU binutils for them.

> - Switch to LLVM tools by default
> - Major release (14.0)

This clearly did not happen for FreeBSD 14.0, but I plan to do this before 15.0.

> - Retire knob, leaving only the LLVM implementation.

The knob would remain in place for at least one release; this will not
happen before 16.0.