diff --git a/common/GNUmakefile b/common/GNUmakefile index 8857ae9c..b7d5b010 100644 --- a/common/GNUmakefile +++ b/common/GNUmakefile @@ -131,16 +131,18 @@ ifeq ($(TARGET),uefi-aarch64) endif ifeq ($(TARGET),uefi-riscv64) + override CFLAGS_FOR_TARGET += \ + -fPIE \ + -fshort-wchar + ifeq ($(CC_FOR_TARGET_IS_CLANG),yes) - override RISCV_CFLAGS += -march=rv64imac -mabi=lp64 + override CFLAGS_FOR_TARGET += -march=rv64imac else - override RISCV_CFLAGS += -march=rv64imac_zicsr_zifencei -mabi=lp64 + override CFLAGS_FOR_TARGET += -march=rv64imac_zicsr_zifencei endif override CFLAGS_FOR_TARGET += \ - -fPIE \ - -fshort-wchar \ - $(RISCV_CFLAGS) + -mabi=lp64 override CPPFLAGS_FOR_TARGET := \ -I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc' \ @@ -435,7 +437,7 @@ $(call MKESCAPE,$(BUILDDIR))/BOOTRISCV64.EFI: $(call MKESCAPE,$(BUILDDIR))/limin $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-riscv64.S.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/reloc_riscv64.c.o: $(call MKESCAPE,$(BUILDDIR))/limine-efi $(MAKE) -C '$(call SHESCAPE,$(BUILDDIR))/limine-efi/gnuefi' \ CC="$(CC_FOR_TARGET)" \ - CFLAGS="$(BASE_CFLAGS) $(RISCV_CFLAGS)" \ + CFLAGS="$(BASE_CFLAGS)" \ CPPFLAGS='-nostdinc -I$(call SHESCAPE,$(SRCDIR))/../freestanding-headers' \ ARCH=riscv64