[clang] [clang][Driver] Don't force a linker emulation on FreeBSD/LoongArch (PR #249442)

Alex Rønne Petersen via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 6 09:02:29 PST 2026


alexrp wrote:

Aha, I think this comes back to https://github.com/llvm/llvm-project/pull/228689.

FreeBSD doesn't brand shared libraries because of:

```
❯ git grep crtbrand.o
Makefile.inc:18: 12:CRT1OBJS+=  crtbrand.o feature_note.o ignore_init_note.o
Makefile.inc:60: 1:crtbrand.o: ${SRCTOP}/sys/sys/param.h
Makefile.inc:78: 18:crti.o: crti_s.o crtbrand.o
```

So I think this driver change isn't quite the right place to fix this. I think FreeBSD should do one of the following:

* Also include `crtbrand.o` in `crtbegin*.o`
* Provide `crti.o` for LoongArch after all, but it only contains `crtbrand.o`, no legacy init/fini stuff
    * This would effectively require a revert of https://github.com/llvm/llvm-project/pull/228689

Either of these should make the driver change unnecessary.

(RISC-V is fine because `crti.o` still exists there and causes the brand note to be included.)

https://github.com/llvm/llvm-project/pull/249442


More information about the cfe-commits mailing list