Revert "Convert Android.mk under bionic to Android.bp"
This reverts commit 12b2042a3f11af0ffc13d18f465fb12c96f73383.
Reason for revert: Droidmonitor triggered revert due to build breakage in b/342029467. Will be verifying through ABTD before submission.
Change-Id: I801b4999047732b86985f0be2f4aae90b9998e4a
diff --git a/tests/Android.bp b/tests/Android.bp
index 9aca488..528ccb8 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -1136,14 +1136,11 @@
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"],
@@ -1318,47 +1315,4 @@
},
}
-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",
- ],
-}
+subdirs = ["*"]
diff --git a/tests/Android.mk b/tests/Android.mk
new file mode 100644
index 0000000..5ad4045
--- /dev/null
+++ b/tests/Android.mk
@@ -0,0 +1,33 @@
+#
+# 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
new file mode 100644
index 0000000..ec0ba45
--- /dev/null
+++ b/tests/make_fortify_compile_test.mk
@@ -0,0 +1,24 @@
+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 :=