Build mainline tests with static libc++ and version script

Bug: 341216801
Test: bpf_existence_test connectivity_native_test
Change-Id: Ib1ad48902472fcf2fbfad3012426f9fd6a5102f6
This commit is contained in:
Ryan Prichard 2024-05-20 15:34:32 -07:00
commit 3ae062d8d6
4 changed files with 37 additions and 1 deletions

View file

@ -201,3 +201,8 @@ java_defaults {
name: "connectivity-mainline-presubmit-java-defaults",
test_mainline_modules: mainline_presubmit_modules,
}
filegroup {
name: "connectivity_mainline_test_map",
srcs: ["connectivity_mainline_test.map"],
}

View file

@ -0,0 +1,27 @@
#
# 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.
#
# Some connectivity tests run on older OS versions, and for those tests, many
# library dependencies (such as libbase and libc++) need to be linked
# statically. The tests also need 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 OS itself uses. See
# b/333438055 for an example of what goes wrong when libc++ is partially
# exported from an executable.
{
local:
*;
};

View file

@ -31,6 +31,8 @@ cc_test {
header_libs: [
"bpf_headers",
],
version_script: ":connectivity_mainline_test_map",
stl: "libc++_static",
static_libs: [
"libbase",
"libmodules-utils-build",

View file

@ -17,8 +17,9 @@ cc_test {
"connectivity_native_test.cpp",
],
header_libs: ["bpf_connectivity_headers"],
version_script: ":connectivity_mainline_test_map",
stl: "libc++_static",
shared_libs: [
"libbase",
"libbinder_ndk",
"liblog",
"libnetutils",
@ -26,6 +27,7 @@ cc_test {
],
static_libs: [
"connectivity_native_aidl_interface-lateststable-ndk",
"libbase",
"libcutils",
"libmodules-utils-build",
"libutils",