yroussel | 1319005 | 2012-01-12 16:09:06 +0100 | [diff] [blame] | 1 | CLANG := $(HOST_OUT_EXECUTABLES)/clang$(HOST_EXECUTABLE_SUFFIX) |
| 2 | LLVM_LINK := $(HOST_OUT_EXECUTABLES)/llvm-link$(HOST_EXECUTABLE_SUFFIX) |
| 3 | |
| 4 | define do-clang-flags-subst |
| 5 | TARGET_GLOBAL_CLANG_FLAGS := $(subst $(1),$(2),$(TARGET_GLOBAL_CLANG_FLAGS)) |
| 6 | HOST_GLOBAL_CLANG_FLAGS := $(subst $(1),$(2),$(HOST_GLOBAL_CLANG_FLAGS)) |
| 7 | endef |
| 8 | |
| 9 | define clang-flags-subst |
| 10 | $(eval $(call do-clang-flags-subst,$(1),$(2))) |
| 11 | endef |
| 12 | |
| 13 | |
| 14 | # These seem to cause warnings on clang/LLVM. |
| 15 | CLANG_CONFIG_UNKNOWN_CFLAGS := \ |
| 16 | -mthumb-interwork \ |
| 17 | -fgcse-after-reload \ |
| 18 | -frerun-cse-after-loop \ |
| 19 | -frename-registers \ |
| 20 | -funswitch-loops \ |
| 21 | -Wa,--noexecstack \ |
| 22 | -mfpu=vfpv3-d16 |
| 23 | |
| 24 | # Workaround a SIGSEGV in Lol |
| 25 | CLANG_CONFIG_UNKNOWN_CFLAGS += -g |
| 26 | |
| 27 | # remove unknown flags to define CLANG_FLAGS |
| 28 | TARGET_GLOBAL_CLANG_FLAGS += $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(TARGET_GLOBAL_CFLAGS)) |
| 29 | HOST_GLOBAL_CLANG_FLAGS += $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(HOST_GLOBAL_CFLAGS)) |
| 30 | |
| 31 | # llvm does not yet support -march=armv5e nor -march=armv5te, fall back to armv5 or armv5t |
| 32 | $(call clang-flags-subst,-march=armv5te,-march=armv5t) |
| 33 | $(call clang-flags-subst,-march=armv5e,-march=armv5) |