From 8854416139c9b1075672f78a8b4af421c5ac6159 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Mon, 13 Nov 2017 21:17:28 +0000 Subject: [PATCH] gcc doesn't like -mcpu so i just can't win --- sh/compile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sh/compile b/sh/compile index f6a2281..c617f64 100755 --- a/sh/compile +++ b/sh/compile @@ -127,10 +127,16 @@ compile() { local dr_flags=(-Ox -Zi) local hardened_flags=(-Ox -sdl) else - local debug_flags=(-O1 -mcpu=native -g -D_DEBUG); - local release_flags=(-Ofast -mcpu=native -g0 -fomit-frame-pointer -s -DNDEBUG) - local dr_flags=(-Ofast -mcpu=native --g -fomit-frame-pointer -DNDEBUG) - local hardened_flags=(-O3 -mcpu=native -g0 -s + if [ $CC = clang ]; then + # clang doesn't like -march=native on ARM for some reason. + our_flags+=(-mcpu=native) + else + our_flags+=(-march=native) + fi + local debug_flags=(-O1 -g -D_DEBUG); + local release_flags=(-Ofast -mtune=native -g0 -fomit-frame-pointer -s -DNDEBUG) + local dr_flags=(-Ofast -g -fomit-frame-pointer -DNDEBUG) + local hardened_flags=(-O3 -g0 -s -DNDEBUG -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security)