Build CtsNativeNetDnsTestCases with static libc++ and version script

Bug: http://b/344654921
Test: m CtsNativeNetDnsTestCases
Change-Id: I3d5d25d1f51ab45a5d96639a1b70f5d6e58f6239
This commit is contained in:
Stephen Hines 2024-06-07 14:38:14 -07:00
commit 82bf7bbe8b
2 changed files with 33 additions and 0 deletions

View file

@ -3,6 +3,11 @@ package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
filegroup {
name: "dns_async_test_default_map",
srcs: ["dns_async_test_default.map"],
}
cc_defaults {
name: "dns_async_defaults",
@ -20,6 +25,14 @@ cc_defaults {
srcs: [
"NativeDnsAsyncTest.cpp",
],
// This test runs on older platform versions, so many libraries (such as libbase and libc++)
// need to be linked statically. The test also needs to be linked with a version script to
// ensure that the statically-linked library isn't exported from the executable, where it
// would override the shared libraries that the platform itself uses.
// See http://b/333438055 for an example of what goes wrong when libc++ is partially exported
// from an executable.
version_script: ":dns_async_test_default_map",
stl: "libc++_static",
shared_libs: [
"libandroid",
"liblog",

View file

@ -0,0 +1,20 @@
#
# Copyright (C) 2024 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:
*;
};