[Clang][LoongArch] Consume and check -mabi and -mfpu even if -m*-float is present
This kind of CLI flags duplication can sometimes be convenient for build systems that may have to tinker with these. For example, in the Linux kernel we almost always want to ensure no FP instruction is emitted, so `-msoft-float` is present by default; but sometimes we do want to allow FPU usage (e.g. certain parts of amdgpu DC code), in which case we want the `-msoft-float` stripped and `-mfpu=64` added. Here we face a dilemma without this change: * Either `-mabi` is not supplied by `arch/loongarch` Makefile, in which case the correct ABI has to be supplied by the driver Makefile (otherwise the ABI will become double-float due to `-mfpu`), which is arguably not appropriate for a driver; * Or `-mabi` is still supplied by `arch/loongarch` Makefile, and the build immediately errors out because `-Werror=unused-command-line-argument` is unconditionally set for Clang builds. To solve this, simply make sure to check `-mabi` and `-mfpu` (and gain some useful diagnostics in case of conflicting settings) when `-m*-float` is successfully parsed. Reviewed By: SixWeining, MaskRay Differential Revision: https://reviews.llvm.org/D153707
Loading
Please sign in to comment