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