Convert android.os.cts jni to Android.bp
See build/soong/README.md for more information.
This splits it into two libraries, since Soong doesn't support the
.cpp.arm syntax.
Bug: 122332514
Test: treehugger
Change-Id: If043fd472487778e04231610f3584c0fca45b8e0
diff --git a/tests/tests/os/jni/Android.bp b/tests/tests/os/jni/Android.bp
new file mode 100644
index 0000000..752146f
--- /dev/null
+++ b/tests/tests/os/jni/Android.bp
@@ -0,0 +1,82 @@
+// Copyright (C) 2010 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_defaults {
+ name: "libctsos_jni_defaults",
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-parameter",
+ "-Wno-inline-asm",
+ "-Wno-unused-const-variable",
+ ],
+
+ shared_libs: [
+ "libnativehelper_compat_libc++",
+ "liblog",
+ "libdl",
+ "libandroid",
+ ],
+ stl: "libc++_static",
+}
+
+cc_library_shared {
+ name: "libctsos_jni",
+ defaults: ["libctsos_jni_defaults"],
+
+ srcs: [
+ "CtsOsJniOnLoad.cpp",
+ "android_os_cts_TaggedPointer.cpp",
+ "android_os_cts_HardwareName.cpp",
+ "android_os_cts_OSFeatures.cpp",
+ "android_os_cts_NoExecutePermissionTest.cpp",
+ "android_os_cts_SeccompTest.cpp",
+ "android_os_cts_SharedMemory.cpp",
+ "android_os_cts_SPMITest.cpp",
+ ],
+
+ whole_static_libs: ["libctsos_jni_arm"],
+ static_libs: [
+ "libminijail",
+ "external_seccomp_tests",
+ ],
+
+ // This define controls the behavior of OSFeatures.needsSeccompSupport().
+ // TODO(b/124189460): This was reset before use in Android.mk
+ //cflags: ["-DARCH_SUPPORTS_SECCOMP"],
+}
+
+cc_library_static {
+ name: "libctsos_jni_arm",
+ defaults: ["libctsos_jni_defaults"],
+
+ srcs: ["android_os_cts_CpuInstructions.cpp"],
+
+ arch: {
+ arm: {
+ cppflags: [
+ // Let's overwrite -mcpu in case it's set to some ARMv8 core by
+ // TARGET_2ND_CPU_VARIANT and causes clang to ignore the -march below.
+ "-mcpu=generic",
+
+ // The ARM version of this library must be built using ARMv7 ISA (even if it
+ // can be run on armv8 cores) since one of the tested instruction, swp, is
+ // only supported in ARMv7 (and older) cores, and obsolete in ARMv8.
+ "-march=armv7-a",
+ ],
+ instruction_set: "arm",
+ },
+ },
+}
diff --git a/tests/tests/os/jni/Android.mk b/tests/tests/os/jni/Android.mk
deleted file mode 100644
index 58b9d01..0000000
--- a/tests/tests/os/jni/Android.mk
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright (C) 2010 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)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libctsos_jni
-
-# Don't include this package in any configuration by default.
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
- CtsOsJniOnLoad.cpp \
- android_os_cts_CpuInstructions.cpp.arm \
- android_os_cts_TaggedPointer.cpp \
- android_os_cts_HardwareName.cpp \
- android_os_cts_OSFeatures.cpp \
- android_os_cts_NoExecutePermissionTest.cpp \
- android_os_cts_SeccompTest.cpp \
- android_os_cts_SharedMemory.cpp \
- android_os_cts_SPMITest.cpp
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-LOCAL_SHARED_LIBRARIES := libnativehelper_compat_libc++ liblog libdl libandroid
-LOCAL_CXX_STL := none
-
-LOCAL_STATIC_LIBRARIES := libc++_static libminijail
-
-# Select the architectures on which seccomp-bpf are supported. This is used to
-# include extra test files that will not compile on architectures where it is
-# not supported.
-ARCH_SUPPORTS_SECCOMP := 1
-ifeq ($(strip $(TARGET_ARCH)),mips)
- ARCH_SUPPORTS_SECCOMP = 0
-endif
-ifeq ($(strip $(TARGET_ARCH)),mips64)
- ARCH_SUPPORTS_SECCOMP = 0
-endif
-
-ifeq ($(ARCH_SUPPORTS_SECCOMP),1)
- LOCAL_STATIC_LIBRARIES += external_seccomp_tests
-
- # This define controls the behavior of OSFeatures.needsSeccompSupport().
- LOCAL_CFLAGS += -DARCH_SUPPORTS_SECCOMP
-endif
-
-LOCAL_CFLAGS := -Wall -Werror -Wno-unused-parameter
-LOCAL_CFLAGS += -Wno-inline-asm -Wno-unused-const-variable
-
-# Let's overwrite -mcpu in case it's set to some ARMv8 core by
-# TARGET_2ND_CPU_VARIANT and causes clang to ignore the -march below.
-LOCAL_CPPFLAGS_arm := -mcpu=generic
-
-# The ARM version of this library must be built using ARMv7 ISA (even if it
-# can be run on armv8 cores) since one of the tested instruction, swp, is
-# only supported in ARMv7 (and older) cores, and obsolete in ARMv8.
-LOCAL_CPPFLAGS_arm += -march=armv7-a
-
-include $(BUILD_SHARED_LIBRARY)