blob: de9b161af72ea7f29dc8865d2bec5c9af9285bc7 [file] [log] [blame]
Ryan Prichard2c236bc2019-09-26 12:47:47 -07001//
2// Copyright (C) 2019 The Android Open Source Project
3// All rights reserved.
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions
7// are met:
8// * Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// * Redistributions in binary form must reproduce the above copyright
11// notice, this list of conditions and the following disclaimer in
12// the documentation and/or other materials provided with the
13// distribution.
14//
15// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26// SUCH DAMAGE.
27//
28
Bob Badouraa7d8352021-02-19 13:06:22 -080029package {
Aditya Choudharyd9d37c02024-02-02 13:57:12 +000030 default_team: "trendy_team_native_tools_libraries",
Bob Badouraa7d8352021-02-19 13:06:22 -080031 default_applicable_licenses: ["bionic_benchmarks_license"],
32}
33
Ryan Prichard41f19702019-12-23 13:21:42 -080034cc_defaults {
35 name: "bionic_spawn_benchmark_targets",
Ryan Prichard2c236bc2019-09-26 12:47:47 -070036 host_supported: true,
37 target: {
Tom Cherry2f95d192020-01-09 10:06:12 -080038 darwin: {
39 enabled: false,
40 },
41 windows: {
42 enabled: false,
43 },
44 linux_glibc_x86: {
45 enabled: false,
46 },
Colin Crossda446cc2022-03-08 15:07:57 -080047 linux_musl_x86: {
48 enabled: false,
49 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070050 },
51}
52
Ryan Prichard41f19702019-12-23 13:21:42 -080053cc_library_static {
54 name: "libbionic_spawn_benchmark",
55 defaults: ["bionic_spawn_benchmark_targets"],
56
57 srcs: ["spawn_benchmark.cpp"],
58 export_include_dirs: ["include"],
59 static_libs: [
60 "libbase",
61 "libgoogle-benchmark",
62 "liblog",
63 ],
64}
65
66cc_benchmark {
67 name: "bionic-spawn-benchmarks",
68 defaults: ["bionic_spawn_benchmark_targets"],
69
70 srcs: ["spawn_benchmarks.cpp"],
71 static_libs: [
72 "libbase",
73 "libbionic_spawn_benchmark",
74 "liblog",
75 ],
76
77 // Install these binaries in the same directory as the main benchmark binary.
78 data: [
Ryan Pricharda3d41ee2020-10-07 16:32:27 -070079 ":bench_cxa_atexit",
Ryan Prichard41f19702019-12-23 13:21:42 -080080 ":bench_noop",
81 ":bench_noop_nostl",
82 ":bench_noop_static",
83 ],
84}
85
Ryan Prichard2c236bc2019-09-26 12:47:47 -070086cc_defaults {
Ryan Pricharda3d41ee2020-10-07 16:32:27 -070087 name: "bionic_spawn_benchmark_binary",
Ryan Prichard41f19702019-12-23 13:21:42 -080088 defaults: ["bionic_spawn_benchmark_targets"],
Ryan Prichard2c236bc2019-09-26 12:47:47 -070089
90 compile_multilib: "both",
91 multilib: {
Tom Cherry2f95d192020-01-09 10:06:12 -080092 lib32: {
93 suffix: "32",
94 },
95 lib64: {
96 suffix: "64",
97 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070098 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070099
100 // When this binary is installed to host/linux-x86/bin, its runpath is ${ORIGIN}/../lib64, which
101 // is fine for finding host/linux-x86/lib64/libc++.so. When it's installed to
Ryan Pricharda3d41ee2020-10-07 16:32:27 -0700102 // host/linux-x86/benchmarktest64/bionic-spawn-benchmarks, the runpath needs an extra "..". This
103 // argument has no effect when a static executable is produced.
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700104 target: {
105 linux_glibc_x86_64: {
106 ldflags: [
107 "-Wl,--rpath,${ORIGIN}/../../lib64",
108 ],
109 },
Colin Crossda446cc2022-03-08 15:07:57 -0800110 linux_musl_x86_64: {
111 ldflags: [
112 "-Wl,--rpath,${ORIGIN}/../../lib64",
113 ],
114 },
Tom Cherry2f95d192020-01-09 10:06:12 -0800115 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700116}
117
118cc_binary {
Ryan Pricharda3d41ee2020-10-07 16:32:27 -0700119 defaults: ["bionic_spawn_benchmark_binary"],
120 name: "bench_cxa_atexit",
121 srcs: ["bench_cxa_atexit.cpp"],
122}
123
124cc_binary {
125 defaults: ["bionic_spawn_benchmark_binary"],
126 name: "bench_noop",
127 srcs: ["noop.cpp"],
128}
129
130cc_binary {
131 defaults: ["bionic_spawn_benchmark_binary"],
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700132 name: "bench_noop_nostl",
133 srcs: ["noop.cpp"],
134 stl: "none",
135}
136
137cc_binary {
Ryan Pricharda3d41ee2020-10-07 16:32:27 -0700138 defaults: ["bionic_spawn_benchmark_binary"],
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700139 name: "bench_noop_static",
140 srcs: ["noop.cpp"],
141 static_executable: true,
142 stl: "libc++_static",
143}