diff options
Diffstat (limited to 'core/llvm_config.mk')
-rw-r--r-- | core/llvm_config.mk | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/core/llvm_config.mk b/core/llvm_config.mk index 1238c8f..103221c 100644 --- a/core/llvm_config.mk +++ b/core/llvm_config.mk @@ -1,4 +1,5 @@ CLANG := $(HOST_OUT_EXECUTABLES)/clang$(HOST_EXECUTABLE_SUFFIX) +CLANG_CXX := $(HOST_OUT_EXECUTABLES)/clang++$(HOST_EXECUTABLE_SUFFIX) LLVM_LINK := $(HOST_OUT_EXECUTABLES)/llvm-link$(HOST_EXECUTABLE_SUFFIX) define do-clang-flags-subst @@ -11,18 +12,41 @@ define clang-flags-subst endef -# These seem to cause warnings on clang/LLVM. +CLANG_CONFIG_EXTRA_CFLAGS := \ + -D__compiler_offsetof=__builtin_offsetof \ + -Dnan=__builtin_nan \ + 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 + -funswitch-loops + +ifeq ($(TARGET_ARCH),arm) + CLANG_CONFIG_EXTRA_CFLAGS += \ + -target arm-linux-androideabi \ + -mllvm -arm-enable-ehabi + CLANG_CONFIG_EXTRA_LDFLAGS += \ + -target arm-linux-androideabi \ + -B$(TARGET_TOOLCHAIN_ROOT)/arm-linux-androideabi/bin + CLANG_CONFIG_UNKNOWN_CFLAGS += \ + -mthumb-interwork \ + -fgcse-after-reload \ + -frerun-cse-after-loop \ + -frename-registers \ + -Wa,--noexecstack +endif +ifeq ($(TARGET_ARCH),x86) + CLANG_CONFIG_EXTRA_CFLAGS += \ + -target i686-android-linux + CLANG_CONFIG_EXTRA_LDFLAGS += \ + -target i686-android-linux \ + -B$(TARGET_TOOLCHAIN_ROOT)/i686-android-linux/bin + CLANG_CONFIG_UNKNOWN_CFLAGS += \ + -finline-limit=300 \ + -fno-inline-functions-called-once \ + -mfpmath=sse \ + -mbionic +endif + +CLANG_CONFIG_EXTRA_C_INCLUDES := external/clang/lib/Headers # remove unknown flags to define CLANG_FLAGS TARGET_GLOBAL_CLANG_FLAGS += $(filter-out $(CLANG_CONFIG_UNKNOWN_CFLAGS),$(TARGET_GLOBAL_CFLAGS)) |