From 1e9375d6ac7ce886314d2faf149962c95c05c56d Mon Sep 17 00:00:00 2001 From: Ray Essick Date: Tue, 11 Feb 2020 10:33:38 -0800 Subject: [PATCH] build code_coverage.policy with Android.bp use Android.bp instead of Android.mk; This also allows build to include the files within an apex Bug: 147914640 Test: build, check filesystem Change-Id: I574d9ce984e09af95c7673494c8c714169f69b08 --- code_coverage/Android.bp | 83 ++++++++++++++++++++++++++++++++++++++++ code_coverage/Android.mk | 37 ------------------ 2 files changed, 83 insertions(+), 37 deletions(-) create mode 100644 code_coverage/Android.bp delete mode 100644 code_coverage/Android.mk diff --git a/code_coverage/Android.bp b/code_coverage/Android.bp new file mode 100644 index 000000000..b51c80288 --- /dev/null +++ b/code_coverage/Android.bp @@ -0,0 +1,83 @@ + +prebuilt_etc { + name: "code_coverage.policy", + sub_dir: "seccomp_policy", + filename_from_src: true, + arch: { + arm: { + src: "empty_policy/code_coverage.arm.policy", + product_variables: { + native_coverage: { + src: "seccomp_policy/code_coverage.arm.policy", + }, + }, + }, + arm64: { + src: "empty_policy/code_coverage.arm64.policy", + product_variables: { + native_coverage: { + src: "seccomp_policy/code_coverage.arm64.policy", + }, + }, + }, + x86: { + src: "empty_policy/code_coverage.x86.policy", + product_variables: { + native_coverage: { + src: "seccomp_policy/code_coverage.x86.policy", + }, + }, + }, + x86_64: { + src: "empty_policy/code_coverage.x86_64.policy", + product_variables: { + native_coverage: { + src: "seccomp_policy/code_coverage.x86_64.policy", + }, + }, + }, + }, + required: [ + "code_coverage.policy.other", + ], +} + +prebuilt_etc { + name: "code_coverage.policy.other", + sub_dir: "seccomp_policy", + filename_from_src: true, + arch: { + arm: { + src: "empty_policy/code_coverage.arm64.policy", + product_variables: { + native_coverage: { + src: "seccomp_policy/code_coverage.arm64.policy", + }, + }, + }, + arm64: { + src: "empty_policy/code_coverage.arm.policy", + product_variables: { + native_coverage: { + src: "seccomp_policy/code_coverage.arm.policy", + }, + }, + }, + x86: { + src: "empty_policy/code_coverage.x86_64.policy", + product_variables: { + native_coverage: { + src: "seccomp_policy/code_coverage.x86_64.policy", + }, + }, + }, + x86_64: { + src: "empty_policy/code_coverage.x86.policy", + product_variables: { + native_coverage: { + src: "seccomp_policy/code_coverage.x86.policy", + }, + }, + }, + }, +} diff --git a/code_coverage/Android.mk b/code_coverage/Android.mk deleted file mode 100644 index 80ab36be6..000000000 --- a/code_coverage/Android.mk +++ /dev/null @@ -1,37 +0,0 @@ -# policies to allow processes inside minijail to dump code coverage information -# - -LOCAL_PATH := $(call my-dir) - - -include $(CLEAR_VARS) -LOCAL_MODULE := code_coverage.policy -LOCAL_MODULE_CLASS := ETC -LOCAL_MULTILIB := both - -ifeq ($(TARGET_ARCH), $(filter $(TARGET_ARCH), arm arm64)) -LOCAL_MODULE_STEM_32 := code_coverage.arm.policy -LOCAL_MODULE_STEM_64 := code_coverage.arm64.policy -endif - -ifeq ($(TARGET_ARCH), $(filter $(TARGET_ARCH), x86 x86_64)) -LOCAL_MODULE_STEM_32 := code_coverage.x86.policy -LOCAL_MODULE_STEM_64 := code_coverage.x86_64.policy -endif - -# different files for different configurations -ifeq ($(NATIVE_COVERAGE),true) -LOCAL_SRC_FILES_arm := seccomp_policy/code_coverage.arm.policy -LOCAL_SRC_FILES_arm64 := seccomp_policy/code_coverage.arm64.policy -LOCAL_SRC_FILES_x86 := seccomp_policy/code_coverage.x86.policy -LOCAL_SRC_FILES_x86_64 := seccomp_policy/code_coverage.x86_64.policy -else -LOCAL_SRC_FILES_arm := empty_policy/code_coverage.arm.policy -LOCAL_SRC_FILES_arm64 := empty_policy/code_coverage.arm64.policy -LOCAL_SRC_FILES_x86 := empty_policy/code_coverage.x86.policy -LOCAL_SRC_FILES_x86_64 := empty_policy/code_coverage.x86_64.policy -endif - -LOCAL_MODULE_TARGET_ARCH := arm arm64 x86 x86_64 -LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/seccomp_policy -include $(BUILD_PREBUILT)