diff options
author | Colin Cross <ccross@android.com> | 2016-12-13 18:49:21 +0000 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2016-12-13 18:49:21 +0000 |
commit | 7e4c6d72d977de3e3635bc7280f52ab737c1ad34 (patch) | |
tree | 4cccc7ea7933959f968b096f05978291259a1f5d /bcinfo | |
parent | 5a2d24e315d79f735eeb8b6560118f10edbd6b05 (diff) | |
download | libbcc-7e4c6d72d977de3e3635bc7280f52ab737c1ad34.tar.gz |
Revert "Convert libbcc to Android.bp"
This reverts commit 5a2d24e315d79f735eeb8b6560118f10edbd6b05.
Reason for revert: breaks mac build
Change-Id: I6429aaddea2c2cc1e71c5ab66d656392a112bd8f
Diffstat (limited to 'bcinfo')
-rw-r--r-- | bcinfo/Android.bp | 114 | ||||
-rw-r--r-- | bcinfo/Android.mk | 126 | ||||
-rw-r--r-- | bcinfo/BitReader_2_7/Android.bp | 19 | ||||
-rw-r--r-- | bcinfo/BitReader_2_7/Android.mk | 39 | ||||
-rw-r--r-- | bcinfo/BitReader_3_0/Android.bp | 18 | ||||
-rw-r--r-- | bcinfo/BitReader_3_0/Android.mk | 37 | ||||
-rw-r--r-- | bcinfo/Wrap/Android.bp | 39 | ||||
-rw-r--r-- | bcinfo/Wrap/Android.mk | 59 | ||||
-rw-r--r-- | bcinfo/tools/Android.bp | 45 | ||||
-rw-r--r-- | bcinfo/tools/Android.mk | 51 |
10 files changed, 312 insertions, 235 deletions
diff --git a/bcinfo/Android.bp b/bcinfo/Android.bp deleted file mode 100644 index fc4aaf7..0000000 --- a/bcinfo/Android.bp +++ /dev/null @@ -1,114 +0,0 @@ -// -// Copyright (C) 2011-2012 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -cc_library_shared { - name: "libbcinfo", - host_supported: true, - defaults: [ - "llvm-defaults", - "llvm-generated-headers", - "rs-version", - ], - - srcs: [ - "BitcodeTranslator.cpp", - "BitcodeWrapper.cpp", - "MetadataExtractor.cpp", - ], - - cflags: [ - "-Wall", - "-Wno-unused-parameter", - "-Werror", - - "-D__DISABLE_ASSERTS", - ], - - product_variables: { - eng: { - cflags: ["-U__DISABLE_ASSERTS"], - }, - }, - - include_dirs: [ - "frameworks/compile/libbcc/include", - "frameworks/rs", - "frameworks/compile/slang", - ], - - static_libs: [ - "libLLVMWrap", - "libLLVMBitReader_2_7", - "libLLVMBitReader_3_0", - "libLLVMBitWriter_3_2", - ], - - // Export only the symbols in the bcinfo namespace. In particular, do not - // export symbols from the LLVM libraries. - version_script: "libbcinfo.map", - - target: { - windows: { - enabled: true, - shared_libs: ["libLLVM"], - }, - darwin: { - host_ldlibs: [ - "-ldl", - "-lpthread", - ], - shared_libs: ["libLLVM"], - }, - linux: { - host_ldlibs: [ - "-ldl", - "-lpthread", - ], - allow_undefined_symbols: true, - }, - host: { - static_libs: [ - "libcutils", - "liblog", - ], - product_variables: { - unbundled_build: { - // don't build for unbundled branches - enabled: false, - }, - }, - }, - android: { - shared_libs: [ - "libcutils", - "liblog", - ], - static_libs: [ - // Statically link-in the required LLVM libraries - "libLLVMBitReader", - "libLLVMCore", - "libLLVMSupport", - ], - }, - }, -} - -subdirs = [ - "BitReader_2_7", - "BitReader_3_0", - "tools", - "Wrap", -] diff --git a/bcinfo/Android.mk b/bcinfo/Android.mk new file mode 100644 index 0000000..955d94e --- /dev/null +++ b/bcinfo/Android.mk @@ -0,0 +1,126 @@ +# +# Copyright (C) 2011-2012 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +local_cflags_for_libbcinfo := -Wall -Wno-unused-parameter -Werror +ifneq ($(TARGET_BUILD_VARIANT),eng) +local_cflags_for_libbcinfo += -D__DISABLE_ASSERTS +endif + +LOCAL_PATH := $(call my-dir) + +include frameworks/compile/slang/rs_version.mk +local_cflags_for_libbcinfo += $(RS_VERSION_DEFINE) + +libbcinfo_SRC_FILES := \ + BitcodeTranslator.cpp \ + BitcodeWrapper.cpp \ + MetadataExtractor.cpp + +libbcinfo_C_INCLUDES := \ + $(LOCAL_PATH)/../include \ + $(RS_ROOT_PATH) \ + $(LOCAL_PATH)/../../slang + +libbcinfo_STATIC_LIBRARIES := \ + libLLVMWrap \ + libLLVMBitReader_2_7 \ + libLLVMBitReader_3_0 \ + libLLVMBitWriter_3_2 + +libbcinfo_LLVM_STATIC_LIBRARIES := \ + libLLVMBitReader \ + libLLVMCore \ + libLLVMSupport + +LLVM_ROOT_PATH := external/llvm + +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS)) +#===================================================================== +# Shared library for the target +#===================================================================== +include $(CLEAR_VARS) + +LOCAL_MODULE := libbcinfo +LOCAL_MODULE_CLASS := SHARED_LIBRARIES +LOCAL_MODULE_TAGS := optional + +LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES) + +LOCAL_CFLAGS += $(local_cflags_for_libbcinfo) + +LOCAL_C_INCLUDES := $(libbcinfo_C_INCLUDES) + +LOCAL_STATIC_LIBRARIES := $(libbcinfo_STATIC_LIBRARIES) + +# Statically link-in the required LLVM libraries +LOCAL_STATIC_LIBRARIES += $(libbcinfo_LLVM_STATIC_LIBRARIES) + +LOCAL_SHARED_LIBRARIES := libcutils liblog + +# Export only the symbols in the bcinfo namespace. In particular, do not +# export symbols from the LLVM libraries. +LOCAL_LDFLAGS += -Wl,--version-script,${LOCAL_PATH}/libbcinfo.map + +include $(LLVM_ROOT_PATH)/llvm-device-build.mk +include $(LLVM_GEN_ATTRIBUTES_MK) +include $(BUILD_SHARED_LIBRARY) +endif + +# Don't build for unbundled branches +ifeq (,$(TARGET_BUILD_APPS)) + +#===================================================================== +# Shared library for the host +#===================================================================== +include $(CLEAR_VARS) + +LOCAL_MODULE := libbcinfo +LOCAL_MODULE_CLASS := SHARED_LIBRARIES +LOCAL_MODULE_HOST_OS := darwin linux windows +LOCAL_IS_HOST_MODULE := true + +LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES) + +LOCAL_CFLAGS += $(local_cflags_for_libbcinfo) + +LOCAL_C_INCLUDES := $(libbcinfo_C_INCLUDES) + +LOCAL_STATIC_LIBRARIES += $(libbcinfo_STATIC_LIBRARIES) +LOCAL_STATIC_LIBRARIES += libcutils liblog + +LOCAL_LDLIBS_darwin := -ldl -lpthread +LOCAL_LDLIBS_linux := -ldl -lpthread + +include $(LOCAL_PATH)/../llvm-loadable-libbcc.mk + +ifneq ($(CAN_BUILD_HOST_LLVM_LOADABLE_MODULE),true) +LOCAL_SHARED_LIBRARIES_linux += libLLVM +else +LOCAL_ALLOW_UNDEFINED_SYMBOLS := true +endif +LOCAL_SHARED_LIBRARIES_darwin += libLLVM +LOCAL_SHARED_LIBRARIES_windows += libLLVM + +include $(LLVM_ROOT_PATH)/llvm-host-build.mk +include $(LLVM_GEN_ATTRIBUTES_MK) +include $(BUILD_HOST_SHARED_LIBRARY) + +endif # don't build for unbundled branches + +#===================================================================== +# Include Subdirectories +#===================================================================== +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/bcinfo/BitReader_2_7/Android.bp b/bcinfo/BitReader_2_7/Android.bp deleted file mode 100644 index 7051c4a..0000000 --- a/bcinfo/BitReader_2_7/Android.bp +++ /dev/null @@ -1,19 +0,0 @@ -cc_library_static { - name: "libLLVMBitReader_2_7", - defaults: [ - "llvm-defaults", - "llvm-generated-headers", - ], - host_supported: true, - - srcs: ["BitcodeReader.cpp"], - - target: { - host: { - cflags: ["-D__HOST__"], - }, - windows: { - enabled: true, - }, - }, -} diff --git a/bcinfo/BitReader_2_7/Android.mk b/bcinfo/BitReader_2_7/Android.mk new file mode 100644 index 0000000..773c3c9 --- /dev/null +++ b/bcinfo/BitReader_2_7/Android.mk @@ -0,0 +1,39 @@ +LOCAL_PATH:= $(call my-dir) + +LLVM_ROOT_PATH := external/llvm +include $(LLVM_ROOT_PATH)/llvm.mk + +bitcode_reader_2_7_SRC_FILES := \ + BitcodeReader.cpp + +# For the host +# ===================================================== +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(bitcode_reader_2_7_SRC_FILES) + +LOCAL_CFLAGS += -D__HOST__ + +LOCAL_MODULE:= libLLVMBitReader_2_7 + +LOCAL_MODULE_HOST_OS := darwin linux windows + +include $(LLVM_HOST_BUILD_MK) +include $(LLVM_GEN_ATTRIBUTES_MK) +include $(LLVM_GEN_INTRINSICS_MK) +include $(BUILD_HOST_STATIC_LIBRARY) + +# For the device +# ===================================================== +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS)) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(bitcode_reader_2_7_SRC_FILES) + +LOCAL_MODULE:= libLLVMBitReader_2_7 + +include $(LLVM_DEVICE_BUILD_MK) +include $(LLVM_GEN_ATTRIBUTES_MK) +include $(LLVM_GEN_INTRINSICS_MK) +include $(BUILD_STATIC_LIBRARY) +endif diff --git a/bcinfo/BitReader_3_0/Android.bp b/bcinfo/BitReader_3_0/Android.bp deleted file mode 100644 index c98e26b..0000000 --- a/bcinfo/BitReader_3_0/Android.bp +++ /dev/null @@ -1,18 +0,0 @@ -cc_library_static { - name: "libLLVMBitReader_3_0", - defaults: [ - "llvm-defaults", - "llvm-generated-headers", - ], - host_supported: true, - - srcs: ["BitcodeReader.cpp"], - target: { - host: { - cflags: ["-D__HOST__"], - }, - windows: { - enabled: true, - }, - }, -} diff --git a/bcinfo/BitReader_3_0/Android.mk b/bcinfo/BitReader_3_0/Android.mk new file mode 100644 index 0000000..dd6ce8d --- /dev/null +++ b/bcinfo/BitReader_3_0/Android.mk @@ -0,0 +1,37 @@ +LOCAL_PATH:= $(call my-dir) + +LLVM_ROOT_PATH := external/llvm +include $(LLVM_ROOT_PATH)/llvm.mk + +bitcode_reader_3_0_SRC_FILES := \ + BitcodeReader.cpp + +# For the host +# ===================================================== +include $(CLEAR_VARS) + +LOCAL_MODULE:= libLLVMBitReader_3_0 +LOCAL_MODULE_HOST_OS := darwin linux windows + +LOCAL_SRC_FILES := $(bitcode_reader_3_0_SRC_FILES) +LOCAL_CFLAGS += -D__HOST__ + +include $(LLVM_HOST_BUILD_MK) +include $(LLVM_GEN_ATTRIBUTES_MK) +include $(LLVM_GEN_INTRINSICS_MK) +include $(BUILD_HOST_STATIC_LIBRARY) + +# For the device +# ===================================================== +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS)) +include $(CLEAR_VARS) + +LOCAL_MODULE:= libLLVMBitReader_3_0 + +LOCAL_SRC_FILES := $(bitcode_reader_3_0_SRC_FILES) + +include $(LLVM_DEVICE_BUILD_MK) +include $(LLVM_GEN_ATTRIBUTES_MK) +include $(LLVM_GEN_INTRINSICS_MK) +include $(BUILD_STATIC_LIBRARY) +endif diff --git a/bcinfo/Wrap/Android.bp b/bcinfo/Wrap/Android.bp deleted file mode 100644 index fc35623..0000000 --- a/bcinfo/Wrap/Android.bp +++ /dev/null @@ -1,39 +0,0 @@ -// -// Copyright (C) 2012 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -cc_library_static { - name: "libLLVMWrap", - host_supported: true, - - srcs: [ - "bitcode_wrapperer.cpp", - "file_wrapper_input.cpp", - "file_wrapper_output.cpp", - "in_memory_wrapper_input.cpp", - "wrapper_output.cpp", - ], - - target: { - host: { - cflags: ["-D__HOST__"], - }, - windows: { - enabled: true, - }, - }, - - include_dirs: ["frameworks/compile/libbcc/include"], -} diff --git a/bcinfo/Wrap/Android.mk b/bcinfo/Wrap/Android.mk new file mode 100644 index 0000000..92508d8 --- /dev/null +++ b/bcinfo/Wrap/Android.mk @@ -0,0 +1,59 @@ +# +# Copyright (C) 2012 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +LOCAL_PATH:= $(call my-dir) + +LLVM_ROOT_PATH := external/llvm +include $(LLVM_ROOT_PATH)/llvm.mk + +llvm_wrap_SRC_FILES := \ + bitcode_wrapperer.cpp \ + file_wrapper_input.cpp \ + file_wrapper_output.cpp \ + in_memory_wrapper_input.cpp \ + wrapper_output.cpp + +llvm_wrap_C_INCLUDES := $(LOCAL_PATH)/../../include + +# For the host +# ===================================================== +include $(CLEAR_VARS) + +LOCAL_MODULE:= libLLVMWrap +LOCAL_MODULE_HOST_OS := darwin linux windows + +LOCAL_SRC_FILES := $(llvm_wrap_SRC_FILES) +LOCAL_CFLAGS += -D__HOST__ +LOCAL_C_INCLUDES := $(llvm_wrap_C_INCLUDES) + +include $(LLVM_HOST_BUILD_MK) +include $(LLVM_GEN_INTRINSICS_MK) +include $(BUILD_HOST_STATIC_LIBRARY) + +# For the device +# ===================================================== +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS)) +include $(CLEAR_VARS) + +LOCAL_MODULE:= libLLVMWrap + +LOCAL_SRC_FILES := $(llvm_wrap_SRC_FILES) +LOCAL_C_INCLUDES := $(llvm_wrap_C_INCLUDES) + +include $(LLVM_DEVICE_BUILD_MK) +include $(LLVM_GEN_INTRINSICS_MK) +include $(BUILD_STATIC_LIBRARY) +endif diff --git a/bcinfo/tools/Android.bp b/bcinfo/tools/Android.bp deleted file mode 100644 index d95af9c..0000000 --- a/bcinfo/tools/Android.bp +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (C) 2011 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -// Executable for host -// ======================================================== -cc_binary_host { - name: "bcinfo", - defaults: [ - "llvm-defaults", - "llvm-generated-headers", - ], - - srcs: ["main.cpp"], - - shared_libs: ["libbcinfo"], - - static_libs: [ - "libLLVMBitReader", - "libLLVMBitWriter", - "libLLVMCore", - "libLLVMSupport", - ], - - cflags: ["-D__HOST__"], - - include_dirs: ["frameworks/compile/libbcc/include"], - - host_ldlibs: [ - "-ldl", - "-lpthread", - ], -} diff --git a/bcinfo/tools/Android.mk b/bcinfo/tools/Android.mk new file mode 100644 index 0000000..876a53c --- /dev/null +++ b/bcinfo/tools/Android.mk @@ -0,0 +1,51 @@ +# +# Copyright (C) 2011 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +LOCAL_PATH := $(call my-dir) + +LLVM_ROOT_PATH := external/llvm +include $(LLVM_ROOT_PATH)/llvm.mk + +# Executable for host +# ======================================================== +include $(CLEAR_VARS) + +LOCAL_MODULE := bcinfo +LOCAL_MODULE_CLASS := EXECUTABLES + +LOCAL_SRC_FILES := \ + main.cpp + +LOCAL_SHARED_LIBRARIES := \ + libbcinfo + +LOCAL_STATIC_LIBRARIES := \ + libLLVMBitReader \ + libLLVMBitWriter \ + libLLVMCore \ + libLLVMSupport + +LOCAL_CFLAGS += -D__HOST__ + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/../../include + +LOCAL_LDLIBS = -ldl -lpthread + +include $(LLVM_HOST_BUILD_MK) +include $(LLVM_GEN_ATTRIBUTES_MK) +include $(BUILD_HOST_EXECUTABLE) + |