-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Clang][LoongArch] Consume and check -mabi and -mfpu even if -m*-floa…
…t 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 branch information
1 parent
6617778
commit f693200
Showing
5 changed files
with
83 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters