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.
This is not called setting. Use value
It seems that ignoring -mabi value '%0' as it conflicts ... is more conventional.