Skip to content

Commit

Permalink
higan-ui: Don't use -march=native on ARM systems.
Browse files Browse the repository at this point in the history
Apparently -march=native doesn't behave the same way on ARM as it does on x86,
and clang doesn't support it at all, so when building with local=true we need to
detect the architecture.
  • Loading branch information
devnexen authored and Screwtapello committed Mar 21, 2021
1 parent a589c82 commit 205c90d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion higan-ui/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ local := true
flags += -I. -I.. -I../higan

ifeq ($(local),true)
flags += -march=native
ifeq ($(findstring arm,$(shell uname -m)),arm)
# According to
# https://community.arm.com/developer/tools-software/tools/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu
# ... -mcpu=native is the ARM equivalent of -march=native on x86.
flags += -mcpu=native
else
# This is not portable, but since Windows doesn't provide a uname binary,
# it has to be the default.
flags += -march=native
endif
endif

nall.path := ../nall
Expand Down

0 comments on commit 205c90d

Please sign in to comment.