Define a basic llvm-link + clang environment

Move it from dalvik/vm/translator/runtime/ to build/
Add handling of -march=armv5te and -march=armv5e
This commit is contained in:
yroussel
2012-01-12 16:09:06 +01:00
committed by Evgeniy Stepanov
parent 7013298265
commit 1319005a2a
2 changed files with 36 additions and 0 deletions

View File

@@ -344,6 +344,9 @@ HOST_GLOBAL_CPPFLAGS += $(HOST_RELEASE_CPPFLAGS)
TARGET_GLOBAL_CFLAGS += $(TARGET_RELEASE_CFLAGS)
TARGET_GLOBAL_CPPFLAGS += $(TARGET_RELEASE_CPPFLAGS)
# define llvm tools and global flags
include $(BUILD_SYSTEM)/llvm_config.mk
PREBUILT_IS_PRESENT := $(if $(wildcard prebuilt/Android.mk),true)
# ###############################################################

33
core/llvm_config.mk Normal file
View File

@@ -0,0 +1,33 @@
CLANG := $(HOST_OUT_EXECUTABLES)/clang$(HOST_EXECUTABLE_SUFFIX)
LLVM_LINK := $(HOST_OUT_EXECUTABLES)/llvm-link$(HOST_EXECUTABLE_SUFFIX)
define do-clang-flags-subst
TARGET_GLOBAL_CLANG_FLAGS := $(subst $(1),$(2),$(TARGET_GLOBAL_CLANG_FLAGS))
HOST_GLOBAL_CLANG_FLAGS := $(subst $(1),$(2),$(HOST_GLOBAL_CLANG_FLAGS))
endef
define clang-flags-subst
$(eval $(call do-clang-flags-subst,$(1),$(2)))
endef
# These seem to cause warnings on clang/LLVM.
CLANG_CONFIG_UNKNOWN_CFLAGS := \
-mthumb-interwork \
-fgcse-after-reload \
-frerun-cse-after-loop \
-frename-registers \
-funswitch-loops \
-Wa,--noexecstack \
-mfpu=vfpv3-d16
# Workaround a SIGSEGV in Lol
CLANG_CONFIG_UNKNOWN_CFLAGS += -g
# remove unknown flags to define CLANG_FLAGS
TARGET_GLOBAL_CLANG_FLAGS += $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(TARGET_GLOBAL_CFLAGS))
HOST_GLOBAL_CLANG_FLAGS += $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(HOST_GLOBAL_CFLAGS))
# llvm does not yet support -march=armv5e nor -march=armv5te, fall back to armv5 or armv5t
$(call clang-flags-subst,-march=armv5te,-march=armv5t)
$(call clang-flags-subst,-march=armv5e,-march=armv5)