Commit d632e6d5 by Ben Clayton

Android: Always use LLVM 7, delete build files for LLVM 3

C++ 11 is in heavy use by SwiftShader now, so SwiftShader is now unsupported for Android versions earlier than M. Bug: b/130460252 Bug: b/130343040 Bug: b/130361288 Change-Id: Idfb64c3fa82325641cc2170f494260c1b5b1eeb4 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28988Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: Lingfeng Yang <lfy@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 25e96489
......@@ -106,6 +106,6 @@ cc_library_headers {
subdirs = [
"src",
"third_party/llvm-subzero",
"third_party/LLVM",
"third_party/llvm-7.0",
"third_party/subzero",
]
......@@ -17,47 +17,25 @@
LOCAL_PATH := $(call my-dir)
swiftshader_root := $(LOCAL_PATH)
# Default LLVM version for SwiftShader's JIT compiler (Reactor).
REACTOR_LLVM_VERSION ?= 7
# LLVM version for SwiftShader's JIT compiler (Reactor).
REACTOR_LLVM_VERSION := 7
# Subzero is an alternative JIT compiler. It is smaller and generally slower.
REACTOR_USE_SUBZERO := false
ifeq ($(REACTOR_LLVM_VERSION),3)
# Reactor with LLVM 3.0 doesn't support ARM. Use Subzero as the Reactor JIT
# back-end on ARM.
ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm))
REACTOR_USE_SUBZERO := true
endif
endif
# Subzero and LLVM 7.0 require C++11.
# SwiftShader requires C++11.
# Full C++11 support is only available from Marshmallow and up.
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow)
# Fall back to LLVM 3.0.
REACTOR_USE_SUBZERO := false
REACTOR_LLVM_VERSION := 3
endif
# Check whether $(TARGET_ARCH) is supported.
ifeq ($(REACTOR_LLVM_VERSION),3)
ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm))
swiftshader_unsupported_build := true
endif
endif
ifeq ($(REACTOR_LLVM_VERSION),7)
# Check whether $(TARGET_ARCH) is supported.
ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 arm arm64))
swiftshader_unsupported_build := true
endif
endif
ifneq ($(swiftshader_unsupported_build),true)
include $(swiftshader_root)/src/Android.mk
include $(swiftshader_root)/tests/GLESUnitTests/Android.mk
ifeq ($(REACTOR_LLVM_VERSION),3)
include $(swiftshader_root)/third_party/LLVM/Android.mk
else
include $(swiftshader_root)/third_party/llvm-7.0/Android.mk
endif
endif
......@@ -181,8 +181,14 @@ cc_defaults {
"Reactor/LLVMRoutineManager.cpp",
],
cflags: [
"-DREACTOR_LLVM_VERSION=7",
"-Wno-unused-parameter",
"-Wno-implicit-fallthrough",
],
static_libs: [
"libLLVM_swiftshader",
"libLLVM7_swiftshader",
],
}
......@@ -371,14 +377,14 @@ cc_defaults {
android: {
static_libs: [
"libswiftshader_llvm",
"libLLVM_swiftshader",
"libLLVM7_swiftshader",
],
},
host: {
static_libs: [
"libswiftshader_llvm",
"libLLVM_swiftshader",
"libLLVM7_swiftshader",
],
},
},
......@@ -401,14 +407,14 @@ cc_defaults {
android: {
static_libs: [
"libswiftshader_llvm_debug",
"libLLVM_swiftshader",
"libLLVM7_swiftshader",
],
},
host: {
static_libs: [
"libswiftshader_llvm_debug",
"libLLVM_swiftshader",
"libLLVM7_swiftshader",
],
},
},
......
......@@ -17,15 +17,10 @@ COMMON_C_INCLUDES += \
else
ifeq ($(REACTOR_LLVM_VERSION),3)
COMMON_C_INCLUDES += \
$(LOCAL_PATH)/../third_party/LLVM/include
else
COMMON_C_INCLUDES += \
$(LOCAL_PATH)/../third_party/llvm-7.0/llvm/include \
$(LOCAL_PATH)/../third_party/llvm-7.0/configs/android/include \
$(LOCAL_PATH)/../third_party/llvm-7.0/configs/common/include
endif
endif
......
......@@ -61,7 +61,7 @@ COMMON_C_INCLUDES := \
ifeq ($(REACTOR_USE_SUBZERO),true)
COMMON_STATIC_LIBRARIES := libsubzero
else
COMMON_STATIC_LIBRARIES := libLLVM_swiftshader
COMMON_STATIC_LIBRARIES := libLLVM7_swiftshader
endif
COMMON_SHARED_LIBRARIES := \
......
......@@ -70,7 +70,7 @@ COMMON_C_INCLUDES := \
ifeq ($(REACTOR_USE_SUBZERO),true)
COMMON_STATIC_LIBRARIES := libsubzero
else
COMMON_STATIC_LIBRARIES := libLLVM_swiftshader
COMMON_STATIC_LIBRARIES := libLLVM7_swiftshader
endif
COMMON_SHARED_LIBRARIES := \
......
......@@ -3,6 +3,7 @@
cc_library_static {
name: "libLLVM7_swiftshader",
device_supported: true,
host_supported: true,
vendor: true,
srcs: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment