blob: 1295e2b3091afbc4f3286b47509e2b7e2cf7b2b8 [file] [log] [blame]
Ryan Prichardaa85ac22019-09-18 15:58:46 -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
29cc_benchmark {
30 name: "bionic-spawn-benchmarks",
31 srcs: ["spawn_benchmarks.cpp"],
32 static_libs: ["libbase"],
33
34 // Install these binaries in the same directory as the main benchmark binary.
35 data: [
36 ":bench_noop",
37 ":bench_noop_nostl",
38 ":bench_noop_static",
39 ],
40
41 host_supported: true,
42 target: {
43 darwin: { enabled: false },
44 windows: { enabled: false },
45 },
46}
47
48cc_defaults {
49 name: "noop_binary_defaults",
50
51 compile_multilib: "both",
52 multilib: {
53 lib32: { suffix: "32" },
54 lib64: { suffix: "64" },
55 },
56
57 host_supported: true,
58 target: {
59 darwin: { enabled: false },
60 windows: { enabled: false },
61 },
62}
63
64cc_binary {
65 defaults: ["noop_binary_defaults"],
66 name: "bench_noop",
67 srcs: ["noop.cpp"],
68
69 // When this binary is installed to host/linux-x86/bin, its runpath is ${ORIGIN}/../lib[64],
70 // which is fine for finding host/linux-x86/lib[64]/libc++.so. When it's installed to
71 // host/linux-x86/benchmarktest[64]/bionic-spawn-benchmarks, the runpath needs an extra "..".
72 target: {
73 linux_glibc_x86: {
74 ldflags: [
75 "-Wl,--rpath,${ORIGIN}/../../lib",
76 ],
77 },
78 linux_glibc_x86_64: {
79 ldflags: [
80 "-Wl,--rpath,${ORIGIN}/../../lib64",
81 ],
82 },
83 }
84}
85
86cc_binary {
87 defaults: ["noop_binary_defaults"],
88 name: "bench_noop_nostl",
89 srcs: ["noop.cpp"],
90 stl: "none",
91}
92
93cc_binary {
94 defaults: ["noop_binary_defaults"],
95 name: "bench_noop_static",
96 srcs: ["noop.cpp"],
97 static_executable: true,
98 stl: "libc++_static",
99}