diff options
author | Anup Patel <anup.patel@wdc.com> | 2021-12-02 10:30:28 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2021-12-11 17:37:26 +0530 |
commit | 69d7e536138ae71a24028ca849d401a4d64d564b (patch) | |
tree | 8cb7c951618da9efd9373b9e4b07c7713e892651 | |
parent | 460041c816f1b174899a3bf1147ce5d2e95731f4 (diff) |
Makefile: Fix -msave-restore compile warning with CLANG-10 (or lower)
The riscv target of CLANG-10 (or lower) does not support the
-m(no-)save-restore option so we get compile warnings. This patch
fixes compile warning by using -m(no-)save-restore option only
for GCC.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Dong Du <Dd_nirvana@sjtu.edu.cn>
-rw-r--r-- | Makefile | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -275,8 +275,11 @@ GENFLAGS += $(platform-genflags-y) GENFLAGS += $(firmware-genflags-y) CFLAGS = -g -Wall -Werror -ffreestanding -nostdlib -fno-stack-protector -fno-strict-aliasing -O2 -CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls -CFLAGS += -mno-save-restore -mstrict-align +CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls -mstrict-align +# CLANG-10 (or lower) does not support -m(no-)save-restore option +ifneq ($(CC_IS_CLANG),y) +CFLAGS += -mno-save-restore +endif CFLAGS += -mabi=$(PLATFORM_RISCV_ABI) -march=$(PLATFORM_RISCV_ISA) CFLAGS += -mcmodel=$(PLATFORM_RISCV_CODE_MODEL) CFLAGS += $(RELAX_FLAG) @@ -290,8 +293,11 @@ CPPFLAGS += $(platform-cppflags-y) CPPFLAGS += $(firmware-cppflags-y) ASFLAGS = -g -Wall -nostdlib -ASFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls -ASFLAGS += -mno-save-restore -mstrict-align +ASFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls -mstrict-align +# CLANG-10 (or lower) does not support -m(no-)save-restore option +ifneq ($(CC_IS_CLANG),y) +ASFLAGS += -mno-save-restore +endif ASFLAGS += -mabi=$(PLATFORM_RISCV_ABI) -march=$(PLATFORM_RISCV_ISA) ASFLAGS += -mcmodel=$(PLATFORM_RISCV_CODE_MODEL) ASFLAGS += $(RELAX_FLAG) |