We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f7817a0 commit 60a1c08Copy full SHA for 60a1c08
1 file changed
c/gcc.mk
@@ -26,8 +26,9 @@ ifndef MARCH
26
endif
27
ifneq ($(MARCH),none)
28
MARCH_FLAGS = -march=$(MARCH)
29
- gcc-guess-march = $(strip $(shell $(CC) $(CFLAGS) $(OPT_CFLAGS) $(MARCH_FLAGS) -x c -S -\#\#\# - < /dev/null 2>&1 | \
30
- grep -m 1 -e cc1 | grep -o -e "march=[^'\"]*" | head -n 1 | sed 's,march=,,'))
+ # GCC prints -march=CPU. Clang prints "-target-cpu" "CPU".
+ gcc-guess-march = $(strip $(shell $(CC) $(CFLAGS) $(OPT_CFLAGS) $(MARCH_FLAGS) -x c -S -\#\#\# - < /dev/null 2>&1 | \
31
+ sed -n '/cc1/{s/.*march=\([^"'"'"' ]*\).*/\1/p;s/.*-target-cpu" "\([^"]*\)".*/\1/p;q;}'))
32
ifeq ($(gcc-guess-march),)
33
gcc-guess-march=unknown
34
0 commit comments