1// Copyright (C) 2024 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package { 16 default_applicable_licenses: ["Android-Apache-2.0"], 17} 18 19android_test_helper_app { 20 name: "CtsHostsideTaggingMemtagApp", 21 defaults: ["cts_tagging_app_defaults"], 22 srcs: ["src/**/*.java"], 23 test_suites: [ 24 "general-tests", 25 ], 26 static_libs: [ 27 "androidx.test.ext.truth", 28 "hamcrest-library", 29 ], 30 sdk_version: "test_current", 31 jni_libs: [ 32 "libcts_memtagapp_jni", 33 "libcts_jni", 34 ], 35} 36 37cc_library { 38 name: "libcts_memtagapp_jni", 39 srcs: ["jni/libcts_memtagapp_jni.cpp"], 40 header_libs: ["jni_headers"], 41 sdk_version: "current", 42 stl: "libc++", 43 target: { 44 // We can't use `sanitize:` here, because Soong does not allow 45 // sanitize for sdk_version. 46 // TODO(b/377739631): once Soong support this, reconsider this 47 // decision. Using cflags and ldflags is closer to what people 48 // using the NDK would actually use, so maybe we should still 49 // keep it like this. 50 android_arm64: { 51 cflags: [ 52 "-fsanitize=memtag", 53 "-Xclang -target-feature", 54 "-Xclang +mte", 55 ], 56 ldflags: ["-fsanitize=memtag"], 57 }, 58 }, 59} 60