Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 1 | // |
| 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 Badour | aa7d835 | 2021-02-19 13:06:22 -0800 | [diff] [blame] | 29 | package { |
| 30 | default_applicable_licenses: ["bionic_benchmarks_license"], |
| 31 | } |
| 32 | |
Ryan Prichard | 41f1970 | 2019-12-23 13:21:42 -0800 | [diff] [blame] | 33 | cc_defaults { |
| 34 | name: "bionic_spawn_benchmark_targets", |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 35 | host_supported: true, |
| 36 | target: { |
Tom Cherry | 2f95d19 | 2020-01-09 10:06:12 -0800 | [diff] [blame] | 37 | darwin: { |
| 38 | enabled: false, |
| 39 | }, |
| 40 | windows: { |
| 41 | enabled: false, |
| 42 | }, |
| 43 | linux_glibc_x86: { |
| 44 | enabled: false, |
| 45 | }, |
Colin Cross | da446cc | 2022-03-08 15:07:57 -0800 | [diff] [blame] | 46 | linux_musl_x86: { |
| 47 | enabled: false, |
| 48 | }, |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 49 | }, |
| 50 | } |
| 51 | |
Ryan Prichard | 41f1970 | 2019-12-23 13:21:42 -0800 | [diff] [blame] | 52 | cc_library_static { |
| 53 | name: "libbionic_spawn_benchmark", |
| 54 | defaults: ["bionic_spawn_benchmark_targets"], |
| 55 | |
| 56 | srcs: ["spawn_benchmark.cpp"], |
| 57 | export_include_dirs: ["include"], |
| 58 | static_libs: [ |
| 59 | "libbase", |
| 60 | "libgoogle-benchmark", |
| 61 | "liblog", |
| 62 | ], |
| 63 | } |
| 64 | |
| 65 | cc_benchmark { |
| 66 | name: "bionic-spawn-benchmarks", |
| 67 | defaults: ["bionic_spawn_benchmark_targets"], |
| 68 | |
| 69 | srcs: ["spawn_benchmarks.cpp"], |
| 70 | static_libs: [ |
| 71 | "libbase", |
| 72 | "libbionic_spawn_benchmark", |
| 73 | "liblog", |
| 74 | ], |
| 75 | |
| 76 | // Install these binaries in the same directory as the main benchmark binary. |
| 77 | data: [ |
Ryan Prichard | a3d41ee | 2020-10-07 16:32:27 -0700 | [diff] [blame] | 78 | ":bench_cxa_atexit", |
Ryan Prichard | 41f1970 | 2019-12-23 13:21:42 -0800 | [diff] [blame] | 79 | ":bench_noop", |
| 80 | ":bench_noop_nostl", |
| 81 | ":bench_noop_static", |
| 82 | ], |
| 83 | } |
| 84 | |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 85 | cc_defaults { |
Ryan Prichard | a3d41ee | 2020-10-07 16:32:27 -0700 | [diff] [blame] | 86 | name: "bionic_spawn_benchmark_binary", |
Ryan Prichard | 41f1970 | 2019-12-23 13:21:42 -0800 | [diff] [blame] | 87 | defaults: ["bionic_spawn_benchmark_targets"], |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 88 | |
| 89 | compile_multilib: "both", |
| 90 | multilib: { |
Tom Cherry | 2f95d19 | 2020-01-09 10:06:12 -0800 | [diff] [blame] | 91 | lib32: { |
| 92 | suffix: "32", |
| 93 | }, |
| 94 | lib64: { |
| 95 | suffix: "64", |
| 96 | }, |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 97 | }, |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 98 | |
| 99 | // When this binary is installed to host/linux-x86/bin, its runpath is ${ORIGIN}/../lib64, which |
| 100 | // is fine for finding host/linux-x86/lib64/libc++.so. When it's installed to |
Ryan Prichard | a3d41ee | 2020-10-07 16:32:27 -0700 | [diff] [blame] | 101 | // host/linux-x86/benchmarktest64/bionic-spawn-benchmarks, the runpath needs an extra "..". This |
| 102 | // argument has no effect when a static executable is produced. |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 103 | target: { |
| 104 | linux_glibc_x86_64: { |
| 105 | ldflags: [ |
| 106 | "-Wl,--rpath,${ORIGIN}/../../lib64", |
| 107 | ], |
| 108 | }, |
Colin Cross | da446cc | 2022-03-08 15:07:57 -0800 | [diff] [blame] | 109 | linux_musl_x86_64: { |
| 110 | ldflags: [ |
| 111 | "-Wl,--rpath,${ORIGIN}/../../lib64", |
| 112 | ], |
| 113 | }, |
Tom Cherry | 2f95d19 | 2020-01-09 10:06:12 -0800 | [diff] [blame] | 114 | }, |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 115 | } |
| 116 | |
| 117 | cc_binary { |
Ryan Prichard | a3d41ee | 2020-10-07 16:32:27 -0700 | [diff] [blame] | 118 | defaults: ["bionic_spawn_benchmark_binary"], |
| 119 | name: "bench_cxa_atexit", |
| 120 | srcs: ["bench_cxa_atexit.cpp"], |
| 121 | } |
| 122 | |
| 123 | cc_binary { |
| 124 | defaults: ["bionic_spawn_benchmark_binary"], |
| 125 | name: "bench_noop", |
| 126 | srcs: ["noop.cpp"], |
| 127 | } |
| 128 | |
| 129 | cc_binary { |
| 130 | defaults: ["bionic_spawn_benchmark_binary"], |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 131 | name: "bench_noop_nostl", |
| 132 | srcs: ["noop.cpp"], |
| 133 | stl: "none", |
| 134 | } |
| 135 | |
| 136 | cc_binary { |
Ryan Prichard | a3d41ee | 2020-10-07 16:32:27 -0700 | [diff] [blame] | 137 | defaults: ["bionic_spawn_benchmark_binary"], |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 138 | name: "bench_noop_static", |
| 139 | srcs: ["noop.cpp"], |
| 140 | static_executable: true, |
| 141 | stl: "libc++_static", |
| 142 | } |