Skip to content

Commit

Permalink
Fix the -march issue for riscv64
Browse files Browse the repository at this point in the history
There is an issue on riscv64 system when compiling it natively:
gcc: error: '-march=native': ISA string must begin with rv32 or rv64

This patch set HOST_MARCH= like ia64 to resolve the issue.

Signed-off-by: Wei Fu <wefu@redhat.com>
  • Loading branch information
tekkamanninja committed Apr 2, 2022
1 parent 28789d1 commit 5eb063f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/include/defaults.mk
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ override SOFLAGS = $(_SOFLAGS) \

HOST_ARCH=$(shell uname -m)
ifneq ($(HOST_ARCH),ia64)
ifneq ($(HOST_ARCH),riscv64)
HOST_MARCH=-march=native
else
HOST_MARCH=
endif
else
HOST_MARCH=
endif
HOST_CPPFLAGS ?= $(CPPFLAGS)
override _HOST_CPPFLAGS := $(HOST_CPPFLAGS)
override HOST_CPPFLAGS = $(_HOST_CPPFLAGS) \
Expand Down

0 comments on commit 5eb063f

Please sign in to comment.