[lld] [llvm] Reapply "[RISCV] Support RISCV Atomics ABI attributes (#84597)" (PR #90266)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 13:58:13 PDT 2024


MaskRay wrote:

> Seems like @MaskRay reported the bfd bug quite a while ago. [sourceware.org/bugzilla/show_bug.cgi?id=29823](https://sourceware.org/bugzilla/show_bug.cgi?id=29823)

Hopefully @Nelson1225 can take a look.

---

As we add more build attributes, `llvm-readelf -A riscv64.o` starts to resemble a typical AArch32 relocatable file with over 10 attributes.
This might not be ideal for everyone, and I haven't found another architecture doing this.

The GNU ld error suggests the atomic attribute should be opt-in.
This allows groups who find these attributes useful to enable them explicitly.

On the LLVM side, we can have a `cl::opt<bool>` option to control whether such attributes should be emitted.
We can replace this with a driver option after we gain more experience and agree with GCC.
It is possible that we will eventually go the AArch32 way and a typical relocatable file will contain 10+ attributes, but that's probably not the immediate focus.


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


More information about the llvm-commits mailing list