blob: 689e7c92429796dd25df10de415bb6a9a5dff7a9 [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
Ryan Prichard41f19702019-12-23 13:21:42 -080029cc_defaults {
30 name: "bionic_spawn_benchmark_targets",
Ryan Prichard2c236bc2019-09-26 12:47:47 -070031 host_supported: true,
32 target: {
Tom Cherry2f95d192020-01-09 10:06:12 -080033 darwin: {
34 enabled: false,
35 },
36 windows: {
37 enabled: false,
38 },
39 linux_glibc_x86: {
40 enabled: false,
41 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070042 },
43}
44
Ryan Prichard41f19702019-12-23 13:21:42 -080045cc_library_static {
46 name: "libbionic_spawn_benchmark",
47 defaults: ["bionic_spawn_benchmark_targets"],
48
49 srcs: ["spawn_benchmark.cpp"],
50 export_include_dirs: ["include"],
51 static_libs: [
52 "libbase",
53 "libgoogle-benchmark",
54 "liblog",
55 ],
56}
57
58cc_benchmark {
59 name: "bionic-spawn-benchmarks",
60 defaults: ["bionic_spawn_benchmark_targets"],
61
62 srcs: ["spawn_benchmarks.cpp"],
63 static_libs: [
64 "libbase",
65 "libbionic_spawn_benchmark",
66 "liblog",
67 ],
68
69 // Install these binaries in the same directory as the main benchmark binary.
70 data: [
Ryan Pricharda3d41ee2020-10-07 16:32:27 -070071 ":bench_cxa_atexit",
Ryan Prichard41f19702019-12-23 13:21:42 -080072 ":bench_noop",
73 ":bench_noop_nostl",
74 ":bench_noop_static",
75 ],
76}
77
Ryan Prichard2c236bc2019-09-26 12:47:47 -070078cc_defaults {
Ryan Pricharda3d41ee2020-10-07 16:32:27 -070079 name: "bionic_spawn_benchmark_binary",
Ryan Prichard41f19702019-12-23 13:21:42 -080080 defaults: ["bionic_spawn_benchmark_targets"],
Ryan Prichard2c236bc2019-09-26 12:47:47 -070081
82 compile_multilib: "both",
83 multilib: {
Tom Cherry2f95d192020-01-09 10:06:12 -080084 lib32: {
85 suffix: "32",
86 },
87 lib64: {
88 suffix: "64",
89 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070090 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070091
92 // When this binary is installed to host/linux-x86/bin, its runpath is ${ORIGIN}/../lib64, which
93 // is fine for finding host/linux-x86/lib64/libc++.so. When it's installed to
Ryan Pricharda3d41ee2020-10-07 16:32:27 -070094 // host/linux-x86/benchmarktest64/bionic-spawn-benchmarks, the runpath needs an extra "..". This
95 // argument has no effect when a static executable is produced.
Ryan Prichard2c236bc2019-09-26 12:47:47 -070096 target: {
97 linux_glibc_x86_64: {
98 ldflags: [
99 "-Wl,--rpath,${ORIGIN}/../../lib64",
100 ],
101 },
Tom Cherry2f95d192020-01-09 10:06:12 -0800102 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700103}
104
105cc_binary {
Ryan Pricharda3d41ee2020-10-07 16:32:27 -0700106 defaults: ["bionic_spawn_benchmark_binary"],
107 name: "bench_cxa_atexit",
108 srcs: ["bench_cxa_atexit.cpp"],
109}
110
111cc_binary {
112 defaults: ["bionic_spawn_benchmark_binary"],
113 name: "bench_noop",
114 srcs: ["noop.cpp"],
115}
116
117cc_binary {
118 defaults: ["bionic_spawn_benchmark_binary"],
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700119 name: "bench_noop_nostl",
120 srcs: ["noop.cpp"],
121 stl: "none",
122}
123
124cc_binary {
Ryan Pricharda3d41ee2020-10-07 16:32:27 -0700125 defaults: ["bionic_spawn_benchmark_binary"],
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700126 name: "bench_noop_static",
127 srcs: ["noop.cpp"],
128 static_executable: true,
129 stl: "libc++_static",
130}