Revert^2 "Convert Android.mk under bionic to Android.bp"
This reverts commit 1e32ad88ffb67cd6a4bea5b5a5edfc7f45ec68e6.
Reason for revert: 1. aosp/3099017 merged. 2. verified in ABDT run
https://android-build.corp.google.com/abtd/run/L00400030004085752/
Change-Id: I6f07c67ab84ea93406dee88a5d20d0674a2d2a79
diff --git a/tests/Android.bp b/tests/Android.bp
index 528ccb8..9aca488 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -1136,11 +1136,14 @@
shared_libs: [
"libbase",
],
- data_libs: ["libtest_simple_memtag_stack", "libtest_depends_on_simple_memtag_stack"],
+ data_libs: [
+ "libtest_simple_memtag_stack",
+ "libtest_depends_on_simple_memtag_stack",
+ ],
data_bins: [
"testbinary_depends_on_simple_memtag_stack",
"testbinary_depends_on_depends_on_simple_memtag_stack",
- "testbinary_is_stack_mte_after_dlopen"
+ "testbinary_is_stack_mte_after_dlopen",
],
header_libs: ["bionic_libc_platform_headers"],
test_suites: ["device-tests"],
@@ -1315,4 +1318,47 @@
},
}
-subdirs = ["*"]
+cc_defaults {
+ name: "bionic_compile_time_tests_defaults",
+ enabled: false,
+ target: {
+ linux_x86: {
+ enabled: true,
+ },
+ linux_x86_64: {
+ enabled: true,
+ },
+ },
+ tidy: false,
+ clang_verify: true,
+ cflags: [
+ "-Wall",
+ "-Wno-error",
+ "-fno-color-diagnostics",
+ "-ferror-limit=10000",
+ "-DCOMPILATION_TESTS=1",
+ "-Wformat-nonliteral",
+ "-U_FORTIFY_SOURCE",
+ ],
+ srcs: ["clang_fortify_tests.cpp"],
+}
+
+cc_library_static {
+ name: "bionic-compile-time-tests1-clang++",
+ defaults: [
+ "bionic_compile_time_tests_defaults",
+ ],
+ cppflags: [
+ "-D_FORTIFY_SOURCE=1",
+ ],
+}
+
+cc_library_static {
+ name: "bionic-compile-time-tests2-clang++",
+ defaults: [
+ "bionic_compile_time_tests_defaults",
+ ],
+ cppflags: [
+ "-D_FORTIFY_SOURCE=2",
+ ],
+}
diff --git a/tests/Android.mk b/tests/Android.mk
deleted file mode 100644
index 5ad4045..0000000
--- a/tests/Android.mk
+++ /dev/null
@@ -1,33 +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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-ifeq ($(HOST_OS)-$(HOST_ARCH),$(filter $(HOST_OS)-$(HOST_ARCH),linux-x86 linux-x86_64))
-
-# -----------------------------------------------------------------------------
-# Compile time tests.
-# -----------------------------------------------------------------------------
-
-FORTIFY_LEVEL := 1
-include $(LOCAL_PATH)/make_fortify_compile_test.mk
-
-FORTIFY_LEVEL := 2
-include $(LOCAL_PATH)/make_fortify_compile_test.mk
-
-endif # linux-x86
-
-include $(call first-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/make_fortify_compile_test.mk b/tests/make_fortify_compile_test.mk
deleted file mode 100644
index ec0ba45..0000000
--- a/tests/make_fortify_compile_test.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-include $(CLEAR_VARS)
-
-LOCAL_ADDITIONAL_DEPENDENCIES := \
- $(LOCAL_PATH)/Android.mk \
- $(LOCAL_PATH)/touch-obj-on-success
-
-LOCAL_CXX := $(LOCAL_PATH)/touch-obj-on-success \
- $(LLVM_PREBUILTS_PATH)/clang++ \
-
-LOCAL_CLANG := true
-LOCAL_MODULE := bionic-compile-time-tests$(FORTIFY_LEVEL)-clang++
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
-LOCAL_TIDY := false
-LOCAL_CPPFLAGS := -Wall -Wno-error
-LOCAL_CPPFLAGS += -fno-color-diagnostics -ferror-limit=10000 -Xclang -verify
-LOCAL_CPPFLAGS += -DCOMPILATION_TESTS=1 -Wformat-nonliteral
-LOCAL_CPPFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=$(FORTIFY_LEVEL)
-LOCAL_SRC_FILES := clang_fortify_tests.cpp
-
-include $(BUILD_STATIC_LIBRARY)
-
-FORTIFY_LEVEL :=