xref: /aosp_15_r20/bionic/benchmarks/linker_relocation/Android.bp (revision 8d67ca893c1523eb926b9080dbe4e2ffd2a27ba1)
1*8d67ca89SAndroid Build Coastguard Worker// Copyright (C) 2019 The Android Open Source Project
2*8d67ca89SAndroid Build Coastguard Worker// All rights reserved.
3*8d67ca89SAndroid Build Coastguard Worker//
4*8d67ca89SAndroid Build Coastguard Worker// Redistribution and use in source and binary forms, with or without
5*8d67ca89SAndroid Build Coastguard Worker// modification, are permitted provided that the following conditions
6*8d67ca89SAndroid Build Coastguard Worker// are met:
7*8d67ca89SAndroid Build Coastguard Worker//  * Redistributions of source code must retain the above copyright
8*8d67ca89SAndroid Build Coastguard Worker//    notice, this list of conditions and the following disclaimer.
9*8d67ca89SAndroid Build Coastguard Worker//  * Redistributions in binary form must reproduce the above copyright
10*8d67ca89SAndroid Build Coastguard Worker//    notice, this list of conditions and the following disclaimer in
11*8d67ca89SAndroid Build Coastguard Worker//    the documentation and/or other materials provided with the
12*8d67ca89SAndroid Build Coastguard Worker//    distribution.
13*8d67ca89SAndroid Build Coastguard Worker//
14*8d67ca89SAndroid Build Coastguard Worker// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15*8d67ca89SAndroid Build Coastguard Worker// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16*8d67ca89SAndroid Build Coastguard Worker// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
17*8d67ca89SAndroid Build Coastguard Worker// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
18*8d67ca89SAndroid Build Coastguard Worker// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
19*8d67ca89SAndroid Build Coastguard Worker// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20*8d67ca89SAndroid Build Coastguard Worker// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
21*8d67ca89SAndroid Build Coastguard Worker// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22*8d67ca89SAndroid Build Coastguard Worker// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23*8d67ca89SAndroid Build Coastguard Worker// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
24*8d67ca89SAndroid Build Coastguard Worker// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25*8d67ca89SAndroid Build Coastguard Worker// SUCH DAMAGE.
26*8d67ca89SAndroid Build Coastguard Worker
27*8d67ca89SAndroid Build Coastguard Workerpackage {
28*8d67ca89SAndroid Build Coastguard Worker    default_team: "trendy_team_native_tools_libraries",
29*8d67ca89SAndroid Build Coastguard Worker    default_applicable_licenses: ["bionic_benchmarks_license"],
30*8d67ca89SAndroid Build Coastguard Worker}
31*8d67ca89SAndroid Build Coastguard Worker
32*8d67ca89SAndroid Build Coastguard Workercc_library_headers {
33*8d67ca89SAndroid Build Coastguard Worker    name: "linker_reloc_bench_headers",
34*8d67ca89SAndroid Build Coastguard Worker    defaults: ["bionic_spawn_benchmark_targets"],
35*8d67ca89SAndroid Build Coastguard Worker    export_include_dirs: ["include"],
36*8d67ca89SAndroid Build Coastguard Worker}
37*8d67ca89SAndroid Build Coastguard Worker
38*8d67ca89SAndroid Build Coastguard Worker// TODO: This benchmark doesn't work with TradeFed/atest because it doesn't copy its test libraries
39*8d67ca89SAndroid Build Coastguard Worker// into the testcases/linker_reloc_bench directory. The obvious way to do that is to list each
40*8d67ca89SAndroid Build Coastguard Worker// library in the "data" property, but that doesn't work, because each library is listed as having a
41*8d67ca89SAndroid Build Coastguard Worker// "link:shared" variant (as opposed to "link:static"), whereas the cc_benchmark has no
42*8d67ca89SAndroid Build Coastguard Worker// "link:(shared/static)" variation. It appears that Soong needs to be fixed to make this benchmark
43*8d67ca89SAndroid Build Coastguard Worker// work with TradeFed/atest.
44*8d67ca89SAndroid Build Coastguard Worker
45*8d67ca89SAndroid Build Coastguard Workercc_benchmark {
46*8d67ca89SAndroid Build Coastguard Worker    name: "linker-reloc-bench",
47*8d67ca89SAndroid Build Coastguard Worker
48*8d67ca89SAndroid Build Coastguard Worker    defaults: [
49*8d67ca89SAndroid Build Coastguard Worker        "bionic_spawn_benchmark_targets",
50*8d67ca89SAndroid Build Coastguard Worker        "linker_reloc_bench_all_libs",
51*8d67ca89SAndroid Build Coastguard Worker    ],
52*8d67ca89SAndroid Build Coastguard Worker
53*8d67ca89SAndroid Build Coastguard Worker    data: [":linker_reloc_bench_main"],
54*8d67ca89SAndroid Build Coastguard Worker    srcs: ["linker_reloc_bench.cpp"],
55*8d67ca89SAndroid Build Coastguard Worker
56*8d67ca89SAndroid Build Coastguard Worker    static_libs: [
57*8d67ca89SAndroid Build Coastguard Worker        "libbase",
58*8d67ca89SAndroid Build Coastguard Worker        "libbionic_spawn_benchmark",
59*8d67ca89SAndroid Build Coastguard Worker        "liblog",
60*8d67ca89SAndroid Build Coastguard Worker    ],
61*8d67ca89SAndroid Build Coastguard Worker}
62*8d67ca89SAndroid Build Coastguard Worker
63*8d67ca89SAndroid Build Coastguard Workercc_defaults {
64*8d67ca89SAndroid Build Coastguard Worker    name: "linker_reloc_bench_binary",
65*8d67ca89SAndroid Build Coastguard Worker    defaults: ["bionic_spawn_benchmark_targets"],
66*8d67ca89SAndroid Build Coastguard Worker    header_libs: ["linker_reloc_bench_headers"],
67*8d67ca89SAndroid Build Coastguard Worker    stl: "none",
68*8d67ca89SAndroid Build Coastguard Worker    gtest: false,
69*8d67ca89SAndroid Build Coastguard Worker
70*8d67ca89SAndroid Build Coastguard Worker    compile_multilib: "both",
71*8d67ca89SAndroid Build Coastguard Worker    multilib: {
72*8d67ca89SAndroid Build Coastguard Worker        lib32: {
73*8d67ca89SAndroid Build Coastguard Worker            suffix: "32",
74*8d67ca89SAndroid Build Coastguard Worker        },
75*8d67ca89SAndroid Build Coastguard Worker        lib64: {
76*8d67ca89SAndroid Build Coastguard Worker            suffix: "64",
77*8d67ca89SAndroid Build Coastguard Worker        },
78*8d67ca89SAndroid Build Coastguard Worker    },
79*8d67ca89SAndroid Build Coastguard Worker}
80*8d67ca89SAndroid Build Coastguard Worker
81*8d67ca89SAndroid Build Coastguard Workercc_defaults {
82*8d67ca89SAndroid Build Coastguard Worker    name: "linker_reloc_bench_library",
83*8d67ca89SAndroid Build Coastguard Worker    defaults: ["bionic_spawn_benchmark_targets"],
84*8d67ca89SAndroid Build Coastguard Worker    header_libs: ["linker_reloc_bench_headers"],
85*8d67ca89SAndroid Build Coastguard Worker    stl: "none",
86*8d67ca89SAndroid Build Coastguard Worker    gtest: false,
87*8d67ca89SAndroid Build Coastguard Worker    relative_install_path: "linker-reloc-bench",
88*8d67ca89SAndroid Build Coastguard Worker
89*8d67ca89SAndroid Build Coastguard Worker    static: {
90*8d67ca89SAndroid Build Coastguard Worker        enabled: false,
91*8d67ca89SAndroid Build Coastguard Worker    },
92*8d67ca89SAndroid Build Coastguard Worker}
93