blob: 89d22e3f7a65a7d5574ce85d3d39e626c5a4b9a8 [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 {
30 default_applicable_licenses: ["bionic_benchmarks_license"],
31}
32
Ryan Prichard41f19702019-12-23 13:21:42 -080033cc_defaults {
34 name: "bionic_spawn_benchmark_targets",
Ryan Prichard2c236bc2019-09-26 12:47:47 -070035 host_supported: true,
36 target: {
Tom Cherry2f95d192020-01-09 10:06:12 -080037 darwin: {
38 enabled: false,
39 },
40 windows: {
41 enabled: false,
42 },
43 linux_glibc_x86: {
44 enabled: false,
45 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070046 },
47}
48
Ryan Prichard41f19702019-12-23 13:21:42 -080049cc_library_static {
50 name: "libbionic_spawn_benchmark",
51 defaults: ["bionic_spawn_benchmark_targets"],
52
53 srcs: ["spawn_benchmark.cpp"],
54 export_include_dirs: ["include"],
55 static_libs: [
56 "libbase",
57 "libgoogle-benchmark",
58 "liblog",
59 ],
60}
61
62cc_benchmark {
63 name: "bionic-spawn-benchmarks",
64 defaults: ["bionic_spawn_benchmark_targets"],
65
66 srcs: ["spawn_benchmarks.cpp"],
67 static_libs: [
68 "libbase",
69 "libbionic_spawn_benchmark",
70 "liblog",
71 ],
72
73 // Install these binaries in the same directory as the main benchmark binary.
74 data: [
Ryan Pricharda3d41ee2020-10-07 16:32:27 -070075 ":bench_cxa_atexit",
Ryan Prichard41f19702019-12-23 13:21:42 -080076 ":bench_noop",
77 ":bench_noop_nostl",
78 ":bench_noop_static",
79 ],
80}
81
Ryan Prichard2c236bc2019-09-26 12:47:47 -070082cc_defaults {
Ryan Pricharda3d41ee2020-10-07 16:32:27 -070083 name: "bionic_spawn_benchmark_binary",
Ryan Prichard41f19702019-12-23 13:21:42 -080084 defaults: ["bionic_spawn_benchmark_targets"],
Ryan Prichard2c236bc2019-09-26 12:47:47 -070085
86 compile_multilib: "both",
87 multilib: {
Tom Cherry2f95d192020-01-09 10:06:12 -080088 lib32: {
89 suffix: "32",
90 },
91 lib64: {
92 suffix: "64",
93 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070094 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070095
96 // When this binary is installed to host/linux-x86/bin, its runpath is ${ORIGIN}/../lib64, which
97 // is fine for finding host/linux-x86/lib64/libc++.so. When it's installed to
Ryan Pricharda3d41ee2020-10-07 16:32:27 -070098 // host/linux-x86/benchmarktest64/bionic-spawn-benchmarks, the runpath needs an extra "..". This
99 // argument has no effect when a static executable is produced.
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700100 target: {
101 linux_glibc_x86_64: {
102 ldflags: [
103 "-Wl,--rpath,${ORIGIN}/../../lib64",
104 ],
105 },
Tom Cherry2f95d192020-01-09 10:06:12 -0800106 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700107}
108
109cc_binary {
Ryan Pricharda3d41ee2020-10-07 16:32:27 -0700110 defaults: ["bionic_spawn_benchmark_binary"],
111 name: "bench_cxa_atexit",
112 srcs: ["bench_cxa_atexit.cpp"],
113}
114
115cc_binary {
116 defaults: ["bionic_spawn_benchmark_binary"],
117 name: "bench_noop",
118 srcs: ["noop.cpp"],
119}
120
121cc_binary {
122 defaults: ["bionic_spawn_benchmark_binary"],
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700123 name: "bench_noop_nostl",
124 srcs: ["noop.cpp"],
125 stl: "none",
126}
127
128cc_binary {
Ryan Pricharda3d41ee2020-10-07 16:32:27 -0700129 defaults: ["bionic_spawn_benchmark_binary"],
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700130 name: "bench_noop_static",
131 srcs: ["noop.cpp"],
132 static_executable: true,
133 stl: "libc++_static",
134}