blob: 8235e38ebb2302ccfa10c9aa37c8df4109fd0f17 [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 Badour48d43032021-02-12 17:51:24 -080029package {
30 // See: http://go/android-license-faq
31 // A large-scale-change added 'default_applicable_licenses' to import
32 // all of the 'license_kinds' from "bionic_license"
33 // to get the below license kinds:
34 // SPDX-license-identifier-BSD
35 default_applicable_licenses: ["bionic_license"],
36}
37
Ryan Prichard41f19702019-12-23 13:21:42 -080038cc_defaults {
39 name: "bionic_spawn_benchmark_targets",
Ryan Prichard2c236bc2019-09-26 12:47:47 -070040 host_supported: true,
41 target: {
Tom Cherry2f95d192020-01-09 10:06:12 -080042 darwin: {
43 enabled: false,
44 },
45 windows: {
46 enabled: false,
47 },
48 linux_glibc_x86: {
49 enabled: false,
50 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070051 },
52}
53
Ryan Prichard41f19702019-12-23 13:21:42 -080054cc_library_static {
55 name: "libbionic_spawn_benchmark",
56 defaults: ["bionic_spawn_benchmark_targets"],
57
58 srcs: ["spawn_benchmark.cpp"],
59 export_include_dirs: ["include"],
60 static_libs: [
61 "libbase",
62 "libgoogle-benchmark",
63 "liblog",
64 ],
65}
66
67cc_benchmark {
68 name: "bionic-spawn-benchmarks",
69 defaults: ["bionic_spawn_benchmark_targets"],
70
71 srcs: ["spawn_benchmarks.cpp"],
72 static_libs: [
73 "libbase",
74 "libbionic_spawn_benchmark",
75 "liblog",
76 ],
77
78 // Install these binaries in the same directory as the main benchmark binary.
79 data: [
Ryan Pricharda3d41ee2020-10-07 16:32:27 -070080 ":bench_cxa_atexit",
Ryan Prichard41f19702019-12-23 13:21:42 -080081 ":bench_noop",
82 ":bench_noop_nostl",
83 ":bench_noop_static",
84 ],
85}
86
Ryan Prichard2c236bc2019-09-26 12:47:47 -070087cc_defaults {
Ryan Pricharda3d41ee2020-10-07 16:32:27 -070088 name: "bionic_spawn_benchmark_binary",
Ryan Prichard41f19702019-12-23 13:21:42 -080089 defaults: ["bionic_spawn_benchmark_targets"],
Ryan Prichard2c236bc2019-09-26 12:47:47 -070090
91 compile_multilib: "both",
92 multilib: {
Tom Cherry2f95d192020-01-09 10:06:12 -080093 lib32: {
94 suffix: "32",
95 },
96 lib64: {
97 suffix: "64",
98 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070099 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700100
101 // When this binary is installed to host/linux-x86/bin, its runpath is ${ORIGIN}/../lib64, which
102 // is fine for finding host/linux-x86/lib64/libc++.so. When it's installed to
Ryan Pricharda3d41ee2020-10-07 16:32:27 -0700103 // host/linux-x86/benchmarktest64/bionic-spawn-benchmarks, the runpath needs an extra "..". This
104 // argument has no effect when a static executable is produced.
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700105 target: {
106 linux_glibc_x86_64: {
107 ldflags: [
108 "-Wl,--rpath,${ORIGIN}/../../lib64",
109 ],
110 },
Tom Cherry2f95d192020-01-09 10:06:12 -0800111 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700112}
113
114cc_binary {
Ryan Pricharda3d41ee2020-10-07 16:32:27 -0700115 defaults: ["bionic_spawn_benchmark_binary"],
116 name: "bench_cxa_atexit",
117 srcs: ["bench_cxa_atexit.cpp"],
118}
119
120cc_binary {
121 defaults: ["bionic_spawn_benchmark_binary"],
122 name: "bench_noop",
123 srcs: ["noop.cpp"],
124}
125
126cc_binary {
127 defaults: ["bionic_spawn_benchmark_binary"],
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700128 name: "bench_noop_nostl",
129 srcs: ["noop.cpp"],
130 stl: "none",
131}
132
133cc_binary {
Ryan Pricharda3d41ee2020-10-07 16:32:27 -0700134 defaults: ["bionic_spawn_benchmark_binary"],
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700135 name: "bench_noop_static",
136 srcs: ["noop.cpp"],
137 static_executable: true,
138 stl: "libc++_static",
139}