Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1319005a authored by yroussel's avatar yroussel Committed by Evgeniy Stepanov
Browse files

Define a basic llvm-link + clang environment

Move it from dalvik/vm/translator/runtime/ to build/
Add handling of -march=armv5te and -march=armv5e
parent 70132982
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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)

# ###############################################################

core/llvm_config.mk

0 → 100644
+33 −0
Original line number Diff line number Diff line
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)