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

via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 6 12:58:54 PST 2026


hitmoon wrote:

> Aha, I think this comes back to [#228689](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 [[clang][Driver]: Skip crti.o/crtn.o on LoongArch FreeBSD #228689](https://github.com/llvm/llvm-project/pull/228689)
> 
> Either of these should make this driver change unnecessary.
> 
> (RISC-V is fine because `crti.o` still exists there and causes the brand note to be included.)

@brooksdavis 


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


More information about the cfe-commits mailing list