[lld] [ELF,SPARC] Add the 32-bit SPARC target (PR #228200)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 4 11:14:09 PDT 2026
https://github.com/MaskRay requested changes to this pull request.
Thanks for the patches and for disclosing the AI assistance.
Here is where 32-bit SPARC stands today:
- Linux: the kernel keeps sparc32 mainly for LEON, and current kernels don't boot on non-LEON hardware.
- glibc: requires CAS, which excludes sun4m/SuperSPARC. 32-bit is tested only as a -m32 variant of sparc64.
- musl: no SPARC port.
- Distributions: none ships a 32-bit SPARC userland. Debian dropped it after wheezy.
- BSDs: OpenBSD/sparc ended with 5.9, and FreeBSD never had it. NetBSD/sparc remains, using GNU ld.
The remaining users with a vendor behind them are LEON (Frontgrade Gaisler), and they are moving to RISC-V (NOEL-V).
Given that, as lld/ELF, MC, and binary utilities maintainer, I'm not in favor of adding 32-bit SPARC to lld in-tree. Once code is in-tree it is a shared cost, and for lld/ELF that cost largely falls on me. Retro-computing targets need a high bar:
- Harm to the generic core. Old architectures rarely stay inside Arch/. They need workarounds here and there in the driver, input-file handling and output writing, which every later refactor must preserve. This series already does it: #228201 remaps EM_SPARC32PLUS to EM_SPARC across inferMachineType, isCompatible and writeEhdr. Distribution libgcc and libatomic are EM_SPARC32PLUS, so that patch would have to follow.
- No testing infrastructure. With no buildbot and no runtime testing, this code would bitrot quietly.
- Reviewability. Largely LLM-generated contributions are discouraged under the AI Tool Use Policy. For generated code, the open question is whether anyone understands it well enough to maintain and debug it independently. First-time contributors are also not expected to send a stacked series adding a new ELF target.
- Precedent. If we accept this, we should expect more single-author, low-community targets. I'd rather hold the bar than relax it case by case. See the similar EZH discussion.
A downstream fork fits this effort better. It keeps the cost with the people who benefit, and you can iterate without waiting on upstream review. The usual objection is rebase pain, but that is largely gone: resolving API churn against upstream, rebuilding and rerunning the target's tests is exactly what an agent does well.
I'm marking this "Request changes" to make the objection explicit, since I may not follow every notification here. This PR, and #228201 with it, should be considered rejected. Overturning that would take strong community support, raised on Discourse, not an approval on this PR.
https://github.com/llvm/llvm-project/pull/228200
More information about the llvm-commits
mailing list