[PATCH] D106378: RISCV: relax the ABI mismatch checking

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 20 09:59:57 PDT 2021


jrtc27 added a comment.

I've never liked this, because it _is_ possible to screw up here. It is quite plausible that struct layout will be conditional on `__riscv_float_abi_*` and that you could have a data-only C file.

IMO, using objcopy to put a binary blob back into an ELF is broken by design without the ability to also set the ELF flags in it. There is already a much better option than this: use an assembly file that `.incbin`'s the binary blob, and assemble it with Clang as normal. This removes a reliance on miscellaneous binary utilities and it ensures the file gets _exactly_ the same ELF header etc as any other file in your build. This is what we have switched to in FreeBSD. If the motivation is to support Linux, I highly suggest you just fix Linux to avoid this kind of hack.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106378/new/

https://reviews.llvm.org/D106378



More information about the llvm-commits mailing list