| Bob Badour | aa7d835 | 2021-02-19 13:06:22 -0800 | [diff] [blame] | 1 | package { | 
|  | 2 | default_applicable_licenses: ["bionic_libc_license"], | 
|  | 3 | } | 
|  | 4 |  | 
|  | 5 | license { | 
|  | 6 | name: "bionic_libc_license", | 
|  | 7 | visibility: [":__subpackages__"], | 
|  | 8 | license_kinds: [ | 
|  | 9 | "SPDX-license-identifier-Apache-2.0", | 
|  | 10 | "SPDX-license-identifier-BSD", | 
|  | 11 | "SPDX-license-identifier-ISC", | 
|  | 12 | "SPDX-license-identifier-MIT", | 
|  | 13 | "legacy_notice", | 
|  | 14 | "legacy_unencumbered", | 
|  | 15 | ], | 
|  | 16 | license_text: [ | 
|  | 17 | "NOTICE", | 
|  | 18 | ], | 
|  | 19 | } | 
|  | 20 |  | 
| Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 21 | libc_common_flags = [ | 
|  | 22 | "-D_LIBC=1", | 
| Elliott Hughes | 25f17e4 | 2018-02-12 15:48:01 -0800 | [diff] [blame] | 23 | "-D__BIONIC_LP32_USE_STAT64", | 
| Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 24 | "-Wall", | 
|  | 25 | "-Wextra", | 
|  | 26 | "-Wunused", | 
| Elliott Hughes | 3048a36 | 2018-01-19 17:58:07 -0800 | [diff] [blame] | 27 | "-Wno-char-subscripts", | 
| Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 28 | "-Wno-deprecated-declarations", | 
| Elliott Hughes | b348d5c | 2017-07-24 16:53:11 -0700 | [diff] [blame] | 29 | "-Wno-gcc-compat", | 
| Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 30 | "-Wframe-larger-than=2048", | 
| Christopher Ferris | 1de7a48 | 2023-09-12 11:06:29 -0700 | [diff] [blame] | 31 | "-Wno-reorder-init-list", | 
| Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 32 |  | 
|  | 33 | // Try to catch typical 32-bit assumptions that break with 64-bit pointers. | 
|  | 34 | "-Werror=pointer-to-int-cast", | 
|  | 35 | "-Werror=int-to-pointer-cast", | 
|  | 36 | "-Werror=type-limits", | 
|  | 37 | "-Werror", | 
| Ryan Prichard | 8f41957 | 2018-02-20 17:09:05 -0800 | [diff] [blame] | 38 |  | 
|  | 39 | // Clang's exit-time destructor registration hides __dso_handle, but | 
|  | 40 | // __dso_handle needs to have default visibility on ARM32. See b/73485611. | 
|  | 41 | "-Wexit-time-destructors", | 
| Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 42 |  | 
| Elliott Hughes | a13d066 | 2021-12-02 14:42:16 -0800 | [diff] [blame] | 43 | // We know clang does a lot of harm by rewriting what we've said, and sadly | 
|  | 44 | // never see any good it does, so let's just ask it to do what we say... | 
|  | 45 | // (The specific motivating example was clang turning a loop that would only | 
|  | 46 | // ever touch 0, 1, or 2 bytes into a call to memset, which was never going | 
|  | 47 | // to amortize.) | 
|  | 48 | "-fno-builtin", | 
| Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 49 | ] | 
|  | 50 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 51 | // Define some common cflags | 
|  | 52 | // ======================================================== | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 53 | cc_defaults { | 
|  | 54 | name: "libc_defaults", | 
| Dan Willemsen | 7ec52b1 | 2016-11-28 17:02:25 -0800 | [diff] [blame] | 55 | defaults: ["linux_bionic_supported"], | 
| Christopher Ferris | b542505 | 2024-04-23 17:15:39 -0700 | [diff] [blame] | 56 | cflags: libc_common_flags + [ | 
|  | 57 | "-DUSE_SCUDO", | 
|  | 58 | ], | 
| Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 59 | asflags: libc_common_flags, | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 60 | conlyflags: ["-std=gnu99"], | 
|  | 61 | cppflags: [], | 
| Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 62 | include_dirs: [ | 
|  | 63 | "bionic/libc/async_safe/include", | 
| Peter Collingbourne | 5d3aa86 | 2020-09-11 15:05:17 -0700 | [diff] [blame] | 64 | "bionic/libc/platform", | 
| Tom Cherry | 379ed1e | 2020-09-17 09:36:25 -0700 | [diff] [blame] | 65 | // For android_filesystem_config.h. | 
|  | 66 | "system/core/libcutils/include", | 
| Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 67 | ], | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 68 |  | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 69 | header_libs: [ | 
|  | 70 | "libc_headers", | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 71 | "liblog_headers", // needed by bionic/libc/async_safe/include | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 72 | ], | 
|  | 73 | export_header_lib_headers: [ | 
|  | 74 | "libc_headers", | 
|  | 75 | ], | 
| Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 76 |  | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 77 | stl: "none", | 
|  | 78 | system_shared_libs: [], | 
| Colin Cross | 27c43c5 | 2016-04-07 13:27:24 -0700 | [diff] [blame] | 79 | sanitize: { | 
| Evgenii Stepanov | be551f5 | 2018-08-13 16:46:15 -0700 | [diff] [blame] | 80 | address: false, | 
|  | 81 | integer_overflow: false, | 
| Mitch Phillips | dfde0ee | 2019-05-01 14:26:13 -0700 | [diff] [blame] | 82 | // TODO(b/132640749): Fix broken fuzzer support. | 
|  | 83 | fuzzer: false, | 
| Colin Cross | 27c43c5 | 2016-04-07 13:27:24 -0700 | [diff] [blame] | 84 | }, | 
| Yifan Hong | 5a39cee | 2020-01-21 16:43:56 -0800 | [diff] [blame] | 85 | ramdisk_available: true, | 
| Yifan Hong | b04490d | 2020-10-21 18:36:36 -0700 | [diff] [blame] | 86 | vendor_ramdisk_available: true, | 
| Jiyong Park | 5603c6e | 2018-04-27 21:53:11 +0900 | [diff] [blame] | 87 | recovery_available: true, | 
| dimitry | 7f04880 | 2019-05-03 15:57:34 +0200 | [diff] [blame] | 88 | native_bridge_supported: true, | 
| Ivan Lozano | f17fd1d | 2018-11-27 07:56:17 -0800 | [diff] [blame] | 89 |  | 
| Peter Collingbourne | e99912f | 2019-11-01 15:37:00 -0700 | [diff] [blame] | 90 | product_variables: { | 
| Evgenii Stepanov | 5a73e03 | 2020-04-29 14:59:44 -0700 | [diff] [blame] | 91 | malloc_zero_contents: { | 
|  | 92 | cflags: ["-DSCUDO_ZERO_CONTENTS"], | 
|  | 93 | }, | 
|  | 94 | malloc_pattern_fill_contents: { | 
|  | 95 | cflags: ["-DSCUDO_PATTERN_FILL_CONTENTS"], | 
|  | 96 | }, | 
| Christopher Ferris | b542505 | 2024-04-23 17:15:39 -0700 | [diff] [blame] | 97 | malloc_low_memory: { | 
|  | 98 | cflags: ["-UUSE_SCUDO"], | 
| Steven Moreland | fb65ee4 | 2020-07-31 00:18:38 +0000 | [diff] [blame] | 99 | }, | 
| Peter Collingbourne | e99912f | 2019-11-01 15:37:00 -0700 | [diff] [blame] | 100 | }, | 
| Yi Kong | 9e33b76 | 2021-10-29 02:43:22 +0800 | [diff] [blame] | 101 |  | 
|  | 102 | lto: { | 
|  | 103 | never: true, | 
|  | 104 | }, | 
| Elliott Hughes | c204334 | 2023-07-20 20:24:09 +0000 | [diff] [blame] | 105 |  | 
|  | 106 | apex_available: ["com.android.runtime"], | 
| Elliott Hughes | 7d13666 | 2023-10-27 15:40:32 -0700 | [diff] [blame] | 107 |  | 
|  | 108 | tidy_disabled_srcs: ["upstream-*/**/*.c"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 109 | } | 
|  | 110 |  | 
| Elliott Hughes | 788075a | 2024-06-18 12:25:37 +0000 | [diff] [blame] | 111 | // Workaround for b/24465209. | 
|  | 112 | // We're unlikely to be able to remove this before we just | 
|  | 113 | // remove ILP32 support completely. | 
|  | 114 | // Note that we also still have `pack_relocations: false` | 
|  | 115 | // for both libc and libm, even on LP64. | 
|  | 116 | // ======================================================== | 
|  | 117 | cc_defaults { | 
|  | 118 | name: "bug_24465209_workaround", | 
| Elliott Hughes | feb9473 | 2024-06-18 19:44:18 +0000 | [diff] [blame] | 119 | target: { | 
|  | 120 | android_arm: { | 
| Elliott Hughes | 788075a | 2024-06-18 12:25:37 +0000 | [diff] [blame] | 121 | pack_relocations: false, | 
|  | 122 | ldflags: ["-Wl,--hash-style=both"], | 
|  | 123 | }, | 
| Elliott Hughes | feb9473 | 2024-06-18 19:44:18 +0000 | [diff] [blame] | 124 | android_x86: { | 
| Elliott Hughes | 788075a | 2024-06-18 12:25:37 +0000 | [diff] [blame] | 125 | pack_relocations: false, | 
|  | 126 | ldflags: ["-Wl,--hash-style=both"], | 
| Elliott Hughes | b4e0278 | 2024-06-21 11:35:18 +0000 | [diff] [blame] | 127 | }, | 
| Elliott Hughes | 788075a | 2024-06-18 12:25:37 +0000 | [diff] [blame] | 128 | }, | 
|  | 129 | } | 
|  | 130 |  | 
| Elliott Hughes | 89aada1 | 2024-07-01 21:59:04 +0000 | [diff] [blame] | 131 | // Leave the symbols in the shared library so that stack unwinders can produce | 
|  | 132 | // meaningful name resolution. This is a bit more ugly than it sounds because | 
|  | 133 | // arm32 is a bit broken. | 
|  | 134 | // ======================================================== | 
|  | 135 | cc_defaults { | 
|  | 136 | name: "keep_symbols", | 
|  | 137 | arch: { | 
|  | 138 | arm: { | 
|  | 139 | // arm32 does not produce complete exidx unwind information, | 
|  | 140 | // so keep the .debug_frame which is relatively small and does | 
|  | 141 | // include needed unwind information. | 
|  | 142 | // See b/132992102 for details. | 
|  | 143 | strip: { | 
|  | 144 | keep_symbols_and_debug_frame: true, | 
|  | 145 | }, | 
|  | 146 | }, | 
|  | 147 | arm64: { | 
|  | 148 | strip: { | 
|  | 149 | keep_symbols: true, | 
|  | 150 | }, | 
|  | 151 | }, | 
|  | 152 | riscv64: { | 
|  | 153 | strip: { | 
|  | 154 | keep_symbols: true, | 
|  | 155 | }, | 
|  | 156 | }, | 
|  | 157 | x86: { | 
|  | 158 | strip: { | 
|  | 159 | keep_symbols: true, | 
|  | 160 | }, | 
|  | 161 | }, | 
|  | 162 | x86_64: { | 
|  | 163 | strip: { | 
|  | 164 | keep_symbols: true, | 
|  | 165 | }, | 
|  | 166 | }, | 
|  | 167 | }, | 
|  | 168 | } | 
|  | 169 |  | 
| Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 170 | // Defaults for native allocator libs/includes to make it | 
|  | 171 | // easier to change. | 
| Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 172 | // ======================================================== | 
|  | 173 | cc_defaults { | 
|  | 174 | name: "libc_native_allocator_defaults", | 
|  | 175 |  | 
| Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 176 | whole_static_libs: [ | 
| Christopher Ferris | b542505 | 2024-04-23 17:15:39 -0700 | [diff] [blame] | 177 | "libscudo", | 
|  | 178 | ], | 
|  | 179 | cflags: [ | 
|  | 180 | "-DUSE_SCUDO", | 
| Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 181 | ], | 
| Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 182 | header_libs: ["gwp_asan_headers"], | 
| Christopher Ferris | b542505 | 2024-04-23 17:15:39 -0700 | [diff] [blame] | 183 | product_variables: { | 
|  | 184 | malloc_low_memory: { | 
|  | 185 | cflags: ["-UUSE_SCUDO"], | 
|  | 186 | whole_static_libs: [ | 
|  | 187 | "libjemalloc5", | 
|  | 188 | "libc_jemalloc_wrapper", | 
|  | 189 | ], | 
|  | 190 | exclude_static_libs: [ | 
|  | 191 | "libscudo", | 
|  | 192 | ], | 
|  | 193 | }, | 
|  | 194 | }, | 
| Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 195 | } | 
|  | 196 |  | 
|  | 197 | // Functions not implemented by jemalloc directly, or that need to | 
|  | 198 | // be modified for Android. | 
|  | 199 | cc_library_static { | 
|  | 200 | name: "libc_jemalloc_wrapper", | 
|  | 201 | defaults: ["libc_defaults"], | 
|  | 202 | srcs: ["bionic/jemalloc_wrapper.cpp"], | 
|  | 203 | cflags: ["-fvisibility=hidden"], | 
|  | 204 |  | 
| Christopher Ferris | 4df29ed | 2020-01-24 18:06:42 -0800 | [diff] [blame] | 205 | // Used to pull in the jemalloc include directory so that if the | 
|  | 206 | // library is removed, the include directory is also removed. | 
|  | 207 | static_libs: ["libjemalloc5"], | 
| Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 208 | } | 
|  | 209 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 210 | // ======================================================== | 
| Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 211 | // libc_bootstrap.a - -fno-stack-protector and -ffreestanding | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 212 | // ======================================================== | 
|  | 213 | // | 
| Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 214 | // Code that implements the stack protector (or that runs before TLS has been set up) needs to be | 
|  | 215 | // compiled with -fno-stack-protector, since it accesses the stack canary TLS slot. In the linker, | 
|  | 216 | // some of this code runs before ifunc resolvers have made string.h functions work, so compile with | 
|  | 217 | // -ffreestanding. | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 218 |  | 
|  | 219 | cc_library_static { | 
|  | 220 |  | 
| Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 221 | srcs: [ | 
|  | 222 | "bionic/__libc_init_main_thread.cpp", | 
|  | 223 | "bionic/__stack_chk_fail.cpp", | 
| Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 224 | "bionic/bionic_call_ifunc_resolver.cpp", | 
|  | 225 | "bionic/getauxval.cpp", | 
| Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 226 | ], | 
|  | 227 | arch: { | 
|  | 228 | arm64: { | 
|  | 229 | srcs: ["arch-arm64/bionic/__set_tls.c"], | 
|  | 230 | }, | 
| Elliott Hughes | ebc19a9 | 2022-10-14 23:25:36 +0000 | [diff] [blame] | 231 | riscv64: { | 
|  | 232 | srcs: ["arch-riscv64/bionic/__set_tls.c"], | 
|  | 233 | }, | 
| Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 234 | x86: { | 
| Ryan Prichard | 27475b5 | 2018-05-17 17:14:18 -0700 | [diff] [blame] | 235 | srcs: [ | 
|  | 236 | "arch-x86/bionic/__libc_init_sysinfo.cpp", | 
| Pirama Arumuga Nainar | 7b89be7 | 2021-02-12 15:09:49 -0800 | [diff] [blame] | 237 | "arch-x86/bionic/__libc_int0x80.S", | 
| Ryan Prichard | 27475b5 | 2018-05-17 17:14:18 -0700 | [diff] [blame] | 238 | "arch-x86/bionic/__set_tls.cpp", | 
|  | 239 | ], | 
| Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 240 | }, | 
|  | 241 | x86_64: { | 
|  | 242 | srcs: ["arch-x86_64/bionic/__set_tls.c"], | 
|  | 243 | }, | 
|  | 244 | }, | 
|  | 245 |  | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 246 | defaults: ["libc_defaults"], | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 247 | cflags: [ | 
|  | 248 | "-fno-stack-protector", | 
|  | 249 | "-ffreestanding", | 
|  | 250 | ], | 
| Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 251 | name: "libc_bootstrap", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 252 | } | 
|  | 253 |  | 
| Kalesh Singh | f0050fb | 2023-12-15 10:02:01 -0800 | [diff] [blame] | 254 | filegroup { | 
|  | 255 | name: "elf_note_sources", | 
|  | 256 | srcs: ["bionic/elf_note.cpp"], | 
|  | 257 | } | 
|  | 258 |  | 
| Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 259 | // libc_init_static.cpp and libc_init_dynamic.cpp need to be built without stack protector. | 
|  | 260 | // libc_init_static.cpp sets up TLS for static executables, and libc_init_dynamic.cpp initializes | 
|  | 261 | // the stack protector global variable. | 
| Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 262 |  | 
|  | 263 | cc_library_static { | 
|  | 264 | name: "libc_init_static", | 
|  | 265 | defaults: ["libc_defaults"], | 
| Kalesh Singh | f0050fb | 2023-12-15 10:02:01 -0800 | [diff] [blame] | 266 | srcs: [ | 
| Florian Mayer | a6e9dcf | 2024-11-06 12:41:22 -0800 | [diff] [blame] | 267 | "bionic/libc_init_mte.cpp", | 
| Kalesh Singh | f0050fb | 2023-12-15 10:02:01 -0800 | [diff] [blame] | 268 | "bionic/libc_init_static.cpp", | 
|  | 269 | ":elf_note_sources", | 
|  | 270 | ], | 
| Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 271 | cflags: [ | 
|  | 272 | "-fno-stack-protector", | 
|  | 273 |  | 
|  | 274 | // Compile libc_init_static.cpp with -ffreestanding, because some of its code is called | 
|  | 275 | // from the linker before ifunc resolvers have made string.h functions available. | 
|  | 276 | "-ffreestanding", | 
|  | 277 | ], | 
| Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 278 | } | 
|  | 279 |  | 
| Stephen Crane | f4b1cbd | 2017-05-09 14:27:43 -0700 | [diff] [blame] | 280 | cc_library_static { | 
|  | 281 | name: "libc_init_dynamic", | 
|  | 282 | defaults: ["libc_defaults"], | 
|  | 283 | srcs: ["bionic/libc_init_dynamic.cpp"], | 
|  | 284 | cflags: ["-fno-stack-protector"], | 
|  | 285 | } | 
| Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 286 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 287 | // ======================================================== | 
|  | 288 | // libc_tzcode.a - upstream 'tzcode' code | 
|  | 289 | // ======================================================== | 
|  | 290 |  | 
|  | 291 | cc_library_static { | 
|  | 292 |  | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 293 | defaults: ["libc_defaults"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 294 | srcs: [ | 
| Dan Willemsen | 9c9aa74 | 2016-01-15 16:00:57 -0800 | [diff] [blame] | 295 | "tzcode/**/*.c", | 
| Elliott Hughes | 0e8616a | 2017-04-11 14:44:51 -0700 | [diff] [blame] | 296 | "tzcode/bionic.cpp", | 
| Elliott Hughes | 2bd4316 | 2023-06-15 13:17:08 -0700 | [diff] [blame] | 297 | // tzcode doesn't include strptime, so we use a fork of the | 
|  | 298 | // OpenBSD code which needs this global data. | 
| Elliott Hughes | d3627a4 | 2022-12-06 22:24:27 +0000 | [diff] [blame] | 299 | "upstream-openbsd/lib/libc/locale/_def_time.c", | 
| Elliott Hughes | 2bd4316 | 2023-06-15 13:17:08 -0700 | [diff] [blame] | 300 | // tzcode doesn't include wcsftime, so we use the FreeBSD code. | 
|  | 301 | "upstream-freebsd/lib/libc/locale/wcsftime.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 302 | ], | 
|  | 303 |  | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 304 | cflags: [ | 
| Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 305 | "-Wno-unused-parameter", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 306 | // Don't use ridiculous amounts of stack. | 
|  | 307 | "-DALL_STATE", | 
|  | 308 | // Include tzsetwall, timelocal, timegm, time2posix, and posix2time. | 
|  | 309 | "-DSTD_INSPIRED", | 
| Colin Cross | a35d23d | 2015-11-19 13:32:49 -0800 | [diff] [blame] | 310 | // Obviously, we want to be thread-safe. | 
| Almaz Mingaleev | 5411aff | 2022-02-11 12:27:12 +0000 | [diff] [blame] | 311 | "-DTHREAD_SAFE=1", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 312 | // The name of the tm_gmtoff field in our struct tm. | 
|  | 313 | "-DTM_GMTOFF=tm_gmtoff", | 
| Elliott Hughes | 31fc69f | 2023-06-20 15:36:11 -0700 | [diff] [blame] | 314 | // Android uses a system property instead of /etc/localtime, so make callers crash. | 
| Almaz Mingaleev | a52a0da | 2022-02-28 16:55:50 +0000 | [diff] [blame] | 315 | "-DTZDEFAULT=NULL", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 316 | // Where we store our tzdata. | 
| Colin Cross | 7b29495 | 2016-09-29 14:08:13 -0700 | [diff] [blame] | 317 | "-DTZDIR=\"/system/usr/share/zoneinfo\"", | 
| Elliott Hughes | 0a610d0 | 2016-07-29 14:04:17 -0700 | [diff] [blame] | 318 | // Include `tzname`, `timezone`, and `daylight` globals. | 
|  | 319 | "-DHAVE_POSIX_DECLS=0", | 
| Almaz Mingaleev | 5411aff | 2022-02-11 12:27:12 +0000 | [diff] [blame] | 320 | "-DUSG_COMPAT=2", | 
|  | 321 | "-DHAVE_TZNAME=2", | 
|  | 322 | // stdbool.h is available | 
|  | 323 | "-DHAVE_STDBOOL_H", | 
| Colin Cross | a35d23d | 2015-11-19 13:32:49 -0800 | [diff] [blame] | 324 | // Use the empty string (instead of "   ") as the timezone abbreviation | 
|  | 325 | // fallback. | 
| Colin Cross | 7b29495 | 2016-09-29 14:08:13 -0700 | [diff] [blame] | 326 | "-DWILDABBR=\"\"", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 327 | "-Dlint", | 
|  | 328 | ], | 
|  | 329 |  | 
| Elliott Hughes | 2bd4316 | 2023-06-15 13:17:08 -0700 | [diff] [blame] | 330 | local_include_dirs: [ | 
|  | 331 | "tzcode/", | 
|  | 332 | "upstream-freebsd/android/include", | 
|  | 333 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 334 | name: "libc_tzcode", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 335 | } | 
|  | 336 |  | 
|  | 337 | // ======================================================== | 
|  | 338 | // libc_dns.a - modified NetBSD DNS code | 
|  | 339 | // ======================================================== | 
|  | 340 |  | 
|  | 341 | cc_library_static { | 
|  | 342 |  | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 343 | defaults: ["libc_defaults"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 344 | srcs: [ | 
| Elliott Hughes | d0bbfa8 | 2021-04-08 11:58:51 -0700 | [diff] [blame] | 345 | "dns/**/*.c*", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 346 |  | 
|  | 347 | "upstream-netbsd/lib/libc/isc/ev_streams.c", | 
|  | 348 | "upstream-netbsd/lib/libc/isc/ev_timers.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 349 | ], | 
|  | 350 |  | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 351 | cflags: [ | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 352 | "-DANDROID_CHANGES", | 
|  | 353 | "-DINET6", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 354 | "-Wno-unused-parameter", | 
|  | 355 | "-include netbsd-compat.h", | 
| Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 356 | "-Wframe-larger-than=66000", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 357 | ], | 
|  | 358 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 359 | local_include_dirs: [ | 
|  | 360 | "dns/include", | 
|  | 361 | "private", | 
|  | 362 | "upstream-netbsd/lib/libc/include", | 
|  | 363 | "upstream-netbsd/android/include", | 
|  | 364 | ], | 
|  | 365 |  | 
|  | 366 | name: "libc_dns", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 367 | } | 
|  | 368 |  | 
|  | 369 | // ======================================================== | 
|  | 370 | // libc_freebsd.a - upstream FreeBSD C library code | 
|  | 371 | // ======================================================== | 
|  | 372 | // | 
|  | 373 | // These files are built with the freebsd-compat.h header file | 
|  | 374 | // automatically included. | 
|  | 375 |  | 
|  | 376 | cc_library_static { | 
| Elliott Hughes | c204334 | 2023-07-20 20:24:09 +0000 | [diff] [blame] | 377 | name: "libc_freebsd_ldexp", | 
|  | 378 | defaults: ["libc_defaults"], | 
|  | 379 | cflags: ["-Dscalbn=ldexp"], | 
|  | 380 | srcs: [":libc_ldexp_srcs"], | 
|  | 381 | } | 
|  | 382 |  | 
|  | 383 | cc_library_static { | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 384 | defaults: ["libc_defaults"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 385 | srcs: [ | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 386 | "upstream-freebsd/lib/libc/stdlib/getopt_long.c", | 
| Elliott Hughes | 5702c6f | 2017-08-31 17:27:05 -0700 | [diff] [blame] | 387 | "upstream-freebsd/lib/libc/stdlib/hcreate.c", | 
|  | 388 | "upstream-freebsd/lib/libc/stdlib/hcreate_r.c", | 
|  | 389 | "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c", | 
|  | 390 | "upstream-freebsd/lib/libc/stdlib/hsearch_r.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 391 | "upstream-freebsd/lib/libc/stdlib/qsort.c", | 
| Elliott Hughes | 5bae572 | 2024-07-30 12:47:33 -0400 | [diff] [blame] | 392 | "upstream-freebsd/lib/libc/stdlib/qsort_r.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 393 | "upstream-freebsd/lib/libc/stdlib/quick_exit.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 394 | "upstream-freebsd/lib/libc/string/wcpcpy.c", | 
|  | 395 | "upstream-freebsd/lib/libc/string/wcpncpy.c", | 
|  | 396 | "upstream-freebsd/lib/libc/string/wcscasecmp.c", | 
| Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 397 | "upstream-freebsd/lib/libc/string/wcscat.c", | 
|  | 398 | "upstream-freebsd/lib/libc/string/wcschr.c", | 
|  | 399 | "upstream-freebsd/lib/libc/string/wcscmp.c", | 
|  | 400 | "upstream-freebsd/lib/libc/string/wcscpy.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 401 | "upstream-freebsd/lib/libc/string/wcscspn.c", | 
|  | 402 | "upstream-freebsd/lib/libc/string/wcsdup.c", | 
|  | 403 | "upstream-freebsd/lib/libc/string/wcslcat.c", | 
| Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 404 | "upstream-freebsd/lib/libc/string/wcslen.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 405 | "upstream-freebsd/lib/libc/string/wcsncasecmp.c", | 
|  | 406 | "upstream-freebsd/lib/libc/string/wcsncat.c", | 
|  | 407 | "upstream-freebsd/lib/libc/string/wcsncmp.c", | 
|  | 408 | "upstream-freebsd/lib/libc/string/wcsncpy.c", | 
|  | 409 | "upstream-freebsd/lib/libc/string/wcsnlen.c", | 
|  | 410 | "upstream-freebsd/lib/libc/string/wcspbrk.c", | 
| Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 411 | "upstream-freebsd/lib/libc/string/wcsrchr.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 412 | "upstream-freebsd/lib/libc/string/wcsspn.c", | 
| Elliott Hughes | 20f3399 | 2017-07-13 09:45:00 -0700 | [diff] [blame] | 413 | "upstream-freebsd/lib/libc/string/wcsstr.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 414 | "upstream-freebsd/lib/libc/string/wcstok.c", | 
|  | 415 | "upstream-freebsd/lib/libc/string/wmemchr.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 416 | "upstream-freebsd/lib/libc/string/wmemcmp.c", | 
| Elliott Hughes | 20f3399 | 2017-07-13 09:45:00 -0700 | [diff] [blame] | 417 | "upstream-freebsd/lib/libc/string/wmemcpy.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 418 | "upstream-freebsd/lib/libc/string/wmemmove.c", | 
| Dan Willemsen | 9c9aa74 | 2016-01-15 16:00:57 -0800 | [diff] [blame] | 419 | "upstream-freebsd/lib/libc/string/wmemset.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 420 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 421 |  | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 422 | cflags: [ | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 423 | "-Wno-sign-compare", | 
| Elliott Hughes | 5702c6f | 2017-08-31 17:27:05 -0700 | [diff] [blame] | 424 | "-Wno-unused-parameter", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 425 | "-include freebsd-compat.h", | 
|  | 426 | ], | 
|  | 427 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 428 | local_include_dirs: [ | 
|  | 429 | "upstream-freebsd/android/include", | 
|  | 430 | ], | 
|  | 431 |  | 
|  | 432 | name: "libc_freebsd", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 433 | } | 
|  | 434 |  | 
| Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 435 | cc_library_static { | 
|  | 436 | defaults: ["libc_defaults"], | 
|  | 437 | srcs: [ | 
| Elliott Hughes | f1c568d | 2017-09-26 17:09:07 -0700 | [diff] [blame] | 438 | "upstream-freebsd/lib/libc/gen/glob.c", | 
| Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 439 | ], | 
|  | 440 |  | 
|  | 441 | cflags: [ | 
|  | 442 | "-Wno-sign-compare", | 
|  | 443 | "-include freebsd-compat.h", | 
| Elliott Hughes | f1c568d | 2017-09-26 17:09:07 -0700 | [diff] [blame] | 444 | "-Wframe-larger-than=66000", | 
| Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 445 | ], | 
|  | 446 |  | 
|  | 447 | local_include_dirs: [ | 
|  | 448 | "upstream-freebsd/android/include", | 
|  | 449 | ], | 
|  | 450 |  | 
|  | 451 | name: "libc_freebsd_large_stack", | 
|  | 452 | } | 
|  | 453 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 454 | // ======================================================== | 
|  | 455 | // libc_netbsd.a - upstream NetBSD C library code | 
|  | 456 | // ======================================================== | 
|  | 457 | // | 
|  | 458 | // These files are built with the netbsd-compat.h header file | 
|  | 459 | // automatically included. | 
|  | 460 |  | 
|  | 461 | cc_library_static { | 
|  | 462 |  | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 463 | defaults: ["libc_defaults"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 464 | srcs: [ | 
|  | 465 | "upstream-netbsd/common/lib/libc/stdlib/random.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 466 | "upstream-netbsd/lib/libc/gen/nice.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 467 | "upstream-netbsd/lib/libc/gen/psignal.c", | 
|  | 468 | "upstream-netbsd/lib/libc/gen/utime.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 469 | "upstream-netbsd/lib/libc/inet/nsap_addr.c", | 
|  | 470 | "upstream-netbsd/lib/libc/regex/regcomp.c", | 
|  | 471 | "upstream-netbsd/lib/libc/regex/regerror.c", | 
|  | 472 | "upstream-netbsd/lib/libc/regex/regexec.c", | 
|  | 473 | "upstream-netbsd/lib/libc/regex/regfree.c", | 
|  | 474 | "upstream-netbsd/lib/libc/stdlib/bsearch.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 475 | "upstream-netbsd/lib/libc/stdlib/drand48.c", | 
|  | 476 | "upstream-netbsd/lib/libc/stdlib/erand48.c", | 
|  | 477 | "upstream-netbsd/lib/libc/stdlib/jrand48.c", | 
|  | 478 | "upstream-netbsd/lib/libc/stdlib/lcong48.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 479 | "upstream-netbsd/lib/libc/stdlib/lrand48.c", | 
|  | 480 | "upstream-netbsd/lib/libc/stdlib/mrand48.c", | 
|  | 481 | "upstream-netbsd/lib/libc/stdlib/nrand48.c", | 
|  | 482 | "upstream-netbsd/lib/libc/stdlib/_rand48.c", | 
|  | 483 | "upstream-netbsd/lib/libc/stdlib/rand_r.c", | 
|  | 484 | "upstream-netbsd/lib/libc/stdlib/reallocarr.c", | 
|  | 485 | "upstream-netbsd/lib/libc/stdlib/seed48.c", | 
|  | 486 | "upstream-netbsd/lib/libc/stdlib/srand48.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 487 | ], | 
|  | 488 | multilib: { | 
|  | 489 | lib32: { | 
|  | 490 | // LP32 cruft | 
|  | 491 | srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"], | 
|  | 492 | }, | 
|  | 493 | }, | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 494 | cflags: [ | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 495 | "-Wno-sign-compare", | 
| Dan Willemsen | 879cec2 | 2016-02-29 10:37:56 -0800 | [diff] [blame] | 496 | "-Wno-unused-parameter", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 497 | "-DPOSIX_MISTAKE", | 
|  | 498 | "-include netbsd-compat.h", | 
|  | 499 | ], | 
|  | 500 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 501 | local_include_dirs: [ | 
|  | 502 | "upstream-netbsd/android/include", | 
|  | 503 | "upstream-netbsd/lib/libc/include", | 
|  | 504 | ], | 
|  | 505 |  | 
|  | 506 | name: "libc_netbsd", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 507 | } | 
|  | 508 |  | 
|  | 509 | // ======================================================== | 
| Elliott Hughes | 968adf9 | 2024-02-08 13:15:53 -0800 | [diff] [blame] | 510 | // libc_openbsd.a - upstream OpenBSD C library code | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 511 | // ======================================================== | 
|  | 512 | // | 
|  | 513 | // These files are built with the openbsd-compat.h header file | 
|  | 514 | // automatically included. | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 515 | cc_library_static { | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 516 | defaults: ["libc_defaults"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 517 | srcs: [ | 
| Elliott Hughes | 968adf9 | 2024-02-08 13:15:53 -0800 | [diff] [blame] | 518 | "upstream-openbsd/lib/libc/crypt/arc4random.c", | 
|  | 519 | "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 520 | "upstream-openbsd/lib/libc/gen/alarm.c", | 
|  | 521 | "upstream-openbsd/lib/libc/gen/ctype_.c", | 
|  | 522 | "upstream-openbsd/lib/libc/gen/daemon.c", | 
|  | 523 | "upstream-openbsd/lib/libc/gen/err.c", | 
|  | 524 | "upstream-openbsd/lib/libc/gen/errx.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 525 | "upstream-openbsd/lib/libc/gen/fnmatch.c", | 
|  | 526 | "upstream-openbsd/lib/libc/gen/ftok.c", | 
|  | 527 | "upstream-openbsd/lib/libc/gen/getprogname.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 528 | "upstream-openbsd/lib/libc/gen/setprogname.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 529 | "upstream-openbsd/lib/libc/gen/verr.c", | 
|  | 530 | "upstream-openbsd/lib/libc/gen/verrx.c", | 
|  | 531 | "upstream-openbsd/lib/libc/gen/vwarn.c", | 
|  | 532 | "upstream-openbsd/lib/libc/gen/vwarnx.c", | 
|  | 533 | "upstream-openbsd/lib/libc/gen/warn.c", | 
|  | 534 | "upstream-openbsd/lib/libc/gen/warnx.c", | 
|  | 535 | "upstream-openbsd/lib/libc/locale/btowc.c", | 
|  | 536 | "upstream-openbsd/lib/libc/locale/mbrlen.c", | 
|  | 537 | "upstream-openbsd/lib/libc/locale/mbstowcs.c", | 
|  | 538 | "upstream-openbsd/lib/libc/locale/mbtowc.c", | 
|  | 539 | "upstream-openbsd/lib/libc/locale/wcscoll.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 540 | "upstream-openbsd/lib/libc/locale/wcstombs.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 541 | "upstream-openbsd/lib/libc/locale/wcsxfrm.c", | 
|  | 542 | "upstream-openbsd/lib/libc/locale/wctob.c", | 
|  | 543 | "upstream-openbsd/lib/libc/locale/wctomb.c", | 
| Elliott Hughes | 26fda77 | 2016-04-06 11:56:41 -0700 | [diff] [blame] | 544 | "upstream-openbsd/lib/libc/net/base64.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 545 | "upstream-openbsd/lib/libc/net/htonl.c", | 
|  | 546 | "upstream-openbsd/lib/libc/net/htons.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 547 | "upstream-openbsd/lib/libc/net/inet_lnaof.c", | 
|  | 548 | "upstream-openbsd/lib/libc/net/inet_makeaddr.c", | 
|  | 549 | "upstream-openbsd/lib/libc/net/inet_netof.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 550 | "upstream-openbsd/lib/libc/net/inet_ntoa.c", | 
|  | 551 | "upstream-openbsd/lib/libc/net/inet_ntop.c", | 
|  | 552 | "upstream-openbsd/lib/libc/net/inet_pton.c", | 
|  | 553 | "upstream-openbsd/lib/libc/net/ntohl.c", | 
|  | 554 | "upstream-openbsd/lib/libc/net/ntohs.c", | 
| Colin Cross | 8ce38af | 2016-01-19 12:50:20 -0800 | [diff] [blame] | 555 | "upstream-openbsd/lib/libc/net/res_random.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 556 | "upstream-openbsd/lib/libc/stdio/fgetln.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 557 | "upstream-openbsd/lib/libc/stdio/fgetwc.c", | 
|  | 558 | "upstream-openbsd/lib/libc/stdio/fgetws.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 559 | "upstream-openbsd/lib/libc/stdio/flags.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 560 | "upstream-openbsd/lib/libc/stdio/fputwc.c", | 
|  | 561 | "upstream-openbsd/lib/libc/stdio/fputws.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 562 | "upstream-openbsd/lib/libc/stdio/fvwrite.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 563 | "upstream-openbsd/lib/libc/stdio/fwide.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 564 | "upstream-openbsd/lib/libc/stdio/getdelim.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 565 | "upstream-openbsd/lib/libc/stdio/gets.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 566 | "upstream-openbsd/lib/libc/stdio/makebuf.c", | 
|  | 567 | "upstream-openbsd/lib/libc/stdio/mktemp.c", | 
|  | 568 | "upstream-openbsd/lib/libc/stdio/open_memstream.c", | 
|  | 569 | "upstream-openbsd/lib/libc/stdio/open_wmemstream.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 570 | "upstream-openbsd/lib/libc/stdio/rget.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 571 | "upstream-openbsd/lib/libc/stdio/setvbuf.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 572 | "upstream-openbsd/lib/libc/stdio/ungetc.c", | 
|  | 573 | "upstream-openbsd/lib/libc/stdio/ungetwc.c", | 
|  | 574 | "upstream-openbsd/lib/libc/stdio/vasprintf.c", | 
|  | 575 | "upstream-openbsd/lib/libc/stdio/vdprintf.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 576 | "upstream-openbsd/lib/libc/stdio/vsscanf.c", | 
|  | 577 | "upstream-openbsd/lib/libc/stdio/vswprintf.c", | 
|  | 578 | "upstream-openbsd/lib/libc/stdio/vswscanf.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 579 | "upstream-openbsd/lib/libc/stdio/wbuf.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 580 | "upstream-openbsd/lib/libc/stdio/wsetup.c", | 
|  | 581 | "upstream-openbsd/lib/libc/stdlib/abs.c", | 
| Elliott Hughes | 01809e1 | 2019-02-05 16:48:22 -0800 | [diff] [blame] | 582 | "upstream-openbsd/lib/libc/stdlib/div.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 583 | "upstream-openbsd/lib/libc/stdlib/getenv.c", | 
| Colin Cross | b839610 | 2016-04-07 13:24:50 -0700 | [diff] [blame] | 584 | "upstream-openbsd/lib/libc/stdlib/getsubopt.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 585 | "upstream-openbsd/lib/libc/stdlib/insque.c", | 
|  | 586 | "upstream-openbsd/lib/libc/stdlib/imaxabs.c", | 
|  | 587 | "upstream-openbsd/lib/libc/stdlib/imaxdiv.c", | 
|  | 588 | "upstream-openbsd/lib/libc/stdlib/labs.c", | 
| Elliott Hughes | 01809e1 | 2019-02-05 16:48:22 -0800 | [diff] [blame] | 589 | "upstream-openbsd/lib/libc/stdlib/ldiv.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 590 | "upstream-openbsd/lib/libc/stdlib/llabs.c", | 
| Elliott Hughes | 01809e1 | 2019-02-05 16:48:22 -0800 | [diff] [blame] | 591 | "upstream-openbsd/lib/libc/stdlib/lldiv.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 592 | "upstream-openbsd/lib/libc/stdlib/lsearch.c", | 
| Elliott Hughes | 26b0607 | 2020-07-31 11:00:10 -0700 | [diff] [blame] | 593 | "upstream-openbsd/lib/libc/stdlib/recallocarray.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 594 | "upstream-openbsd/lib/libc/stdlib/remque.c", | 
|  | 595 | "upstream-openbsd/lib/libc/stdlib/setenv.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 596 | "upstream-openbsd/lib/libc/stdlib/tfind.c", | 
|  | 597 | "upstream-openbsd/lib/libc/stdlib/tsearch.c", | 
| Elliott Hughes | fbac97a | 2019-02-04 16:46:24 -0800 | [diff] [blame] | 598 | "upstream-openbsd/lib/libc/string/memccpy.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 599 | "upstream-openbsd/lib/libc/string/strcasecmp.c", | 
| Elliott Hughes | fbac97a | 2019-02-04 16:46:24 -0800 | [diff] [blame] | 600 | "upstream-openbsd/lib/libc/string/strcasestr.c", | 
|  | 601 | "upstream-openbsd/lib/libc/string/strcoll.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 602 | "upstream-openbsd/lib/libc/string/strcspn.c", | 
|  | 603 | "upstream-openbsd/lib/libc/string/strdup.c", | 
|  | 604 | "upstream-openbsd/lib/libc/string/strndup.c", | 
|  | 605 | "upstream-openbsd/lib/libc/string/strpbrk.c", | 
|  | 606 | "upstream-openbsd/lib/libc/string/strsep.c", | 
|  | 607 | "upstream-openbsd/lib/libc/string/strspn.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 608 | "upstream-openbsd/lib/libc/string/strtok.c", | 
| Elliott Hughes | fbac97a | 2019-02-04 16:46:24 -0800 | [diff] [blame] | 609 | "upstream-openbsd/lib/libc/string/strxfrm.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 610 | "upstream-openbsd/lib/libc/string/wcslcpy.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 611 | "upstream-openbsd/lib/libc/string/wcswidth.c", | 
| Colin Cross | 69bcb8b | 2021-09-08 13:24:16 -0700 | [diff] [blame] | 612 |  | 
| Elliott Hughes | d4c6118 | 2024-08-16 17:31:24 -0400 | [diff] [blame] | 613 | // These files are originally from OpenBSD, | 
|  | 614 | // and benefit from being compiled with openbsd-compat.h. | 
|  | 615 | // TODO: clean them up instead. | 
| Colin Cross | 69bcb8b | 2021-09-08 13:24:16 -0700 | [diff] [blame] | 616 | "bionic/fts.c", | 
| Elliott Hughes | d4c6118 | 2024-08-16 17:31:24 -0400 | [diff] [blame] | 617 | "stdio/vfprintf.cpp", | 
|  | 618 | "stdio/vfwprintf.cpp", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 619 | ], | 
|  | 620 |  | 
| Elliott Hughes | 7d13666 | 2023-10-27 15:40:32 -0700 | [diff] [blame] | 621 | // Each architecture has optimized versions of some routines, | 
|  | 622 | // and only includes the portable C versions of ones it's missing. | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 623 | arch: { | 
|  | 624 | arm: { | 
| Elliott Hughes | 7d13666 | 2023-10-27 15:40:32 -0700 | [diff] [blame] | 625 | srcs: [ | 
|  | 626 | "upstream-openbsd/lib/libc/string/memchr.c", | 
|  | 627 | "upstream-openbsd/lib/libc/string/memrchr.c", | 
|  | 628 | "upstream-openbsd/lib/libc/string/stpncpy.c", | 
|  | 629 | "upstream-openbsd/lib/libc/string/strlcat.c", | 
|  | 630 | "upstream-openbsd/lib/libc/string/strlcpy.c", | 
|  | 631 | "upstream-openbsd/lib/libc/string/strncat.c", | 
|  | 632 | "upstream-openbsd/lib/libc/string/strncmp.c", | 
|  | 633 | "upstream-openbsd/lib/libc/string/strncpy.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 634 | ], | 
|  | 635 | }, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 636 | arm64: { | 
| Elliott Hughes | 7d13666 | 2023-10-27 15:40:32 -0700 | [diff] [blame] | 637 | srcs: [ | 
| Elliott Hughes | 7d13666 | 2023-10-27 15:40:32 -0700 | [diff] [blame] | 638 | "upstream-openbsd/lib/libc/string/strcat.c", | 
| Elliott Hughes | aefe999 | 2023-11-08 12:04:41 -0800 | [diff] [blame] | 639 | "upstream-openbsd/lib/libc/string/stpncpy.c", | 
| Elliott Hughes | 7d13666 | 2023-10-27 15:40:32 -0700 | [diff] [blame] | 640 | "upstream-openbsd/lib/libc/string/strlcat.c", | 
|  | 641 | "upstream-openbsd/lib/libc/string/strlcpy.c", | 
|  | 642 | "upstream-openbsd/lib/libc/string/strncat.c", | 
|  | 643 | "upstream-openbsd/lib/libc/string/strncpy.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 644 | ], | 
|  | 645 | }, | 
| Elliott Hughes | ebc19a9 | 2022-10-14 23:25:36 +0000 | [diff] [blame] | 646 | riscv64: { | 
|  | 647 | srcs: [ | 
| Elliott Hughes | 7d13666 | 2023-10-27 15:40:32 -0700 | [diff] [blame] | 648 | "upstream-openbsd/lib/libc/string/memrchr.c", | 
|  | 649 | "upstream-openbsd/lib/libc/string/stpncpy.c", | 
|  | 650 | "upstream-openbsd/lib/libc/string/strlcat.c", | 
|  | 651 | "upstream-openbsd/lib/libc/string/strlcpy.c", | 
| Elliott Hughes | ebc19a9 | 2022-10-14 23:25:36 +0000 | [diff] [blame] | 652 | ], | 
|  | 653 | }, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 654 | x86: { | 
| Elliott Hughes | aefe999 | 2023-11-08 12:04:41 -0800 | [diff] [blame] | 655 | srcs: [ | 
|  | 656 | // x86 has custom implementations of all of these. | 
|  | 657 | ], | 
| Elliott Hughes | 7d13666 | 2023-10-27 15:40:32 -0700 | [diff] [blame] | 658 | }, | 
|  | 659 | x86_64: { | 
|  | 660 | srcs: [ | 
| Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 661 | "upstream-openbsd/lib/libc/string/memchr.c", | 
| Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 662 | "upstream-openbsd/lib/libc/string/memrchr.c", | 
| Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 663 | "upstream-openbsd/lib/libc/string/strlcat.c", | 
|  | 664 | "upstream-openbsd/lib/libc/string/strlcpy.c", | 
| Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 665 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 666 | }, | 
|  | 667 | }, | 
|  | 668 |  | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 669 | cflags: [ | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 670 | "-Wno-sign-compare", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 671 | "-Wno-unused-parameter", | 
|  | 672 | "-include openbsd-compat.h", | 
|  | 673 | ], | 
|  | 674 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 675 | local_include_dirs: [ | 
|  | 676 | "private", | 
| Elliott Hughes | 968adf9 | 2024-02-08 13:15:53 -0800 | [diff] [blame] | 677 | "stdio", | 
| Elliott Hughes | d4c6118 | 2024-08-16 17:31:24 -0400 | [diff] [blame] | 678 | "upstream-openbsd/android/include/", | 
|  | 679 | "upstream-openbsd/lib/libc/gdtoa/", | 
|  | 680 | "upstream-openbsd/lib/libc/include/", | 
|  | 681 | "upstream-openbsd/lib/libc/stdio/", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 682 | ], | 
|  | 683 |  | 
|  | 684 | name: "libc_openbsd", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 685 | } | 
|  | 686 |  | 
| Elliott Hughes | 968adf9 | 2024-02-08 13:15:53 -0800 | [diff] [blame] | 687 | cc_library_static { | 
|  | 688 | name: "libc_openbsd_large_stack", | 
|  | 689 | defaults: ["libc_defaults"], | 
|  | 690 | srcs: [ | 
| Elliott Hughes | 968adf9 | 2024-02-08 13:15:53 -0800 | [diff] [blame] | 691 | "upstream-openbsd/lib/libc/string/memmem.c", | 
|  | 692 | "upstream-openbsd/lib/libc/string/strstr.c", | 
|  | 693 | ], | 
|  | 694 | cflags: [ | 
|  | 695 | "-include openbsd-compat.h", | 
|  | 696 | "-Wno-sign-compare", | 
|  | 697 | "-Wframe-larger-than=5000", | 
|  | 698 | ], | 
|  | 699 |  | 
|  | 700 | local_include_dirs: [ | 
| Elliott Hughes | 968adf9 | 2024-02-08 13:15:53 -0800 | [diff] [blame] | 701 | "upstream-openbsd/android/include/", | 
| Elliott Hughes | 968adf9 | 2024-02-08 13:15:53 -0800 | [diff] [blame] | 702 | ], | 
|  | 703 | } | 
|  | 704 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 705 | // ======================================================== | 
|  | 706 | // libc_gdtoa.a - upstream OpenBSD C library gdtoa code | 
|  | 707 | // ======================================================== | 
|  | 708 | // | 
|  | 709 | // These files are built with the openbsd-compat.h header file | 
|  | 710 | // automatically included. | 
|  | 711 |  | 
|  | 712 | cc_library_static { | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 713 | defaults: ["libc_defaults"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 714 | srcs: [ | 
|  | 715 | "upstream-openbsd/android/gdtoa_support.cpp", | 
|  | 716 | "upstream-openbsd/lib/libc/gdtoa/dmisc.c", | 
|  | 717 | "upstream-openbsd/lib/libc/gdtoa/dtoa.c", | 
|  | 718 | "upstream-openbsd/lib/libc/gdtoa/gdtoa.c", | 
|  | 719 | "upstream-openbsd/lib/libc/gdtoa/gethex.c", | 
|  | 720 | "upstream-openbsd/lib/libc/gdtoa/gmisc.c", | 
|  | 721 | "upstream-openbsd/lib/libc/gdtoa/hd_init.c", | 
|  | 722 | "upstream-openbsd/lib/libc/gdtoa/hdtoa.c", | 
|  | 723 | "upstream-openbsd/lib/libc/gdtoa/hexnan.c", | 
|  | 724 | "upstream-openbsd/lib/libc/gdtoa/ldtoa.c", | 
|  | 725 | "upstream-openbsd/lib/libc/gdtoa/misc.c", | 
|  | 726 | "upstream-openbsd/lib/libc/gdtoa/smisc.c", | 
|  | 727 | "upstream-openbsd/lib/libc/gdtoa/strtod.c", | 
|  | 728 | "upstream-openbsd/lib/libc/gdtoa/strtodg.c", | 
|  | 729 | "upstream-openbsd/lib/libc/gdtoa/strtof.c", | 
|  | 730 | "upstream-openbsd/lib/libc/gdtoa/strtord.c", | 
|  | 731 | "upstream-openbsd/lib/libc/gdtoa/sum.c", | 
|  | 732 | "upstream-openbsd/lib/libc/gdtoa/ulp.c", | 
|  | 733 | ], | 
|  | 734 | multilib: { | 
|  | 735 | lib64: { | 
| Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 736 | srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 737 | }, | 
|  | 738 | }, | 
|  | 739 |  | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 740 | cflags: [ | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 741 | "-Wno-sign-compare", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 742 | "-include openbsd-compat.h", | 
|  | 743 | ], | 
|  | 744 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 745 | local_include_dirs: [ | 
|  | 746 | "private", | 
|  | 747 | "upstream-openbsd/android/include", | 
|  | 748 | "upstream-openbsd/lib/libc/include", | 
|  | 749 | ], | 
|  | 750 |  | 
|  | 751 | name: "libc_gdtoa", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 752 | } | 
|  | 753 |  | 
|  | 754 | // ======================================================== | 
| Pierre-Clément Tosi | 467e58e | 2023-02-01 13:44:43 +0000 | [diff] [blame] | 755 | // libc_fortify.a - container for our FORTIFY | 
| George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 756 | // implementation details | 
|  | 757 | // ======================================================== | 
|  | 758 | cc_library_static { | 
|  | 759 | defaults: ["libc_defaults"], | 
| George Burgess IV | d34b0a9 | 2017-07-25 11:43:39 -0700 | [diff] [blame] | 760 | srcs: ["bionic/fortify.cpp"], | 
| George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 761 |  | 
|  | 762 | name: "libc_fortify", | 
|  | 763 |  | 
|  | 764 | // Disable FORTIFY for the compilation of these, so we don't end up having | 
|  | 765 | // FORTIFY silently call itself. | 
| Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 766 | cflags: [ | 
|  | 767 | "-U_FORTIFY_SOURCE", | 
|  | 768 | "-D__BIONIC_DECLARE_FORTIFY_HELPERS", | 
|  | 769 | ], | 
| George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 770 |  | 
|  | 771 | arch: { | 
|  | 772 | arm: { | 
| Haibo Huang | f1c8d1a | 2018-11-27 15:38:47 -0800 | [diff] [blame] | 773 | cflags: [ | 
| Haibo Huang | f1c8d1a | 2018-11-27 15:38:47 -0800 | [diff] [blame] | 774 | "-DRENAME___STRCAT_CHK", | 
|  | 775 | "-DRENAME___STRCPY_CHK", | 
|  | 776 | ], | 
| George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 777 | srcs: [ | 
|  | 778 | "arch-arm/generic/bionic/__memcpy_chk.S", | 
| Haibo Huang | f1c8d1a | 2018-11-27 15:38:47 -0800 | [diff] [blame] | 779 |  | 
|  | 780 | "arch-arm/cortex-a15/bionic/__strcat_chk.S", | 
|  | 781 | "arch-arm/cortex-a15/bionic/__strcpy_chk.S", | 
|  | 782 |  | 
|  | 783 | "arch-arm/cortex-a7/bionic/__strcat_chk.S", | 
|  | 784 | "arch-arm/cortex-a7/bionic/__strcpy_chk.S", | 
|  | 785 |  | 
|  | 786 | "arch-arm/cortex-a9/bionic/__strcat_chk.S", | 
|  | 787 | "arch-arm/cortex-a9/bionic/__strcpy_chk.S", | 
|  | 788 |  | 
|  | 789 | "arch-arm/krait/bionic/__strcat_chk.S", | 
|  | 790 | "arch-arm/krait/bionic/__strcpy_chk.S", | 
|  | 791 |  | 
|  | 792 | "arch-arm/cortex-a53/bionic/__strcat_chk.S", | 
|  | 793 | "arch-arm/cortex-a53/bionic/__strcpy_chk.S", | 
|  | 794 |  | 
| Haibo Huang | 01bfd89 | 2018-12-03 15:05:16 -0800 | [diff] [blame] | 795 | "arch-arm/cortex-a55/bionic/__strcat_chk.S", | 
|  | 796 | "arch-arm/cortex-a55/bionic/__strcpy_chk.S", | 
| George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 797 | ], | 
| George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 798 | }, | 
|  | 799 | arm64: { | 
|  | 800 | srcs: [ | 
| Elliott Hughes | 023e4e7 | 2022-11-17 19:27:02 +0000 | [diff] [blame] | 801 | "arch-arm64/string/__memcpy_chk.S", | 
|  | 802 | "arch-arm64/string/__memset_chk.S", | 
| George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 803 | ], | 
| George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 804 | }, | 
| caowencheng | ab457f9 | 2023-03-06 14:57:55 +0800 | [diff] [blame] | 805 | riscv64: { | 
|  | 806 | srcs: [ | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 807 | "arch-riscv64/string/__memset_chk.S", | 
|  | 808 | "arch-riscv64/string/__memcpy_chk.S", | 
| caowencheng | ab457f9 | 2023-03-06 14:57:55 +0800 | [diff] [blame] | 809 | ], | 
|  | 810 | }, | 
| George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 811 | }, | 
|  | 812 | } | 
|  | 813 |  | 
|  | 814 | // ======================================================== | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 815 | // libc_bionic.a - home-grown C library code | 
|  | 816 | // ======================================================== | 
|  | 817 |  | 
|  | 818 | cc_library_static { | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 819 | defaults: ["libc_defaults"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 820 | srcs: [ | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 821 | "bionic/NetdClientDispatch.cpp", | 
|  | 822 | "bionic/__bionic_get_shell_path.cpp", | 
|  | 823 | "bionic/__cmsg_nxthdr.cpp", | 
|  | 824 | "bionic/__cxa_thread_atexit_impl.cpp", | 
|  | 825 | "bionic/__errno.cpp", | 
|  | 826 | "bionic/__gnu_basename.cpp", | 
|  | 827 | "bionic/__libc_current_sigrtmax.cpp", | 
|  | 828 | "bionic/__libc_current_sigrtmin.cpp", | 
|  | 829 | "bionic/abort.cpp", | 
|  | 830 | "bionic/accept.cpp", | 
|  | 831 | "bionic/access.cpp", | 
| Florian Mayer | ca4749a | 2024-02-14 12:55:46 -0800 | [diff] [blame] | 832 | "bionic/android_crash_detail.cpp", | 
| Josh Gao | 10ec928 | 2017-04-03 15:13:29 -0700 | [diff] [blame] | 833 | "bionic/android_set_abort_message.cpp", | 
| Elliott Hughes | b094892 | 2024-01-26 00:28:12 +0000 | [diff] [blame] | 834 | "bionic/android_unsafe_frame_pointer_chase.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 835 | "bionic/arpa_inet.cpp", | 
|  | 836 | "bionic/assert.cpp", | 
| Elliott Hughes | b094892 | 2024-01-26 00:28:12 +0000 | [diff] [blame] | 837 | "bionic/atexit.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 838 | "bionic/atof.cpp", | 
|  | 839 | "bionic/bionic_allocator.cpp", | 
|  | 840 | "bionic/bionic_arc4random.cpp", | 
| Elliott Hughes | b094892 | 2024-01-26 00:28:12 +0000 | [diff] [blame] | 841 | "bionic/bionic_elf_tls.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 842 | "bionic/bionic_futex.cpp", | 
|  | 843 | "bionic/bionic_netlink.cpp", | 
|  | 844 | "bionic/bionic_systrace.cpp", | 
|  | 845 | "bionic/bionic_time_conversions.cpp", | 
|  | 846 | "bionic/brk.cpp", | 
|  | 847 | "bionic/c16rtomb.cpp", | 
|  | 848 | "bionic/c32rtomb.cpp", | 
|  | 849 | "bionic/chmod.cpp", | 
|  | 850 | "bionic/chown.cpp", | 
|  | 851 | "bionic/clearenv.cpp", | 
|  | 852 | "bionic/clock.cpp", | 
|  | 853 | "bionic/clock_getcpuclockid.cpp", | 
|  | 854 | "bionic/clock_nanosleep.cpp", | 
|  | 855 | "bionic/clone.cpp", | 
|  | 856 | "bionic/ctype.cpp", | 
|  | 857 | "bionic/dirent.cpp", | 
|  | 858 | "bionic/dup.cpp", | 
|  | 859 | "bionic/environ.cpp", | 
|  | 860 | "bionic/error.cpp", | 
|  | 861 | "bionic/eventfd.cpp", | 
|  | 862 | "bionic/exec.cpp", | 
|  | 863 | "bionic/execinfo.cpp", | 
| Elliott Hughes | 69bd8e9 | 2024-02-09 10:04:26 -0800 | [diff] [blame] | 864 | "bionic/exit.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 865 | "bionic/faccessat.cpp", | 
|  | 866 | "bionic/fchmod.cpp", | 
|  | 867 | "bionic/fchmodat.cpp", | 
|  | 868 | "bionic/fcntl.cpp", | 
|  | 869 | "bionic/fdsan.cpp", | 
|  | 870 | "bionic/fdtrack.cpp", | 
|  | 871 | "bionic/ffs.cpp", | 
|  | 872 | "bionic/fgetxattr.cpp", | 
|  | 873 | "bionic/flistxattr.cpp", | 
| Elliott Hughes | b094892 | 2024-01-26 00:28:12 +0000 | [diff] [blame] | 874 | "bionic/fork.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 875 | "bionic/fpclassify.cpp", | 
|  | 876 | "bionic/fsetxattr.cpp", | 
|  | 877 | "bionic/ftruncate.cpp", | 
|  | 878 | "bionic/ftw.cpp", | 
|  | 879 | "bionic/futimens.cpp", | 
|  | 880 | "bionic/getcwd.cpp", | 
|  | 881 | "bionic/getdomainname.cpp", | 
|  | 882 | "bionic/getentropy.cpp", | 
|  | 883 | "bionic/gethostname.cpp", | 
|  | 884 | "bionic/getloadavg.cpp", | 
|  | 885 | "bionic/getpagesize.cpp", | 
|  | 886 | "bionic/getpgrp.cpp", | 
|  | 887 | "bionic/getpid.cpp", | 
|  | 888 | "bionic/getpriority.cpp", | 
|  | 889 | "bionic/gettid.cpp", | 
|  | 890 | "bionic/get_device_api_level.cpp", | 
|  | 891 | "bionic/grp_pwd.cpp", | 
|  | 892 | "bionic/grp_pwd_file.cpp", | 
|  | 893 | "bionic/heap_zero_init.cpp", | 
|  | 894 | "bionic/iconv.cpp", | 
|  | 895 | "bionic/icu_wrappers.cpp", | 
|  | 896 | "bionic/ifaddrs.cpp", | 
|  | 897 | "bionic/inotify_init.cpp", | 
|  | 898 | "bionic/ioctl.cpp", | 
| Elliott Hughes | 17e4068 | 2024-02-13 16:32:29 -0800 | [diff] [blame] | 899 | "bionic/isatty.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 900 | "bionic/killpg.cpp", | 
|  | 901 | "bionic/langinfo.cpp", | 
| Elliott Hughes | 219e602 | 2024-08-27 19:12:08 +0000 | [diff] [blame] | 902 | "bionic/lchmod.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 903 | "bionic/lchown.cpp", | 
|  | 904 | "bionic/lfs64_support.cpp", | 
|  | 905 | "bionic/libc_init_common.cpp", | 
|  | 906 | "bionic/libgen.cpp", | 
|  | 907 | "bionic/link.cpp", | 
|  | 908 | "bionic/locale.cpp", | 
|  | 909 | "bionic/lockf.cpp", | 
|  | 910 | "bionic/lstat.cpp", | 
|  | 911 | "bionic/mblen.cpp", | 
|  | 912 | "bionic/mbrtoc16.cpp", | 
|  | 913 | "bionic/mbrtoc32.cpp", | 
|  | 914 | "bionic/mempcpy.cpp", | 
|  | 915 | "bionic/memset_explicit.cpp", | 
|  | 916 | "bionic/mkdir.cpp", | 
|  | 917 | "bionic/mkfifo.cpp", | 
|  | 918 | "bionic/mknod.cpp", | 
|  | 919 | "bionic/mntent.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 920 | "bionic/netdb.cpp", | 
| Elliott Hughes | 3ed6e72 | 2024-02-16 01:18:01 +0000 | [diff] [blame] | 921 | "bionic/net_if.cpp", | 
|  | 922 | "bionic/netinet_ether.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 923 | "bionic/netinet_in.cpp", | 
|  | 924 | "bionic/nl_types.cpp", | 
|  | 925 | "bionic/open.cpp", | 
|  | 926 | "bionic/pathconf.cpp", | 
|  | 927 | "bionic/pause.cpp", | 
|  | 928 | "bionic/pidfd.cpp", | 
|  | 929 | "bionic/pipe.cpp", | 
|  | 930 | "bionic/poll.cpp", | 
|  | 931 | "bionic/posix_fadvise.cpp", | 
|  | 932 | "bionic/posix_fallocate.cpp", | 
|  | 933 | "bionic/posix_madvise.cpp", | 
|  | 934 | "bionic/posix_timers.cpp", | 
|  | 935 | "bionic/preadv_pwritev.cpp", | 
| Elliott Hughes | b094892 | 2024-01-26 00:28:12 +0000 | [diff] [blame] | 936 | "bionic/pthread_atfork.cpp", | 
|  | 937 | "bionic/pthread_attr.cpp", | 
|  | 938 | "bionic/pthread_barrier.cpp", | 
|  | 939 | "bionic/pthread_cond.cpp", | 
|  | 940 | "bionic/pthread_create.cpp", | 
|  | 941 | "bionic/pthread_detach.cpp", | 
|  | 942 | "bionic/pthread_equal.cpp", | 
|  | 943 | "bionic/pthread_exit.cpp", | 
|  | 944 | "bionic/pthread_getcpuclockid.cpp", | 
|  | 945 | "bionic/pthread_getschedparam.cpp", | 
|  | 946 | "bionic/pthread_gettid_np.cpp", | 
|  | 947 | "bionic/pthread_internal.cpp", | 
|  | 948 | "bionic/pthread_join.cpp", | 
|  | 949 | "bionic/pthread_key.cpp", | 
|  | 950 | "bionic/pthread_kill.cpp", | 
|  | 951 | "bionic/pthread_mutex.cpp", | 
|  | 952 | "bionic/pthread_once.cpp", | 
|  | 953 | "bionic/pthread_rwlock.cpp", | 
|  | 954 | "bionic/pthread_sigqueue.cpp", | 
|  | 955 | "bionic/pthread_self.cpp", | 
|  | 956 | "bionic/pthread_setname_np.cpp", | 
|  | 957 | "bionic/pthread_setschedparam.cpp", | 
|  | 958 | "bionic/pthread_spinlock.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 959 | "bionic/ptrace.cpp", | 
|  | 960 | "bionic/pty.cpp", | 
|  | 961 | "bionic/raise.cpp", | 
|  | 962 | "bionic/rand.cpp", | 
|  | 963 | "bionic/readlink.cpp", | 
|  | 964 | "bionic/realpath.cpp", | 
|  | 965 | "bionic/reboot.cpp", | 
|  | 966 | "bionic/recv.cpp", | 
|  | 967 | "bionic/recvmsg.cpp", | 
|  | 968 | "bionic/rename.cpp", | 
|  | 969 | "bionic/rmdir.cpp", | 
|  | 970 | "bionic/scandir.cpp", | 
| Elliott Hughes | 17e4068 | 2024-02-13 16:32:29 -0800 | [diff] [blame] | 971 | "bionic/sched_cpualloc.cpp", | 
|  | 972 | "bionic/sched_cpucount.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 973 | "bionic/sched_getaffinity.cpp", | 
|  | 974 | "bionic/sched_getcpu.cpp", | 
|  | 975 | "bionic/semaphore.cpp", | 
|  | 976 | "bionic/send.cpp", | 
|  | 977 | "bionic/setegid.cpp", | 
|  | 978 | "bionic/seteuid.cpp", | 
| Elliott Hughes | b094892 | 2024-01-26 00:28:12 +0000 | [diff] [blame] | 979 | "bionic/setjmp_cookie.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 980 | "bionic/setpgrp.cpp", | 
|  | 981 | "bionic/sigaction.cpp", | 
|  | 982 | "bionic/signal.cpp", | 
|  | 983 | "bionic/sigprocmask.cpp", | 
|  | 984 | "bionic/sleep.cpp", | 
|  | 985 | "bionic/socketpair.cpp", | 
|  | 986 | "bionic/spawn.cpp", | 
|  | 987 | "bionic/stat.cpp", | 
|  | 988 | "bionic/stdlib_l.cpp", | 
|  | 989 | "bionic/strerror.cpp", | 
|  | 990 | "bionic/string_l.cpp", | 
|  | 991 | "bionic/strings_l.cpp", | 
|  | 992 | "bionic/strsignal.cpp", | 
|  | 993 | "bionic/strtol.cpp", | 
|  | 994 | "bionic/strtold.cpp", | 
|  | 995 | "bionic/swab.cpp", | 
|  | 996 | "bionic/symlink.cpp", | 
|  | 997 | "bionic/sync_file_range.cpp", | 
| Elliott Hughes | b094892 | 2024-01-26 00:28:12 +0000 | [diff] [blame] | 998 | "bionic/sysconf.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 999 | "bionic/sys_epoll.cpp", | 
|  | 1000 | "bionic/sys_msg.cpp", | 
|  | 1001 | "bionic/sys_sem.cpp", | 
|  | 1002 | "bionic/sys_shm.cpp", | 
|  | 1003 | "bionic/sys_signalfd.cpp", | 
|  | 1004 | "bionic/sys_statfs.cpp", | 
|  | 1005 | "bionic/sys_statvfs.cpp", | 
| Elliott Hughes | b094892 | 2024-01-26 00:28:12 +0000 | [diff] [blame] | 1006 | "bionic/sys_thread_properties.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 1007 | "bionic/sys_time.cpp", | 
|  | 1008 | "bionic/sysinfo.cpp", | 
|  | 1009 | "bionic/syslog.cpp", | 
| Elliott Hughes | 69bd8e9 | 2024-02-09 10:04:26 -0800 | [diff] [blame] | 1010 | "bionic/sysprop_helpers.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 1011 | "bionic/system.cpp", | 
|  | 1012 | "bionic/system_property_api.cpp", | 
|  | 1013 | "bionic/system_property_set.cpp", | 
|  | 1014 | "bionic/tdestroy.cpp", | 
|  | 1015 | "bionic/termios.cpp", | 
|  | 1016 | "bionic/thread_private.cpp", | 
|  | 1017 | "bionic/threads.cpp", | 
|  | 1018 | "bionic/time.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 1019 | "bionic/tmpfile.cpp", | 
|  | 1020 | "bionic/umount.cpp", | 
|  | 1021 | "bionic/unlink.cpp", | 
|  | 1022 | "bionic/usleep.cpp", | 
|  | 1023 | "bionic/utmp.cpp", | 
| Elliott Hughes | b094892 | 2024-01-26 00:28:12 +0000 | [diff] [blame] | 1024 | "bionic/vdso.cpp", | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 1025 | "bionic/wait.cpp", | 
|  | 1026 | "bionic/wchar.cpp", | 
|  | 1027 | "bionic/wchar_l.cpp", | 
|  | 1028 | "bionic/wcstod.cpp", | 
|  | 1029 | "bionic/wctype.cpp", | 
|  | 1030 | "bionic/wcwidth.cpp", | 
|  | 1031 | "bionic/wmempcpy.cpp", | 
|  | 1032 |  | 
| Elliott Hughes | 69bd8e9 | 2024-02-09 10:04:26 -0800 | [diff] [blame] | 1033 | // Forked but not yet cleaned up/rewritten stdio code. | 
|  | 1034 | // TODO: finish cleanup. | 
|  | 1035 | "stdio/fmemopen.cpp", | 
|  | 1036 | "stdio/parsefloat.c", | 
|  | 1037 | "stdio/refill.c", | 
|  | 1038 | "stdio/stdio.cpp", | 
|  | 1039 | "stdio/stdio_ext.cpp", | 
|  | 1040 | "stdio/vfscanf.cpp", | 
|  | 1041 | "stdio/vfwscanf.cpp", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1042 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1043 |  | 
|  | 1044 | arch: { | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1045 | arm: { | 
| Elliott Hughes | 1b61d78 | 2019-06-04 10:38:34 -0700 | [diff] [blame] | 1046 | asflags: libc_common_flags + ["-mno-restrict-it"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1047 | srcs: [ | 
| Ryan Prichard | 45024fe | 2018-12-30 21:10:26 -0800 | [diff] [blame] | 1048 | "arch-arm/bionic/__aeabi_read_tp.S", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1049 | "arch-arm/bionic/__bionic_clone.S", | 
| Yi Kong | b410d0e | 2019-04-22 16:00:46 -0700 | [diff] [blame] | 1050 | "arch-arm/bionic/__restore.S", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1051 | "arch-arm/bionic/_exit_with_stack_teardown.S", | 
| Yi Kong | b410d0e | 2019-04-22 16:00:46 -0700 | [diff] [blame] | 1052 | "arch-arm/bionic/atomics_arm.c", | 
|  | 1053 | "arch-arm/bionic/bpabi.c", | 
| Yi Kong | 165b1cf | 2019-02-13 14:10:10 -0800 | [diff] [blame] | 1054 | "arch-arm/bionic/libcrt_compat.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1055 | "arch-arm/bionic/popcount_tab.c", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1056 | "arch-arm/bionic/setjmp.S", | 
|  | 1057 | "arch-arm/bionic/syscall.S", | 
|  | 1058 | "arch-arm/bionic/vfork.S", | 
| Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1059 |  | 
| Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1060 | "arch-arm/cortex-a7/bionic/memcpy.S", | 
| Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1061 | "arch-arm/cortex-a7/bionic/memset.S", | 
|  | 1062 |  | 
|  | 1063 | "arch-arm/cortex-a9/bionic/memcpy.S", | 
| Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1064 | "arch-arm/cortex-a9/bionic/memset.S", | 
|  | 1065 | "arch-arm/cortex-a9/bionic/stpcpy.S", | 
|  | 1066 | "arch-arm/cortex-a9/bionic/strcat.S", | 
| Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1067 | "arch-arm/cortex-a9/bionic/strcpy.S", | 
|  | 1068 | "arch-arm/cortex-a9/bionic/strlen.S", | 
|  | 1069 |  | 
| Elliott Hughes | aefe999 | 2023-11-08 12:04:41 -0800 | [diff] [blame] | 1070 | "arch-arm/cortex-a15/bionic/memcpy.S", | 
|  | 1071 | "arch-arm/cortex-a15/bionic/memmove.S", | 
|  | 1072 | "arch-arm/cortex-a15/bionic/memset.S", | 
|  | 1073 | "arch-arm/cortex-a15/bionic/stpcpy.S", | 
|  | 1074 | "arch-arm/cortex-a15/bionic/strcat.S", | 
|  | 1075 | "arch-arm/cortex-a15/bionic/strcmp.S", | 
|  | 1076 | "arch-arm/cortex-a15/bionic/strcpy.S", | 
|  | 1077 | "arch-arm/cortex-a15/bionic/strlen.S", | 
| Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1078 |  | 
|  | 1079 | "arch-arm/cortex-a53/bionic/memcpy.S", | 
| Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1080 |  | 
| Haibo Huang | 01bfd89 | 2018-12-03 15:05:16 -0800 | [diff] [blame] | 1081 | "arch-arm/cortex-a55/bionic/memcpy.S", | 
| Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1082 |  | 
| Elliott Hughes | aefe999 | 2023-11-08 12:04:41 -0800 | [diff] [blame] | 1083 | "arch-arm/generic/bionic/memcmp.S", | 
|  | 1084 | "arch-arm/generic/bionic/memmove.S", | 
|  | 1085 | "arch-arm/generic/bionic/memset.S", | 
|  | 1086 | "arch-arm/generic/bionic/stpcpy.c", | 
|  | 1087 | "arch-arm/generic/bionic/strcat.c", | 
|  | 1088 | "arch-arm/generic/bionic/strcmp.S", | 
|  | 1089 | "arch-arm/generic/bionic/strcpy.S", | 
|  | 1090 | "arch-arm/generic/bionic/strlen.c", | 
|  | 1091 |  | 
|  | 1092 | "arch-arm/krait/bionic/memcpy.S", | 
|  | 1093 | "arch-arm/krait/bionic/memset.S", | 
|  | 1094 |  | 
| Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1095 | "arch-arm/kryo/bionic/memcpy.S", | 
| Elliott Hughes | aefe999 | 2023-11-08 12:04:41 -0800 | [diff] [blame] | 1096 |  | 
|  | 1097 | "bionic/strchr.cpp", | 
|  | 1098 | "bionic/strchrnul.cpp", | 
|  | 1099 | "bionic/strnlen.cpp", | 
|  | 1100 | "bionic/strrchr.cpp", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1101 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1102 | }, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1103 | arm64: { | 
|  | 1104 | srcs: [ | 
| Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 1105 | "arch-arm64/bionic/__bionic_clone.S", | 
|  | 1106 | "arch-arm64/bionic/_exit_with_stack_teardown.S", | 
|  | 1107 | "arch-arm64/bionic/setjmp.S", | 
|  | 1108 | "arch-arm64/bionic/syscall.S", | 
|  | 1109 | "arch-arm64/bionic/vfork.S", | 
| Vaisakh K V | 83e5584 | 2024-03-29 12:47:39 +0530 | [diff] [blame] | 1110 | "arch-arm64/oryon/memcpy-nt.S", | 
| Vaisakh K V | 54a6121 | 2024-03-29 13:32:45 +0530 | [diff] [blame] | 1111 | "arch-arm64/oryon/memset-nt.S", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1112 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1113 | }, | 
|  | 1114 |  | 
| Elliott Hughes | ebc19a9 | 2022-10-14 23:25:36 +0000 | [diff] [blame] | 1115 | riscv64: { | 
|  | 1116 | srcs: [ | 
|  | 1117 | "arch-riscv64/bionic/__bionic_clone.S", | 
|  | 1118 | "arch-riscv64/bionic/_exit_with_stack_teardown.S", | 
| Elliott Hughes | e1905ed | 2022-10-17 23:23:36 +0000 | [diff] [blame] | 1119 | "arch-riscv64/bionic/setjmp.S", | 
| Elliott Hughes | ebc19a9 | 2022-10-14 23:25:36 +0000 | [diff] [blame] | 1120 | "arch-riscv64/bionic/syscall.S", | 
|  | 1121 | "arch-riscv64/bionic/vfork.S", | 
| Yun Hsiang | 40a82d0 | 2023-05-26 10:10:40 +0800 | [diff] [blame] | 1122 |  | 
| Elliott Hughes | aefe999 | 2023-11-08 12:04:41 -0800 | [diff] [blame] | 1123 | "arch-riscv64/string/memchr_v.S", | 
|  | 1124 | "arch-riscv64/string/memcmp_v.S", | 
|  | 1125 | "arch-riscv64/string/memcpy_v.S", | 
|  | 1126 | "arch-riscv64/string/memmove_v.S", | 
|  | 1127 | "arch-riscv64/string/memset_v.S", | 
|  | 1128 | "arch-riscv64/string/stpcpy_v.S", | 
|  | 1129 | "arch-riscv64/string/strcat_v.S", | 
|  | 1130 | "arch-riscv64/string/strchr_v.S", | 
|  | 1131 | "arch-riscv64/string/strcmp_v.S", | 
|  | 1132 | "arch-riscv64/string/strcpy_v.S", | 
|  | 1133 | "arch-riscv64/string/strlen_v.S", | 
|  | 1134 | "arch-riscv64/string/strncat_v.S", | 
|  | 1135 | "arch-riscv64/string/strncmp_v.S", | 
|  | 1136 | "arch-riscv64/string/strncpy_v.S", | 
|  | 1137 | "arch-riscv64/string/strnlen_v.S", | 
|  | 1138 |  | 
|  | 1139 | "arch-riscv64/string/memchr.c", | 
|  | 1140 | "arch-riscv64/string/memcmp.c", | 
|  | 1141 | "arch-riscv64/string/memcpy.c", | 
|  | 1142 | "arch-riscv64/string/memmove.c", | 
|  | 1143 | "arch-riscv64/string/memset.c", | 
|  | 1144 | "arch-riscv64/string/stpcpy.c", | 
|  | 1145 | "arch-riscv64/string/strcat.c", | 
|  | 1146 | "arch-riscv64/string/strchr.c", | 
|  | 1147 | "arch-riscv64/string/strcmp.c", | 
|  | 1148 | "arch-riscv64/string/strcpy.c", | 
|  | 1149 | "arch-riscv64/string/strlen.c", | 
|  | 1150 | "arch-riscv64/string/strncat.c", | 
|  | 1151 | "arch-riscv64/string/strncmp.c", | 
|  | 1152 | "arch-riscv64/string/strncpy.c", | 
|  | 1153 | "arch-riscv64/string/strnlen.c", | 
| Prashanth Swaminathan | a4d7102 | 2023-10-30 17:35:19 -0700 | [diff] [blame] | 1154 |  | 
| Elliott Hughes | 7d13666 | 2023-10-27 15:40:32 -0700 | [diff] [blame] | 1155 | "bionic/strchrnul.cpp", | 
|  | 1156 | "bionic/strrchr.cpp", | 
| Elliott Hughes | ebc19a9 | 2022-10-14 23:25:36 +0000 | [diff] [blame] | 1157 | ], | 
|  | 1158 | }, | 
|  | 1159 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1160 | x86: { | 
|  | 1161 | srcs: [ | 
| Elliott Hughes | 7d13666 | 2023-10-27 15:40:32 -0700 | [diff] [blame] | 1162 | "arch-x86/bionic/__bionic_clone.S", | 
|  | 1163 | "arch-x86/bionic/_exit_with_stack_teardown.S", | 
|  | 1164 | "arch-x86/bionic/libcrt_compat.c", | 
| Elliott Hughes | 7d13666 | 2023-10-27 15:40:32 -0700 | [diff] [blame] | 1165 | "arch-x86/bionic/setjmp.S", | 
|  | 1166 | "arch-x86/bionic/syscall.S", | 
|  | 1167 | "arch-x86/bionic/vfork.S", | 
|  | 1168 | "arch-x86/bionic/__x86.get_pc_thunk.S", | 
|  | 1169 |  | 
| Elliott Hughes | ed77714 | 2022-07-25 16:25:11 +0000 | [diff] [blame] | 1170 | "arch-x86/string/sse2-memchr-atom.S", | 
|  | 1171 | "arch-x86/string/sse2-memmove-slm.S", | 
|  | 1172 | "arch-x86/string/sse2-memrchr-atom.S", | 
| Elliott Hughes | ed77714 | 2022-07-25 16:25:11 +0000 | [diff] [blame] | 1173 | "arch-x86/string/sse2-memset-slm.S", | 
|  | 1174 | "arch-x86/string/sse2-stpcpy-slm.S", | 
|  | 1175 | "arch-x86/string/sse2-stpncpy-slm.S", | 
|  | 1176 | "arch-x86/string/sse2-strchr-atom.S", | 
|  | 1177 | "arch-x86/string/sse2-strcpy-slm.S", | 
|  | 1178 | "arch-x86/string/sse2-strlen-slm.S", | 
|  | 1179 | "arch-x86/string/sse2-strncpy-slm.S", | 
|  | 1180 | "arch-x86/string/sse2-strnlen-atom.S", | 
|  | 1181 | "arch-x86/string/sse2-strrchr-atom.S", | 
| Elliott Hughes | ed77714 | 2022-07-25 16:25:11 +0000 | [diff] [blame] | 1182 |  | 
|  | 1183 | "arch-x86/string/ssse3-memcmp-atom.S", | 
| Elliott Hughes | ed77714 | 2022-07-25 16:25:11 +0000 | [diff] [blame] | 1184 | "arch-x86/string/ssse3-strcat-atom.S", | 
|  | 1185 | "arch-x86/string/ssse3-strcmp-atom.S", | 
| Elliott Hughes | ed77714 | 2022-07-25 16:25:11 +0000 | [diff] [blame] | 1186 | "arch-x86/string/ssse3-strlcat-atom.S", | 
|  | 1187 | "arch-x86/string/ssse3-strlcpy-atom.S", | 
|  | 1188 | "arch-x86/string/ssse3-strncat-atom.S", | 
|  | 1189 | "arch-x86/string/ssse3-strncmp-atom.S", | 
| Elliott Hughes | ed77714 | 2022-07-25 16:25:11 +0000 | [diff] [blame] | 1190 |  | 
|  | 1191 | "arch-x86/string/sse4-memcmp-slm.S", | 
| Elliott Hughes | aefe999 | 2023-11-08 12:04:41 -0800 | [diff] [blame] | 1192 |  | 
|  | 1193 | "bionic/strchrnul.cpp", | 
| Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1194 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1195 | }, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1196 | x86_64: { | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1197 | srcs: [ | 
| Elliott Hughes | 7d13666 | 2023-10-27 15:40:32 -0700 | [diff] [blame] | 1198 | "arch-x86_64/bionic/__bionic_clone.S", | 
|  | 1199 | "arch-x86_64/bionic/_exit_with_stack_teardown.S", | 
|  | 1200 | "arch-x86_64/bionic/__restore_rt.S", | 
|  | 1201 | "arch-x86_64/bionic/setjmp.S", | 
|  | 1202 | "arch-x86_64/bionic/syscall.S", | 
|  | 1203 | "arch-x86_64/bionic/vfork.S", | 
|  | 1204 |  | 
| ahs | 919fb7f | 2022-06-10 07:11:14 +0530 | [diff] [blame] | 1205 | "arch-x86_64/string/avx2-memset-kbl.S", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1206 | "arch-x86_64/string/sse2-memmove-slm.S", | 
|  | 1207 | "arch-x86_64/string/sse2-memset-slm.S", | 
|  | 1208 | "arch-x86_64/string/sse2-stpcpy-slm.S", | 
|  | 1209 | "arch-x86_64/string/sse2-stpncpy-slm.S", | 
|  | 1210 | "arch-x86_64/string/sse2-strcat-slm.S", | 
|  | 1211 | "arch-x86_64/string/sse2-strcpy-slm.S", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1212 | "arch-x86_64/string/sse2-strlen-slm.S", | 
|  | 1213 | "arch-x86_64/string/sse2-strncat-slm.S", | 
|  | 1214 | "arch-x86_64/string/sse2-strncpy-slm.S", | 
|  | 1215 | "arch-x86_64/string/sse4-memcmp-slm.S", | 
|  | 1216 | "arch-x86_64/string/ssse3-strcmp-slm.S", | 
|  | 1217 | "arch-x86_64/string/ssse3-strncmp-slm.S", | 
| Elliott Hughes | aefe999 | 2023-11-08 12:04:41 -0800 | [diff] [blame] | 1218 |  | 
|  | 1219 | "bionic/strchr.cpp", | 
|  | 1220 | "bionic/strchrnul.cpp", | 
|  | 1221 | "bionic/strnlen.cpp", | 
|  | 1222 | "bionic/strrchr.cpp", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1223 | ], | 
|  | 1224 | }, | 
| Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1225 | }, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1226 |  | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 1227 | multilib: { | 
|  | 1228 | lib32: { | 
| Elliott Hughes | 69bd8e9 | 2024-02-09 10:04:26 -0800 | [diff] [blame] | 1229 | srcs: [ | 
|  | 1230 | // off64_t/time64_t support on LP32. | 
|  | 1231 | "bionic/legacy_32_bit_support.cpp", | 
|  | 1232 | "bionic/time64.c", | 
| Elliott Hughes | 69bd8e9 | 2024-02-09 10:04:26 -0800 | [diff] [blame] | 1233 | ], | 
| Elliott Hughes | 2e2b9bc | 2024-02-07 16:10:23 -0800 | [diff] [blame] | 1234 | }, | 
|  | 1235 | }, | 
|  | 1236 |  | 
|  | 1237 | local_include_dirs: ["stdio"], | 
|  | 1238 | generated_headers: ["generated_android_ids"], | 
|  | 1239 |  | 
|  | 1240 | whole_static_libs: [ | 
|  | 1241 | "libsystemproperties", | 
|  | 1242 | ], | 
|  | 1243 |  | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1244 | cppflags: ["-Wold-style-cast"], | 
| Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1245 | include_dirs: ["bionic/libstdc++/include"], | 
|  | 1246 | name: "libc_bionic", | 
| Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1247 | } | 
|  | 1248 |  | 
| Elliott Hughes | 3f6eee9 | 2016-12-13 23:47:25 +0000 | [diff] [blame] | 1249 | genrule { | 
|  | 1250 | name: "generated_android_ids", | 
| Colin Cross | 35bbed8 | 2017-01-17 18:16:07 -0800 | [diff] [blame] | 1251 | out: ["generated_android_ids.h"], | 
|  | 1252 | srcs: [":android_filesystem_config_header"], | 
| Cole Faust | b1a0a9d | 2023-11-28 17:51:16 -0800 | [diff] [blame] | 1253 | tools: ["fs_config_generator"], | 
|  | 1254 | cmd: "$(location fs_config_generator) aidarray $(in) > $(out)", | 
| Elliott Hughes | 3f6eee9 | 2016-12-13 23:47:25 +0000 | [diff] [blame] | 1255 | } | 
|  | 1256 |  | 
| Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1257 | // ======================================================== | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1258 | // libc_syscalls.a | 
|  | 1259 | // ======================================================== | 
|  | 1260 |  | 
| Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1261 | genrule { | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1262 | name: "syscalls-arm", | 
| Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1263 | out: ["syscalls-arm.S"], | 
|  | 1264 | srcs: ["SYSCALLS.TXT"], | 
| Elliott Hughes | 291f98a | 2022-06-30 23:35:11 +0000 | [diff] [blame] | 1265 | tools: ["gensyscalls"], | 
|  | 1266 | cmd: "$(location gensyscalls) arm $(in) > $(out)", | 
| Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1267 | } | 
|  | 1268 |  | 
|  | 1269 | genrule { | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1270 | name: "syscalls-arm64", | 
| Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1271 | out: ["syscalls-arm64.S"], | 
|  | 1272 | srcs: ["SYSCALLS.TXT"], | 
| Elliott Hughes | 291f98a | 2022-06-30 23:35:11 +0000 | [diff] [blame] | 1273 | tools: ["gensyscalls"], | 
|  | 1274 | cmd: "$(location gensyscalls) arm64 $(in) > $(out)", | 
| Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1275 | } | 
|  | 1276 |  | 
|  | 1277 | genrule { | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1278 | name: "syscalls-riscv64", | 
| Elliott Hughes | 704772b | 2022-10-10 17:06:43 +0000 | [diff] [blame] | 1279 | out: ["syscalls-riscv64.S"], | 
|  | 1280 | srcs: ["SYSCALLS.TXT"], | 
|  | 1281 | tools: ["gensyscalls"], | 
|  | 1282 | cmd: "$(location gensyscalls) riscv64 $(in) > $(out)", | 
|  | 1283 | } | 
|  | 1284 |  | 
|  | 1285 | genrule { | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1286 | name: "syscalls-x86", | 
| Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1287 | out: ["syscalls-x86.S"], | 
|  | 1288 | srcs: ["SYSCALLS.TXT"], | 
| Elliott Hughes | 291f98a | 2022-06-30 23:35:11 +0000 | [diff] [blame] | 1289 | tools: ["gensyscalls"], | 
|  | 1290 | cmd: "$(location gensyscalls) x86 $(in) > $(out)", | 
| Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1291 | } | 
|  | 1292 |  | 
|  | 1293 | genrule { | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1294 | name: "syscalls-x86_64", | 
| Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1295 | out: ["syscalls-x86_64.S"], | 
|  | 1296 | srcs: ["SYSCALLS.TXT"], | 
| Elliott Hughes | 291f98a | 2022-06-30 23:35:11 +0000 | [diff] [blame] | 1297 | tools: ["gensyscalls"], | 
|  | 1298 | cmd: "$(location gensyscalls) x86_64 $(in) > $(out)", | 
| Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1299 | } | 
|  | 1300 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1301 | cc_library_static { | 
| Colin Cross | 27c43c5 | 2016-04-07 13:27:24 -0700 | [diff] [blame] | 1302 | defaults: ["libc_defaults"], | 
| Josh Gao | 0e0e370 | 2017-10-12 13:34:42 -0700 | [diff] [blame] | 1303 | srcs: ["bionic/__set_errno.cpp"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1304 | arch: { | 
|  | 1305 | arm: { | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1306 | srcs: [":syscalls-arm"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1307 | }, | 
|  | 1308 | arm64: { | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1309 | srcs: [":syscalls-arm64"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1310 | }, | 
| Elliott Hughes | 704772b | 2022-10-10 17:06:43 +0000 | [diff] [blame] | 1311 | riscv64: { | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1312 | srcs: [":syscalls-riscv64"], | 
| Elliott Hughes | 704772b | 2022-10-10 17:06:43 +0000 | [diff] [blame] | 1313 | }, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1314 | x86: { | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1315 | srcs: [":syscalls-x86"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1316 | }, | 
|  | 1317 | x86_64: { | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1318 | srcs: [":syscalls-x86_64"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1319 | }, | 
|  | 1320 | }, | 
|  | 1321 | name: "libc_syscalls", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1322 | } | 
|  | 1323 |  | 
|  | 1324 | // ======================================================== | 
|  | 1325 | // libc_aeabi.a | 
|  | 1326 | // This is an LP32 ARM-only library that needs to be built with -fno-builtin | 
|  | 1327 | // to avoid infinite recursion. For the other architectures we just build an | 
|  | 1328 | // empty library to keep this makefile simple. | 
|  | 1329 | // ======================================================== | 
|  | 1330 |  | 
|  | 1331 | cc_library_static { | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1332 | defaults: ["libc_defaults"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1333 | arch: { | 
|  | 1334 | arm: { | 
|  | 1335 | srcs: ["arch-arm/bionic/__aeabi.c"], | 
|  | 1336 | }, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1337 | }, | 
|  | 1338 | name: "libc_aeabi", | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1339 | cflags: ["-fno-builtin"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1340 | } | 
|  | 1341 |  | 
|  | 1342 | // ======================================================== | 
| Elliott Hughes | 69bd8e9 | 2024-02-09 10:04:26 -0800 | [diff] [blame] | 1343 | // libc_common.a --- everything shared by libc.a and libc.so | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1344 | // ======================================================== | 
| Elliott Hughes | b094892 | 2024-01-26 00:28:12 +0000 | [diff] [blame] | 1345 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1346 | cc_library_static { | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1347 | defaults: ["libc_defaults"], | 
| Elliott Hughes | b094892 | 2024-01-26 00:28:12 +0000 | [diff] [blame] | 1348 | name: "libc_common", | 
|  | 1349 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1350 | whole_static_libs: [ | 
| Peter Collingbourne | 337a5b3 | 2020-02-21 12:11:02 -0800 | [diff] [blame] | 1351 | "libarm-optimized-routines-string", | 
| Rupert Shuttleworth | 78f48a5 | 2021-03-16 06:39:19 +0000 | [diff] [blame] | 1352 | "libasync_safe", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1353 | "libc_bionic", | 
| Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1354 | "libc_bootstrap", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1355 | "libc_dns", | 
| George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 1356 | "libc_fortify", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1357 | "libc_freebsd", | 
| Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 1358 | "libc_freebsd_large_stack", | 
| Elliott Hughes | c204334 | 2023-07-20 20:24:09 +0000 | [diff] [blame] | 1359 | "libc_freebsd_ldexp", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1360 | "libc_gdtoa", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1361 | "libc_netbsd", | 
|  | 1362 | "libc_openbsd", | 
| Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 1363 | "libc_openbsd_large_stack", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1364 | "libc_syscalls", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1365 | "libc_tzcode", | 
| Elliott Hughes | 816fab9 | 2016-05-27 17:57:46 -0700 | [diff] [blame] | 1366 | "libstdc++", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1367 | ], | 
|  | 1368 |  | 
|  | 1369 | arch: { | 
|  | 1370 | arm: { | 
|  | 1371 | whole_static_libs: ["libc_aeabi"], | 
|  | 1372 | }, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1373 | }, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1374 | } | 
|  | 1375 |  | 
|  | 1376 | // ======================================================== | 
| Elliott Hughes | adc4171 | 2024-08-16 13:08:11 +0000 | [diff] [blame] | 1377 | // libc_static_dispatch.a/libc_dynamic_dispatch.a --- string/memory "ifuncs" | 
|  | 1378 | // (Actually ifuncs for libc.so, but a home-grown alternative for libc.a.) | 
| Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1379 | // ======================================================== | 
| Elliott Hughes | adc4171 | 2024-08-16 13:08:11 +0000 | [diff] [blame] | 1380 |  | 
|  | 1381 | cc_defaults { | 
|  | 1382 | name: "libc_dispatch_defaults", | 
| Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1383 | defaults: ["libc_defaults"], | 
| Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1384 | arch: { | 
| ahs | 919fb7f | 2022-06-10 07:11:14 +0530 | [diff] [blame] | 1385 | x86_64: { | 
|  | 1386 | srcs: ["arch-x86_64/dynamic_function_dispatch.cpp"], | 
|  | 1387 | }, | 
| Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1388 | x86: { | 
|  | 1389 | srcs: ["arch-x86/dynamic_function_dispatch.cpp"], | 
|  | 1390 | }, | 
| Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1391 | arm: { | 
| Elliott Hughes | 927fe99 | 2019-01-31 22:29:22 +0000 | [diff] [blame] | 1392 | srcs: ["arch-arm/dynamic_function_dispatch.cpp"], | 
| Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1393 | }, | 
| Peter Collingbourne | 900d07d | 2019-10-28 13:11:00 -0700 | [diff] [blame] | 1394 | arm64: { | 
|  | 1395 | srcs: ["arch-arm64/dynamic_function_dispatch.cpp"], | 
|  | 1396 | }, | 
| Elliott Hughes | aefe999 | 2023-11-08 12:04:41 -0800 | [diff] [blame] | 1397 | riscv64: { | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 1398 | srcs: ["arch-riscv64/dynamic_function_dispatch.cpp"], | 
| Elliott Hughes | aefe999 | 2023-11-08 12:04:41 -0800 | [diff] [blame] | 1399 | }, | 
| Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1400 | }, | 
| Elliott Hughes | adc4171 | 2024-08-16 13:08:11 +0000 | [diff] [blame] | 1401 | // Prevent the compiler from inserting calls to libc/taking the address of | 
|  | 1402 | // a jump table from within an ifunc (or, in the static case, code that | 
|  | 1403 | // can be executed arbitrarily early). | 
|  | 1404 | cflags: [ | 
|  | 1405 | "-ffreestanding", | 
|  | 1406 | "-fno-stack-protector", | 
|  | 1407 | "-fno-jump-tables", | 
|  | 1408 | ], | 
|  | 1409 | } | 
|  | 1410 |  | 
|  | 1411 | cc_library_static { | 
|  | 1412 | name: "libc_static_dispatch", | 
|  | 1413 | defaults: ["libc_dispatch_defaults"], | 
|  | 1414 | cflags: [ | 
|  | 1415 | "-DBIONIC_STATIC_DISPATCH", | 
|  | 1416 | ], | 
|  | 1417 | } | 
|  | 1418 |  | 
|  | 1419 | cc_library_static { | 
|  | 1420 | name: "libc_dynamic_dispatch", | 
|  | 1421 | defaults: ["libc_dispatch_defaults"], | 
|  | 1422 | cflags: [ | 
|  | 1423 | "-DBIONIC_DYNAMIC_DISPATCH", | 
|  | 1424 | ], | 
| Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1425 | } | 
|  | 1426 |  | 
|  | 1427 | // ======================================================== | 
|  | 1428 | // libc_common_static.a For static binaries. | 
|  | 1429 | // ======================================================== | 
|  | 1430 | cc_library_static { | 
|  | 1431 | defaults: ["libc_defaults"], | 
|  | 1432 | name: "libc_common_static", | 
| Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1433 |  | 
| Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1434 | whole_static_libs: [ | 
|  | 1435 | "libc_common", | 
| Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1436 | "libc_static_dispatch", | 
|  | 1437 | ], | 
|  | 1438 | } | 
|  | 1439 |  | 
|  | 1440 | // ======================================================== | 
|  | 1441 | // libc_common_shared.a For shared libraries. | 
|  | 1442 | // ======================================================== | 
|  | 1443 | cc_library_static { | 
|  | 1444 | defaults: ["libc_defaults"], | 
|  | 1445 | name: "libc_common_shared", | 
|  | 1446 |  | 
|  | 1447 | whole_static_libs: [ | 
|  | 1448 | "libc_common", | 
|  | 1449 | "libc_dynamic_dispatch", | 
| Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1450 | ], | 
|  | 1451 | } | 
|  | 1452 |  | 
| Ryan Prichard | 22a6a05 | 2019-10-10 23:59:30 -0700 | [diff] [blame] | 1453 | // Versions of dl_iterate_phdr and similar APIs used to lookup unwinding information in a static | 
|  | 1454 | // executable. | 
|  | 1455 | cc_library_static { | 
|  | 1456 | name: "libc_unwind_static", | 
|  | 1457 | defaults: ["libc_defaults"], | 
|  | 1458 | cflags: ["-DLIBC_STATIC"], | 
|  | 1459 |  | 
|  | 1460 | srcs: ["bionic/dl_iterate_phdr_static.cpp"], | 
|  | 1461 | arch: { | 
|  | 1462 | // arm32-specific dl_unwind_find_exidx and __gnu_Unwind_Find_exidx APIs | 
|  | 1463 | arm: { | 
|  | 1464 | srcs: ["arch-arm/bionic/exidx_static.c"], | 
|  | 1465 | }, | 
|  | 1466 | }, | 
|  | 1467 | } | 
|  | 1468 |  | 
| Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1469 | // ======================================================== | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1470 | // libc_nomalloc.a | 
|  | 1471 | // ======================================================== | 
|  | 1472 | // | 
| Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1473 | // This is a version of the static C library used by the dynamic linker that exclude malloc. It also | 
|  | 1474 | // excludes functions selected using ifunc's (e.g. for string.h). Link in either | 
|  | 1475 | // libc_static_dispatch or libc_dynamic_dispatch to provide those functions. | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1476 |  | 
|  | 1477 | cc_library_static { | 
| Dimitry Ivanov | fc0d480 | 2016-12-06 11:10:09 -0800 | [diff] [blame] | 1478 | name: "libc_nomalloc", | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1479 | defaults: ["libc_defaults"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1480 |  | 
| Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 1481 | whole_static_libs: [ | 
| Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1482 | "libc_common", | 
| Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 1483 | "libc_init_static", | 
| Ryan Prichard | 22a6a05 | 2019-10-10 23:59:30 -0700 | [diff] [blame] | 1484 | "libc_unwind_static", | 
| Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 1485 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1486 | } | 
|  | 1487 |  | 
| dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1488 | filegroup { | 
|  | 1489 | name: "libc_sources_shared", | 
|  | 1490 | srcs: [ | 
|  | 1491 | "arch-common/bionic/crtbegin_so.c", | 
|  | 1492 | "arch-common/bionic/crtbrand.S", | 
| Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1493 | "bionic/gwp_asan_wrappers.cpp", | 
| Peter Collingbourne | 1e110fb | 2020-01-09 10:48:22 -0800 | [diff] [blame] | 1494 | "bionic/heap_tagging.cpp", | 
| dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1495 | "bionic/icu.cpp", | 
|  | 1496 | "bionic/malloc_common.cpp", | 
| Christopher Ferris | e4cdbc4 | 2019-02-08 17:30:58 -0800 | [diff] [blame] | 1497 | "bionic/malloc_common_dynamic.cpp", | 
| Ryan Savitski | 175c886 | 2020-01-02 19:54:57 +0000 | [diff] [blame] | 1498 | "bionic/android_profiling_dynamic.cpp", | 
| Christopher Ferris | e4cdbc4 | 2019-02-08 17:30:58 -0800 | [diff] [blame] | 1499 | "bionic/malloc_heapprofd.cpp", | 
| Christopher Ferris | 1fc5ccf | 2019-02-15 18:06:15 -0800 | [diff] [blame] | 1500 | "bionic/malloc_limit.cpp", | 
| Peter Collingbourne | 570de33 | 2019-12-11 10:00:58 -0800 | [diff] [blame] | 1501 | "bionic/ndk_cruft.cpp", | 
|  | 1502 | "bionic/ndk_cruft_data.cpp", | 
| dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1503 | "bionic/NetdClient.cpp", | 
|  | 1504 | "arch-common/bionic/crtend_so.S", | 
|  | 1505 | ], | 
|  | 1506 | } | 
|  | 1507 |  | 
|  | 1508 | filegroup { | 
|  | 1509 | name: "libc_sources_static", | 
|  | 1510 | srcs: [ | 
| Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1511 | "bionic/gwp_asan_wrappers.cpp", | 
| Peter Collingbourne | 1e110fb | 2020-01-09 10:48:22 -0800 | [diff] [blame] | 1512 | "bionic/heap_tagging.cpp", | 
| Elliott Hughes | 72b0f3b | 2024-07-02 20:22:35 +0000 | [diff] [blame] | 1513 | "bionic/icu_static.cpp", | 
| dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1514 | "bionic/malloc_common.cpp", | 
| Christopher Ferris | 1fc5ccf | 2019-02-15 18:06:15 -0800 | [diff] [blame] | 1515 | "bionic/malloc_limit.cpp", | 
| dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1516 | ], | 
|  | 1517 | } | 
|  | 1518 |  | 
|  | 1519 | filegroup { | 
|  | 1520 | name: "libc_sources_shared_arm", | 
|  | 1521 | srcs: [ | 
|  | 1522 | "arch-arm/bionic/exidx_dynamic.c", | 
|  | 1523 | "arch-arm/bionic/atexit_legacy.c", | 
|  | 1524 | ], | 
|  | 1525 | } | 
|  | 1526 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1527 | // ======================================================== | 
|  | 1528 | // libc.a + libc.so | 
|  | 1529 | // ======================================================== | 
| Florian Mayer | c10d064 | 2023-03-22 16:12:49 -0700 | [diff] [blame] | 1530 | cc_defaults { | 
| Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 1531 | defaults: [ | 
|  | 1532 | "libc_defaults", | 
|  | 1533 | "libc_native_allocator_defaults", | 
| Elliott Hughes | 788075a | 2024-06-18 12:25:37 +0000 | [diff] [blame] | 1534 | "bug_24465209_workaround", | 
| Elliott Hughes | 89aada1 | 2024-07-01 21:59:04 +0000 | [diff] [blame] | 1535 | "keep_symbols", | 
| Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 1536 | ], | 
| Florian Mayer | c10d064 | 2023-03-22 16:12:49 -0700 | [diff] [blame] | 1537 | name: "libc_library_defaults", | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1538 | product_variables: { | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1539 | platform_sdk_version: { | 
|  | 1540 | asflags: ["-DPLATFORM_SDK_VERSION=%d"], | 
|  | 1541 | }, | 
|  | 1542 | }, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1543 | static: { | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 1544 | srcs: [":libc_sources_static"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1545 | cflags: ["-DLIBC_STATIC"], | 
| Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1546 | whole_static_libs: [ | 
| Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1547 | "gwp_asan", | 
| Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1548 | "libc_init_static", | 
|  | 1549 | "libc_common_static", | 
| Ryan Prichard | 22a6a05 | 2019-10-10 23:59:30 -0700 | [diff] [blame] | 1550 | "libc_unwind_static", | 
| Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1551 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1552 | }, | 
|  | 1553 | shared: { | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 1554 | srcs: [":libc_sources_shared"], | 
| Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1555 | whole_static_libs: [ | 
| Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1556 | "gwp_asan", | 
| Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1557 | "libc_init_dynamic", | 
|  | 1558 | "libc_common_shared", | 
| Ryan Prichard | cdf7175 | 2020-12-16 03:37:22 -0800 | [diff] [blame] | 1559 | "libunwind-exported", | 
| Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1560 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1561 | }, | 
|  | 1562 |  | 
| Neil Fuller | a7db90f | 2019-04-25 09:28:27 +0100 | [diff] [blame] | 1563 | required: [ | 
| MarkDacek | d88d7ea | 2022-06-28 20:14:58 +0000 | [diff] [blame] | 1564 | "tzdata_prebuilt", | 
|  | 1565 | "tz_version_prebuilt", // Version metadata for tzdata to help debugging. | 
| Neil Fuller | a7db90f | 2019-04-25 09:28:27 +0100 | [diff] [blame] | 1566 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1567 |  | 
| Colin Cross | 4ce94d2 | 2016-11-15 13:15:43 -0800 | [diff] [blame] | 1568 | // Do not pack libc.so relocations; see http://b/20645321 for details. | 
|  | 1569 | pack_relocations: false, | 
|  | 1570 |  | 
| dimitry | 06016f2 | 2018-01-05 11:39:28 +0100 | [diff] [blame] | 1571 | shared_libs: [ | 
|  | 1572 | "ld-android", | 
|  | 1573 | "libdl", | 
|  | 1574 | ], | 
| Jiyong Park | 3ff116a | 2019-04-02 23:04:52 +0900 | [diff] [blame] | 1575 | static_libs: [ | 
|  | 1576 | "libdl_android", | 
|  | 1577 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1578 |  | 
|  | 1579 | nocrt: true, | 
|  | 1580 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1581 | arch: { | 
|  | 1582 | arm: { | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1583 | version_script: ":libc.arm.map", | 
| Ryan Prichard | c22562c | 2021-01-27 17:27:31 -0800 | [diff] [blame] | 1584 | no_libcrt: true, | 
| Dan Willemsen | 9e6f98f | 2015-11-03 14:30:57 -0800 | [diff] [blame] | 1585 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1586 | shared: { | 
| dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1587 | srcs: [":libc_sources_shared_arm"], | 
| Dan Willemsen | 0c65708 | 2016-05-12 01:43:07 -0700 | [diff] [blame] | 1588 | // special for arm | 
|  | 1589 | cflags: ["-DCRT_LEGACY_WORKAROUND"], | 
| Elliott Hughes | 89aada1 | 2024-07-01 21:59:04 +0000 | [diff] [blame] | 1590 | // For backwards compatibility, some arm32 builtins are exported from libc.so. | 
| Colin Cross | 335e27b | 2022-02-10 11:37:28 -0800 | [diff] [blame] | 1591 | static_libs: ["libclang_rt.builtins-exported"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1592 | }, | 
| Christopher Ferris | 0c0f6fb | 2019-05-17 16:22:56 -0700 | [diff] [blame] | 1593 |  | 
| Elliott Hughes | 89aada1 | 2024-07-01 21:59:04 +0000 | [diff] [blame] | 1594 | ldflags: [ | 
|  | 1595 | // Since we preserve the debug_frame for libc, do not compress | 
|  | 1596 | // in this case to make unwinds as fast as possible. | 
|  | 1597 | "-Wl,--compress-debug-sections=none", | 
|  | 1598 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1599 | }, | 
| Dan Willemsen | 9e6f98f | 2015-11-03 14:30:57 -0800 | [diff] [blame] | 1600 | arm64: { | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1601 | version_script: ":libc.arm64.map", | 
| Dan Willemsen | 9e6f98f | 2015-11-03 14:30:57 -0800 | [diff] [blame] | 1602 | }, | 
| Elliott Hughes | 604ab0f | 2022-10-17 19:58:22 +0000 | [diff] [blame] | 1603 | riscv64: { | 
|  | 1604 | version_script: ":libc.riscv64.map", | 
| Elliott Hughes | 604ab0f | 2022-10-17 19:58:22 +0000 | [diff] [blame] | 1605 | }, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1606 | x86: { | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1607 | version_script: ":libc.x86.map", | 
| Ryan Prichard | c22562c | 2021-01-27 17:27:31 -0800 | [diff] [blame] | 1608 | no_libcrt: true, | 
|  | 1609 |  | 
|  | 1610 | shared: { | 
| Elliott Hughes | 89aada1 | 2024-07-01 21:59:04 +0000 | [diff] [blame] | 1611 | // For backwards compatibility, some x86 builtins are exported from libc.so. | 
| Colin Cross | 335e27b | 2022-02-10 11:37:28 -0800 | [diff] [blame] | 1612 | static_libs: ["libclang_rt.builtins-exported"], | 
| Ryan Prichard | c22562c | 2021-01-27 17:27:31 -0800 | [diff] [blame] | 1613 | }, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1614 | }, | 
|  | 1615 | x86_64: { | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1616 | version_script: ":libc.x86_64.map", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1617 | }, | 
|  | 1618 | }, | 
| Jiyong Park | c45fe9f | 2018-12-13 18:26:48 +0900 | [diff] [blame] | 1619 |  | 
| Jiyong Park | e87e0dc | 2019-10-02 17:09:33 +0900 | [diff] [blame] | 1620 | apex_available: [ | 
| Jiyong Park | e87e0dc | 2019-10-02 17:09:33 +0900 | [diff] [blame] | 1621 | "com.android.runtime", | 
|  | 1622 | ], | 
|  | 1623 |  | 
| Colin Cross | 7edd008 | 2021-10-28 13:20:35 -0700 | [diff] [blame] | 1624 | target: { | 
|  | 1625 | native_bridge: { | 
|  | 1626 | shared: { | 
|  | 1627 | installable: false, | 
|  | 1628 | }, | 
|  | 1629 | }, | 
|  | 1630 | }, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1631 | } | 
|  | 1632 |  | 
| Florian Mayer | c10d064 | 2023-03-22 16:12:49 -0700 | [diff] [blame] | 1633 | cc_library { | 
|  | 1634 | name: "libc", | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 1635 | defaults: [ | 
| Florian Mayer | c10d064 | 2023-03-22 16:12:49 -0700 | [diff] [blame] | 1636 | "libc_library_defaults", | 
|  | 1637 | ], | 
|  | 1638 | stubs: { | 
|  | 1639 | symbol_file: "libc.map.txt", | 
|  | 1640 | versions: [ | 
|  | 1641 | "29", | 
|  | 1642 | "R", | 
|  | 1643 | "current", | 
|  | 1644 | ], | 
|  | 1645 | }, | 
|  | 1646 | static_ndk_lib: true, | 
|  | 1647 | llndk: { | 
|  | 1648 | symbol_file: "libc.map.txt", | 
|  | 1649 | export_headers_as_system: true, | 
| Dan Albert | e9f02e0 | 2024-08-28 23:20:20 +0000 | [diff] [blame] | 1650 | export_llndk_headers: ["libc_headers"], | 
| Florian Mayer | c10d064 | 2023-03-22 16:12:49 -0700 | [diff] [blame] | 1651 | }, | 
|  | 1652 | } | 
|  | 1653 |  | 
|  | 1654 | cc_library { | 
|  | 1655 | name: "libc_hwasan", | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 1656 | defaults: [ | 
| Florian Mayer | c10d064 | 2023-03-22 16:12:49 -0700 | [diff] [blame] | 1657 | "libc_library_defaults", | 
|  | 1658 | ], | 
|  | 1659 | sanitize: { | 
|  | 1660 | hwaddress: true, | 
|  | 1661 | }, | 
|  | 1662 | enabled: false, | 
| Florian Mayer | ff116ed | 2023-04-14 17:38:53 -0700 | [diff] [blame] | 1663 | target: { | 
|  | 1664 | android_arm64: { | 
| Florian Mayer | c10d064 | 2023-03-22 16:12:49 -0700 | [diff] [blame] | 1665 | enabled: true, | 
|  | 1666 | }, | 
|  | 1667 | }, | 
|  | 1668 | stem: "libc", | 
|  | 1669 | relative_install_path: "hwasan", | 
|  | 1670 | // We don't really need the stubs, but this needs to stay to trigger the | 
|  | 1671 | // symlink logic in soong. | 
|  | 1672 | stubs: { | 
|  | 1673 | symbol_file: "libc.map.txt", | 
|  | 1674 | }, | 
|  | 1675 | native_bridge_supported: false, | 
|  | 1676 | // It is never correct to depend on this directly. This is only | 
|  | 1677 | // needed for the runtime apex, and in base_system.mk. | 
|  | 1678 | visibility: ["//bionic/apex"], | 
|  | 1679 | } | 
|  | 1680 |  | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1681 | genrule { | 
|  | 1682 | name: "libc.arm.map", | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1683 | out: ["libc.arm.map.txt"], | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1684 | srcs: ["libc.map.txt"], | 
| Elliott Hughes | 291f98a | 2022-06-30 23:35:11 +0000 | [diff] [blame] | 1685 | tools: ["generate-version-script"], | 
|  | 1686 | cmd: "$(location generate-version-script) arm $(in) $(out)", | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1687 | } | 
|  | 1688 |  | 
|  | 1689 | genrule { | 
|  | 1690 | name: "libc.arm64.map", | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1691 | out: ["libc.arm64.map.txt"], | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1692 | srcs: ["libc.map.txt"], | 
| Elliott Hughes | 291f98a | 2022-06-30 23:35:11 +0000 | [diff] [blame] | 1693 | tools: ["generate-version-script"], | 
|  | 1694 | cmd: "$(location generate-version-script) arm64 $(in) $(out)", | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1695 | } | 
|  | 1696 |  | 
|  | 1697 | genrule { | 
| Elliott Hughes | 604ab0f | 2022-10-17 19:58:22 +0000 | [diff] [blame] | 1698 | name: "libc.riscv64.map", | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1699 | out: ["libc.riscv64.map.txt"], | 
| Elliott Hughes | 604ab0f | 2022-10-17 19:58:22 +0000 | [diff] [blame] | 1700 | srcs: ["libc.map.txt"], | 
|  | 1701 | tools: ["generate-version-script"], | 
|  | 1702 | cmd: "$(location generate-version-script) riscv64 $(in) $(out)", | 
|  | 1703 | } | 
|  | 1704 |  | 
|  | 1705 | genrule { | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1706 | name: "libc.x86.map", | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1707 | out: ["libc.x86.map.txt"], | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1708 | srcs: ["libc.map.txt"], | 
| Elliott Hughes | 291f98a | 2022-06-30 23:35:11 +0000 | [diff] [blame] | 1709 | tools: ["generate-version-script"], | 
|  | 1710 | cmd: "$(location generate-version-script) x86 $(in) $(out)", | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1711 | } | 
|  | 1712 |  | 
|  | 1713 | genrule { | 
|  | 1714 | name: "libc.x86_64.map", | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1715 | out: ["libc.x86_64.map.txt"], | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1716 | srcs: ["libc.map.txt"], | 
| Elliott Hughes | 291f98a | 2022-06-30 23:35:11 +0000 | [diff] [blame] | 1717 | tools: ["generate-version-script"], | 
|  | 1718 | cmd: "$(location generate-version-script) x86_64 $(in) $(out)", | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1719 | } | 
|  | 1720 |  | 
| Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1721 | // Headers that only other parts of the platform can include. | 
|  | 1722 | cc_library_headers { | 
|  | 1723 | name: "bionic_libc_platform_headers", | 
| Martin Stjernholm | a276343 | 2020-04-23 16:47:19 +0100 | [diff] [blame] | 1724 | defaults: ["linux_bionic_supported"], | 
| Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1725 | visibility: [ | 
| Christopher Ferris | c5d3a43 | 2019-09-25 17:50:36 -0700 | [diff] [blame] | 1726 | "//art:__subpackages__", | 
| Josh Gao | 9727192 | 2019-11-06 13:15:00 -0800 | [diff] [blame] | 1727 | "//bionic:__subpackages__", | 
| Christopher Ferris | c5d3a43 | 2019-09-25 17:50:36 -0700 | [diff] [blame] | 1728 | "//frameworks:__subpackages__", | 
| Roman Kiryanov | 067f518 | 2020-05-07 14:58:30 -0700 | [diff] [blame] | 1729 | "//device/generic/goldfish-opengl:__subpackages__", | 
| Mitch Phillips | 3309b3d | 2020-03-25 15:05:48 -0700 | [diff] [blame] | 1730 | "//external/gwp_asan:__subpackages__", | 
| Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1731 | "//external/perfetto:__subpackages__", | 
| Christopher Ferris | c5d3a43 | 2019-09-25 17:50:36 -0700 | [diff] [blame] | 1732 | "//external/scudo:__subpackages__", | 
| Josh Gao | 5074e7d | 2019-12-13 13:55:53 -0800 | [diff] [blame] | 1733 | "//system/core/debuggerd:__subpackages__", | 
| Florian Mayer | f5d70ce | 2022-09-13 13:58:30 -0700 | [diff] [blame] | 1734 | "//system/core/init:__subpackages__", | 
| Steven Moreland | 0cdf132 | 2020-10-05 21:55:26 +0000 | [diff] [blame] | 1735 | "//system/core/libcutils:__subpackages__", | 
| Peter Collingbourne | 6a363f7 | 2020-01-13 10:39:33 -0800 | [diff] [blame] | 1736 | "//system/memory/libmemunreachable:__subpackages__", | 
| Baligh Uddin | db0c6de | 2020-10-15 04:49:00 +0000 | [diff] [blame] | 1737 | "//system/unwinding/libunwindstack:__subpackages__", | 
| Peter Collingbourne | 1541800 | 2020-05-12 16:02:50 -0700 | [diff] [blame] | 1738 | "//tools/security/sanitizer-status:__subpackages__", | 
| Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1739 | ], | 
| Peter Collingbourne | 6a363f7 | 2020-01-13 10:39:33 -0800 | [diff] [blame] | 1740 | vendor_available: true, | 
| Justin Yun | 869a0fa | 2020-11-11 15:16:11 +0900 | [diff] [blame] | 1741 | product_available: true, | 
| Yifan Hong | 5a39cee | 2020-01-21 16:43:56 -0800 | [diff] [blame] | 1742 | ramdisk_available: true, | 
| Yifan Hong | b04490d | 2020-10-21 18:36:36 -0700 | [diff] [blame] | 1743 | vendor_ramdisk_available: true, | 
| Christopher Ferris | c5d3a43 | 2019-09-25 17:50:36 -0700 | [diff] [blame] | 1744 | recovery_available: true, | 
|  | 1745 | native_bridge_supported: true, | 
| Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1746 | export_include_dirs: [ | 
|  | 1747 | "platform", | 
|  | 1748 | ], | 
| Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 1749 | system_shared_libs: [], | 
|  | 1750 | stl: "none", | 
| Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1751 | sdk_version: "current", | 
| Jiyong Park | 4ede160 | 2020-04-28 18:21:08 +0900 | [diff] [blame] | 1752 |  | 
| Steven Moreland | 0cdf132 | 2020-10-05 21:55:26 +0000 | [diff] [blame] | 1753 | min_sdk_version: "29", | 
| Jiyong Park | 4ede160 | 2020-04-28 18:21:08 +0900 | [diff] [blame] | 1754 | apex_available: [ | 
|  | 1755 | "//apex_available:platform", | 
| Steven Moreland | 0cdf132 | 2020-10-05 21:55:26 +0000 | [diff] [blame] | 1756 | "//apex_available:anyapex", | 
| Jiyong Park | 4ede160 | 2020-04-28 18:21:08 +0900 | [diff] [blame] | 1757 | ], | 
| Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1758 | } | 
|  | 1759 |  | 
| Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1760 | cc_library_headers { | 
| Dan Albert | 64a6efc | 2024-08-29 19:04:59 +0000 | [diff] [blame] | 1761 | name: "libc_uapi_headers", | 
| Colin Cross | 5d50dbb | 2021-06-29 11:35:29 -0700 | [diff] [blame] | 1762 | visibility: [ | 
|  | 1763 | "//external/musl", | 
| Alistair Delva | bad2272 | 2024-10-07 12:52:40 -0700 | [diff] [blame] | 1764 | "//external/rust/crates/v4l2r/android", | 
| Colin Cross | 5d50dbb | 2021-06-29 11:35:29 -0700 | [diff] [blame] | 1765 | ], | 
| Colin Cross | a0a4a6c | 2021-03-02 10:23:04 -0800 | [diff] [blame] | 1766 | llndk: { | 
|  | 1767 | llndk_headers: true, | 
|  | 1768 | }, | 
| Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1769 | host_supported: true, | 
|  | 1770 | vendor_available: true, | 
| Justin Yun | 869a0fa | 2020-11-11 15:16:11 +0900 | [diff] [blame] | 1771 | product_available: true, | 
| Yifan Hong | 5a39cee | 2020-01-21 16:43:56 -0800 | [diff] [blame] | 1772 | ramdisk_available: true, | 
| Yifan Hong | b04490d | 2020-10-21 18:36:36 -0700 | [diff] [blame] | 1773 | vendor_ramdisk_available: true, | 
| Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1774 | recovery_available: true, | 
| dimitry | 7f04880 | 2019-05-03 15:57:34 +0200 | [diff] [blame] | 1775 | native_bridge_supported: true, | 
| Jiyong Park | 922a5c7 | 2020-03-07 17:35:02 +0900 | [diff] [blame] | 1776 | apex_available: [ | 
|  | 1777 | "//apex_available:platform", | 
| Jiyong Park | ad9946c | 2020-03-30 18:36:07 +0900 | [diff] [blame] | 1778 | "//apex_available:anyapex", | 
|  | 1779 | ], | 
| Jooyung Han | 15c32a8 | 2020-04-16 18:26:45 +0900 | [diff] [blame] | 1780 | // used by most APEXes indirectly via libunwind_llvm | 
|  | 1781 | min_sdk_version: "apex_inherit", | 
| Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1782 |  | 
|  | 1783 | no_libcrt: true, | 
| Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1784 | stl: "none", | 
|  | 1785 | system_shared_libs: [], | 
|  | 1786 |  | 
| Peter Collingbourne | f2b1e03 | 2019-12-10 17:41:16 -0800 | [diff] [blame] | 1787 | // The build system generally requires that any dependencies of a target | 
|  | 1788 | // with an sdk_version must have a lower sdk_version. By setting sdk_version | 
|  | 1789 | // to 1 we let targets with an sdk_version that need to depend on the libc | 
|  | 1790 | // headers but cannot depend on libc itself due to circular dependencies | 
|  | 1791 | // (such as libunwind_llvm) depend on the headers. Setting sdk_version to 1 | 
|  | 1792 | // is correct because the headers can support any sdk_version. | 
|  | 1793 | sdk_version: "1", | 
|  | 1794 |  | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1795 | export_system_include_dirs: [ | 
| Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1796 | "kernel/uapi", | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1797 | "kernel/android/scsi", | 
| Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1798 | "kernel/android/uapi", | 
|  | 1799 | ], | 
|  | 1800 |  | 
|  | 1801 | arch: { | 
|  | 1802 | arm: { | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1803 | export_system_include_dirs: ["kernel/uapi/asm-arm"], | 
| Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1804 | }, | 
|  | 1805 | arm64: { | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1806 | export_system_include_dirs: ["kernel/uapi/asm-arm64"], | 
| Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1807 | }, | 
| Elliott Hughes | 48e5333 | 2022-10-07 20:39:25 +0000 | [diff] [blame] | 1808 | riscv64: { | 
|  | 1809 | export_system_include_dirs: ["kernel/uapi/asm-riscv"], | 
|  | 1810 | }, | 
| Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1811 | x86: { | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1812 | export_system_include_dirs: ["kernel/uapi/asm-x86"], | 
| Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1813 | }, | 
|  | 1814 | x86_64: { | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1815 | export_system_include_dirs: ["kernel/uapi/asm-x86"], | 
| Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1816 | }, | 
|  | 1817 | }, | 
|  | 1818 | } | 
|  | 1819 |  | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1820 | cc_library_headers { | 
|  | 1821 | name: "libc_headers", | 
|  | 1822 | host_supported: true, | 
|  | 1823 | native_bridge_supported: true, | 
|  | 1824 | vendor_available: true, | 
| Justin Yun | 869a0fa | 2020-11-11 15:16:11 +0900 | [diff] [blame] | 1825 | product_available: true, | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1826 | ramdisk_available: true, | 
| Yifan Hong | b04490d | 2020-10-21 18:36:36 -0700 | [diff] [blame] | 1827 | vendor_ramdisk_available: true, | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1828 | recovery_available: true, | 
|  | 1829 | sdk_version: "1", | 
|  | 1830 |  | 
|  | 1831 | apex_available: [ | 
|  | 1832 | "//apex_available:platform", | 
|  | 1833 | "//apex_available:anyapex", | 
|  | 1834 | ], | 
|  | 1835 | // used by most APEXes indirectly via libunwind_llvm | 
|  | 1836 | min_sdk_version: "apex_inherit", | 
|  | 1837 | visibility: [ | 
|  | 1838 | "//bionic:__subpackages__", // visible to bionic | 
|  | 1839 | // ... and only to these places (b/152668052) | 
|  | 1840 | "//external/arm-optimized-routines", | 
|  | 1841 | "//external/gwp_asan", | 
|  | 1842 | "//external/jemalloc_new", | 
|  | 1843 | "//external/libunwind_llvm", | 
| Nick Desaulniers | 942ae55 | 2024-02-12 10:26:19 -0800 | [diff] [blame] | 1844 | "//external/llvm-libc", | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1845 | "//external/scudo", | 
|  | 1846 | "//system/core/property_service/libpropertyinfoparser", | 
|  | 1847 | "//system/extras/toolchain-extras", | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1848 | ], | 
|  | 1849 |  | 
|  | 1850 | stl: "none", | 
|  | 1851 | no_libcrt: true, | 
|  | 1852 | system_shared_libs: [], | 
|  | 1853 |  | 
|  | 1854 | target: { | 
|  | 1855 | android: { | 
| Colin Cross | a0a4a6c | 2021-03-02 10:23:04 -0800 | [diff] [blame] | 1856 | export_system_include_dirs: ["include"], | 
| Dan Albert | 64a6efc | 2024-08-29 19:04:59 +0000 | [diff] [blame] | 1857 | header_libs: ["libc_uapi_headers"], | 
|  | 1858 | export_header_lib_headers: ["libc_uapi_headers"], | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1859 | }, | 
|  | 1860 | linux_bionic: { | 
| Colin Cross | a0a4a6c | 2021-03-02 10:23:04 -0800 | [diff] [blame] | 1861 | export_system_include_dirs: ["include"], | 
| Dan Albert | 64a6efc | 2024-08-29 19:04:59 +0000 | [diff] [blame] | 1862 | header_libs: ["libc_uapi_headers"], | 
|  | 1863 | export_header_lib_headers: ["libc_uapi_headers"], | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1864 | }, | 
| Rupert Shuttleworth | fd64868 | 2021-02-16 03:27:05 +0000 | [diff] [blame] | 1865 | }, | 
| Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1866 | } | 
|  | 1867 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1868 | // ======================================================== | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1869 | // libstdc++.so and libstdc++.a. | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1870 | // ======================================================== | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1871 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1872 | cc_library { | 
| Elliott Hughes | 788075a | 2024-06-18 12:25:37 +0000 | [diff] [blame] | 1873 | defaults: [ | 
|  | 1874 | "libc_defaults", | 
|  | 1875 | "bug_24465209_workaround", | 
|  | 1876 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1877 | include_dirs: ["bionic/libstdc++/include"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1878 | srcs: [ | 
|  | 1879 | "bionic/__cxa_guard.cpp", | 
|  | 1880 | "bionic/__cxa_pure_virtual.cpp", | 
|  | 1881 | "bionic/new.cpp", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1882 | ], | 
|  | 1883 | name: "libstdc++", | 
| Dan Albert | 40f15ec | 2017-10-27 11:21:20 -0700 | [diff] [blame] | 1884 | static_ndk_lib: true, | 
| Isaac Chen | 5e7c90b | 2017-09-20 14:44:42 +0800 | [diff] [blame] | 1885 | static_libs: ["libasync_safe"], | 
| Elliott Hughes | c204334 | 2023-07-20 20:24:09 +0000 | [diff] [blame] | 1886 | apex_available: [ | 
|  | 1887 | "//apex_available:platform", | 
|  | 1888 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1889 |  | 
| Dan Willemsen | 6b3be17 | 2018-12-03 13:57:20 -0800 | [diff] [blame] | 1890 | static: { | 
|  | 1891 | system_shared_libs: [], | 
|  | 1892 | }, | 
| Colin Cross | b5bfe0b | 2021-07-13 16:26:28 -0700 | [diff] [blame] | 1893 | target: { | 
|  | 1894 | bionic: { | 
|  | 1895 | shared: { | 
|  | 1896 | system_shared_libs: ["libc"], | 
|  | 1897 | }, | 
|  | 1898 | }, | 
| Dan Willemsen | 6b3be17 | 2018-12-03 13:57:20 -0800 | [diff] [blame] | 1899 | }, | 
|  | 1900 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1901 | arch: { | 
|  | 1902 | arm: { | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1903 | version_script: ":libstdc++.arm.map", | 
| Dimitry Ivanov | 6cc8d47 | 2016-07-28 13:52:17 -0700 | [diff] [blame] | 1904 | }, | 
|  | 1905 | arm64: { | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1906 | version_script: ":libstdc++.arm64.map", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1907 | }, | 
| Elliott Hughes | 604ab0f | 2022-10-17 19:58:22 +0000 | [diff] [blame] | 1908 | riscv64: { | 
|  | 1909 | version_script: ":libstdc++.riscv64.map", | 
|  | 1910 | }, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1911 | x86: { | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1912 | version_script: ":libstdc++.x86.map", | 
| Dimitry Ivanov | 6cc8d47 | 2016-07-28 13:52:17 -0700 | [diff] [blame] | 1913 | }, | 
|  | 1914 | x86_64: { | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1915 | version_script: ":libstdc++.x86_64.map", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1916 | }, | 
|  | 1917 | }, | 
|  | 1918 | } | 
|  | 1919 |  | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1920 | genrule { | 
|  | 1921 | name: "libstdc++.arm.map", | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1922 | out: ["libstdc++.arm.map.txt"], | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1923 | srcs: ["libstdc++.map.txt"], | 
| Elliott Hughes | 291f98a | 2022-06-30 23:35:11 +0000 | [diff] [blame] | 1924 | tools: ["generate-version-script"], | 
|  | 1925 | cmd: "$(location generate-version-script) arm $(in) $(out)", | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1926 | } | 
|  | 1927 |  | 
|  | 1928 | genrule { | 
|  | 1929 | name: "libstdc++.arm64.map", | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1930 | out: ["libstdc++.arm64.map.txt"], | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1931 | srcs: ["libstdc++.map.txt"], | 
| Elliott Hughes | 291f98a | 2022-06-30 23:35:11 +0000 | [diff] [blame] | 1932 | tools: ["generate-version-script"], | 
|  | 1933 | cmd: "$(location generate-version-script) arm64 $(in) $(out)", | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1934 | } | 
|  | 1935 |  | 
|  | 1936 | genrule { | 
| Elliott Hughes | 604ab0f | 2022-10-17 19:58:22 +0000 | [diff] [blame] | 1937 | name: "libstdc++.riscv64.map", | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1938 | out: ["libstdc++.riscv64.map.txt"], | 
| Elliott Hughes | 604ab0f | 2022-10-17 19:58:22 +0000 | [diff] [blame] | 1939 | srcs: ["libstdc++.map.txt"], | 
|  | 1940 | tools: ["generate-version-script"], | 
|  | 1941 | cmd: "$(location generate-version-script) riscv64 $(in) $(out)", | 
|  | 1942 | } | 
|  | 1943 |  | 
|  | 1944 | genrule { | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1945 | name: "libstdc++.x86.map", | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1946 | out: ["libstdc++.x86.map.txt"], | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1947 | srcs: ["libstdc++.map.txt"], | 
| Elliott Hughes | 291f98a | 2022-06-30 23:35:11 +0000 | [diff] [blame] | 1948 | tools: ["generate-version-script"], | 
|  | 1949 | cmd: "$(location generate-version-script) x86 $(in) $(out)", | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1950 | } | 
|  | 1951 |  | 
|  | 1952 | genrule { | 
|  | 1953 | name: "libstdc++.x86_64.map", | 
| Cole Faust | f5968d8 | 2023-04-11 15:20:19 -0700 | [diff] [blame] | 1954 | out: ["libstdc++.x86_64.map.txt"], | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1955 | srcs: ["libstdc++.map.txt"], | 
| Elliott Hughes | 291f98a | 2022-06-30 23:35:11 +0000 | [diff] [blame] | 1956 | tools: ["generate-version-script"], | 
|  | 1957 | cmd: "$(location generate-version-script) x86_64 $(in) $(out)", | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1958 | } | 
|  | 1959 |  | 
|  | 1960 | // ======================================================== | 
|  | 1961 | // crt object files. | 
|  | 1962 | // ======================================================== | 
|  | 1963 |  | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1964 | cc_defaults { | 
| Colin Cross | 10d9268 | 2021-06-22 13:25:46 -0700 | [diff] [blame] | 1965 | name: "crt_and_memtag_defaults", | 
| Dan Willemsen | 7ec52b1 | 2016-11-28 17:02:25 -0800 | [diff] [blame] | 1966 | defaults: ["linux_bionic_supported"], | 
| Dan Willemsen | 230a7a4 | 2017-04-07 14:09:05 -0700 | [diff] [blame] | 1967 | vendor_available: true, | 
| Justin Yun | 869a0fa | 2020-11-11 15:16:11 +0900 | [diff] [blame] | 1968 | product_available: true, | 
| Yifan Hong | 5a39cee | 2020-01-21 16:43:56 -0800 | [diff] [blame] | 1969 | ramdisk_available: true, | 
| Yifan Hong | b04490d | 2020-10-21 18:36:36 -0700 | [diff] [blame] | 1970 | vendor_ramdisk_available: true, | 
| Jiyong Park | 5603c6e | 2018-04-27 21:53:11 +0900 | [diff] [blame] | 1971 | recovery_available: true, | 
| dimitry | 7f04880 | 2019-05-03 15:57:34 +0200 | [diff] [blame] | 1972 | native_bridge_supported: true, | 
| Jiyong Park | 922a5c7 | 2020-03-07 17:35:02 +0900 | [diff] [blame] | 1973 | apex_available: [ | 
|  | 1974 | "//apex_available:platform", | 
|  | 1975 | "//apex_available:anyapex", | 
|  | 1976 | ], | 
| Dan Albert | dc503f6 | 2020-07-15 17:22:18 -0700 | [diff] [blame] | 1977 | // Generate NDK variants of the CRT objects for every supported API level. | 
|  | 1978 | min_sdk_version: "16", | 
|  | 1979 | stl: "none", | 
|  | 1980 | crt: true, | 
| Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 1981 | cflags: [ | 
|  | 1982 | "-Wno-gcc-compat", | 
|  | 1983 | "-Wall", | 
|  | 1984 | "-Werror", | 
|  | 1985 | ], | 
| Peter Collingbourne | 7eb851c | 2019-09-26 12:16:06 -0700 | [diff] [blame] | 1986 | sanitize: { | 
|  | 1987 | never: true, | 
|  | 1988 | }, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1989 | } | 
|  | 1990 |  | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1991 | cc_defaults { | 
| Colin Cross | 10d9268 | 2021-06-22 13:25:46 -0700 | [diff] [blame] | 1992 | name: "crt_defaults", | 
|  | 1993 | defaults: ["crt_and_memtag_defaults"], | 
| Colin Cross | 02f8137 | 2021-07-22 12:02:10 -0700 | [diff] [blame] | 1994 | system_shared_libs: [], | 
| Colin Cross | 10d9268 | 2021-06-22 13:25:46 -0700 | [diff] [blame] | 1995 | } | 
|  | 1996 |  | 
|  | 1997 | cc_defaults { | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1998 | name: "crt_so_defaults", | 
| Colin Cross | 7d7b368 | 2017-11-03 13:38:40 -0700 | [diff] [blame] | 1999 | defaults: ["crt_defaults"], | 
| Colin Cross | ab17944 | 2018-09-27 11:03:22 -0700 | [diff] [blame] | 2000 | stl: "none", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2001 | } | 
|  | 2002 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2003 | cc_object { | 
|  | 2004 | name: "crtbrand", | 
| Jingwen Chen | 7e13cf2 | 2021-02-23 00:43:01 -0500 | [diff] [blame] | 2005 | local_include_dirs: [ | 
| Jingwen Chen | 7e13cf2 | 2021-02-23 00:43:01 -0500 | [diff] [blame] | 2006 | "private", // crtbrand.S depends on private/bionic_asm_note.h | 
|  | 2007 | ], | 
| Elliott Hughes | 6a30b71 | 2024-03-13 23:41:32 +0000 | [diff] [blame] | 2008 | // crtbrand.S needs to know the platform SDK version. | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2009 | product_variables: { | 
|  | 2010 | platform_sdk_version: { | 
|  | 2011 | asflags: ["-DPLATFORM_SDK_VERSION=%d"], | 
|  | 2012 | }, | 
|  | 2013 | }, | 
|  | 2014 | srcs: ["arch-common/bionic/crtbrand.S"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2015 |  | 
| Colin Cross | 7d7b368 | 2017-11-03 13:38:40 -0700 | [diff] [blame] | 2016 | defaults: ["crt_so_defaults"], | 
| Dan Albert | eee46dc | 2023-04-04 23:27:52 +0000 | [diff] [blame] | 2017 | // crtbrand is an intermediate artifact, not a final CRT object. | 
|  | 2018 | exclude_from_ndk_sysroot: true, | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2019 | } | 
|  | 2020 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2021 | cc_object { | 
| Liz Kammer | e718dd7 | 2021-03-09 15:00:06 -0500 | [diff] [blame] | 2022 | name: "crtbegin_so", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2023 | local_include_dirs: ["include"], | 
|  | 2024 | srcs: ["arch-common/bionic/crtbegin_so.c"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2025 |  | 
| Colin Cross | 7d7b368 | 2017-11-03 13:38:40 -0700 | [diff] [blame] | 2026 | defaults: ["crt_so_defaults"], | 
| Colin Cross | 77d57bf | 2016-04-11 14:34:18 -0700 | [diff] [blame] | 2027 | objs: [ | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2028 | "crtbrand", | 
|  | 2029 | ], | 
|  | 2030 | } | 
|  | 2031 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2032 | cc_object { | 
|  | 2033 | name: "crtend_so", | 
| Liz Kammer | aab2ad7 | 2021-03-15 18:03:24 -0400 | [diff] [blame] | 2034 | local_include_dirs: [ | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2035 | "private", // crtend_so.S depends on private/bionic_asm_arm64.h | 
| Liz Kammer | aab2ad7 | 2021-03-15 18:03:24 -0400 | [diff] [blame] | 2036 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2037 | srcs: ["arch-common/bionic/crtend_so.S"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2038 |  | 
| Colin Cross | 7d7b368 | 2017-11-03 13:38:40 -0700 | [diff] [blame] | 2039 | defaults: ["crt_so_defaults"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2040 | } | 
|  | 2041 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2042 | cc_object { | 
| Liz Kammer | e718dd7 | 2021-03-09 15:00:06 -0500 | [diff] [blame] | 2043 | name: "crtbegin_static", | 
|  | 2044 |  | 
| Jingwen Chen | 0b1611e | 2021-02-18 23:22:03 -0500 | [diff] [blame] | 2045 | local_include_dirs: [ | 
|  | 2046 | "include", | 
|  | 2047 | "bionic", // crtbegin.c includes bionic/libc_init_common.h | 
|  | 2048 | ], | 
| Liz Kammer | e718dd7 | 2021-03-09 15:00:06 -0500 | [diff] [blame] | 2049 |  | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2050 | cflags: ["-DCRTBEGIN_STATIC"], | 
| Yabin Cui | 744cfd3 | 2023-08-24 13:20:23 -0700 | [diff] [blame] | 2051 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2052 | srcs: ["arch-common/bionic/crtbegin.c"], | 
| Colin Cross | 77d57bf | 2016-04-11 14:34:18 -0700 | [diff] [blame] | 2053 | objs: [ | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2054 | "crtbrand", | 
|  | 2055 | ], | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2056 | defaults: ["crt_defaults"], | 
| Jiyong Park | 268a600 | 2021-01-12 23:14:37 +0900 | [diff] [blame] | 2057 | // When using libc.a, we're using the latest library regardless of target API level. | 
|  | 2058 | min_sdk_version: "current", | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2059 | } | 
|  | 2060 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2061 | cc_object { | 
| Liz Kammer | e718dd7 | 2021-03-09 15:00:06 -0500 | [diff] [blame] | 2062 | name: "crtbegin_dynamic", | 
|  | 2063 |  | 
| Jingwen Chen | 0b1611e | 2021-02-18 23:22:03 -0500 | [diff] [blame] | 2064 | local_include_dirs: [ | 
|  | 2065 | "include", | 
|  | 2066 | "bionic", // crtbegin.c includes bionic/libc_init_common.h | 
|  | 2067 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2068 | srcs: ["arch-common/bionic/crtbegin.c"], | 
| Colin Cross | 77d57bf | 2016-04-11 14:34:18 -0700 | [diff] [blame] | 2069 | objs: [ | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2070 | "crtbrand", | 
|  | 2071 | ], | 
| Dan Willemsen | 7ccc50d | 2017-09-18 21:28:14 -0700 | [diff] [blame] | 2072 | target: { | 
|  | 2073 | linux_bionic: { | 
|  | 2074 | generated_sources: ["host_bionic_linker_asm"], | 
|  | 2075 | objs: [ | 
|  | 2076 | "linker_wrapper", | 
|  | 2077 | ], | 
|  | 2078 | }, | 
|  | 2079 | }, | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2080 | defaults: ["crt_defaults"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2081 | } | 
|  | 2082 |  | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2083 | cc_object { | 
|  | 2084 | // We rename crtend.o to crtend_android.o to avoid a | 
|  | 2085 | // name clash between gcc and bionic. | 
|  | 2086 | name: "crtend_android", | 
| Liz Kammer | aab2ad7 | 2021-03-15 18:03:24 -0400 | [diff] [blame] | 2087 | local_include_dirs: [ | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2088 | "private", // crtend.S depends on private/bionic_asm_arm64.h | 
| Liz Kammer | aab2ad7 | 2021-03-15 18:03:24 -0400 | [diff] [blame] | 2089 | ], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2090 | srcs: ["arch-common/bionic/crtend.S"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2091 |  | 
| Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2092 | defaults: ["crt_defaults"], | 
| Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2093 | } | 
| Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 2094 |  | 
| Kalesh Singh | 862a23d | 2024-01-09 13:13:50 -0800 | [diff] [blame] | 2095 | cc_object { | 
|  | 2096 | name: "crt_pad_segment", | 
|  | 2097 | local_include_dirs: [ | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2098 | "private", // crt_pad_segment.S depends on private/bionic_asm_note.h | 
| Kalesh Singh | 862a23d | 2024-01-09 13:13:50 -0800 | [diff] [blame] | 2099 | ], | 
|  | 2100 | srcs: ["arch-common/bionic/crt_pad_segment.S"], | 
|  | 2101 |  | 
|  | 2102 | defaults: ["crt_defaults"], | 
|  | 2103 | } | 
|  | 2104 |  | 
| Evgenii Stepanov | 8564b8d | 2020-12-15 13:55:32 -0800 | [diff] [blame] | 2105 | cc_library_static { | 
|  | 2106 | name: "note_memtag_heap_async", | 
|  | 2107 | arch: { | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2108 | arm64: { | 
|  | 2109 | srcs: ["arch-arm64/bionic/note_memtag_heap_async.S"], | 
|  | 2110 | }, | 
| Evgenii Stepanov | 8564b8d | 2020-12-15 13:55:32 -0800 | [diff] [blame] | 2111 | }, | 
| Mitch Phillips | 22c9075 | 2021-03-03 15:39:57 -0800 | [diff] [blame] | 2112 | sdk_version: "minimum", | 
| Evgenii Stepanov | 8564b8d | 2020-12-15 13:55:32 -0800 | [diff] [blame] | 2113 |  | 
| Colin Cross | 10d9268 | 2021-06-22 13:25:46 -0700 | [diff] [blame] | 2114 | defaults: ["crt_and_memtag_defaults"], | 
| Evgenii Stepanov | 8564b8d | 2020-12-15 13:55:32 -0800 | [diff] [blame] | 2115 | } | 
|  | 2116 |  | 
|  | 2117 | cc_library_static { | 
|  | 2118 | name: "note_memtag_heap_sync", | 
|  | 2119 | arch: { | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2120 | arm64: { | 
|  | 2121 | srcs: ["arch-arm64/bionic/note_memtag_heap_sync.S"], | 
|  | 2122 | }, | 
| Evgenii Stepanov | 8564b8d | 2020-12-15 13:55:32 -0800 | [diff] [blame] | 2123 | }, | 
| Mitch Phillips | 22c9075 | 2021-03-03 15:39:57 -0800 | [diff] [blame] | 2124 | sdk_version: "minimum", | 
| Evgenii Stepanov | 8564b8d | 2020-12-15 13:55:32 -0800 | [diff] [blame] | 2125 |  | 
| Colin Cross | 10d9268 | 2021-06-22 13:25:46 -0700 | [diff] [blame] | 2126 | defaults: ["crt_and_memtag_defaults"], | 
| Evgenii Stepanov | 8564b8d | 2020-12-15 13:55:32 -0800 | [diff] [blame] | 2127 | } | 
|  | 2128 |  | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 2129 | // ======================================================== | 
| Pierre-Clément Tosi | 74a1458 | 2022-12-09 18:49:29 +0000 | [diff] [blame] | 2130 | // libc dependencies for baremetal Rust projects. | 
|  | 2131 | // ======================================================== | 
|  | 2132 |  | 
| Pierre-Clément Tosi | 199a62e | 2022-12-09 19:00:44 +0000 | [diff] [blame] | 2133 | // This library contains the following unresolved symbols: | 
|  | 2134 | //     __errno | 
|  | 2135 | //     abort | 
|  | 2136 | //     async_safe_fatal_va_list | 
| Pierre-Clément Tosi | 3af5799 | 2023-01-03 17:57:42 +0000 | [diff] [blame] | 2137 | cc_library_static { | 
|  | 2138 | name: "librust_baremetal", | 
| Pierre-Clément Tosi | 9018e5f | 2024-10-02 15:57:00 +0100 | [diff] [blame] | 2139 | defaults: ["cc_baremetal_defaults"], | 
| Pierre-Clément Tosi | 74a1458 | 2022-12-09 18:49:29 +0000 | [diff] [blame] | 2140 | header_libs: ["libc_headers"], | 
|  | 2141 | include_dirs: [ | 
|  | 2142 | "bionic/libc/async_safe/include", | 
|  | 2143 | "bionic/libc/platform", | 
|  | 2144 | ], | 
|  | 2145 | cflags: [ | 
|  | 2146 | "-Wall", | 
|  | 2147 | "-Werror", | 
|  | 2148 | ], | 
| Pierre-Clément Tosi | 199a62e | 2022-12-09 19:00:44 +0000 | [diff] [blame] | 2149 | srcs: [ | 
|  | 2150 | "bionic/fortify.cpp", | 
| Pierre-Clément Tosi | 816176c | 2022-11-30 14:33:41 +0000 | [diff] [blame] | 2151 | "bionic/strtol.cpp", | 
| Pierre-Clément Tosi | 199a62e | 2022-12-09 19:00:44 +0000 | [diff] [blame] | 2152 | ], | 
|  | 2153 | arch: { | 
|  | 2154 | arm64: { | 
| Pierre-Clément Tosi | 199a62e | 2022-12-09 19:00:44 +0000 | [diff] [blame] | 2155 | srcs: [ | 
|  | 2156 | "arch-arm64/string/__memcpy_chk.S", | 
|  | 2157 | ], | 
|  | 2158 | }, | 
| caowencheng | 9a39eb3 | 2023-03-20 16:24:41 +0800 | [diff] [blame] | 2159 | riscv64: { | 
|  | 2160 | srcs: [ | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2161 | "arch-riscv64/string/__memcpy_chk.S", | 
| caowencheng | 9a39eb3 | 2023-03-20 16:24:41 +0800 | [diff] [blame] | 2162 | ], | 
|  | 2163 | }, | 
| Pierre-Clément Tosi | 199a62e | 2022-12-09 19:00:44 +0000 | [diff] [blame] | 2164 | }, | 
| Pierre-Clément Tosi | 74a1458 | 2022-12-09 18:49:29 +0000 | [diff] [blame] | 2165 | whole_static_libs: [ | 
|  | 2166 | "libarm-optimized-routines-mem", | 
| Pierre-Clément Tosi | eb46ac9 | 2023-02-01 13:44:57 +0000 | [diff] [blame] | 2167 | "libc_netbsd", | 
| Pierre-Clément Tosi | 74a1458 | 2022-12-09 18:49:29 +0000 | [diff] [blame] | 2168 | ], | 
| Pierre-Clément Tosi | 3af5799 | 2023-01-03 17:57:42 +0000 | [diff] [blame] | 2169 | system_shared_libs: [], | 
|  | 2170 | nocrt: true, | 
|  | 2171 | stl: "none", | 
| Pierre-Clément Tosi | 74a1458 | 2022-12-09 18:49:29 +0000 | [diff] [blame] | 2172 | visibility: [ | 
| Jiyong Park | 072ce53 | 2024-07-22 11:20:47 +0900 | [diff] [blame] | 2173 | "//packages/modules/Virtualization/libs/libvmbase", | 
| Pierre-Clément Tosi | 74a1458 | 2022-12-09 18:49:29 +0000 | [diff] [blame] | 2174 | ], | 
| Zijun | 427504a | 2024-08-15 23:16:27 +0000 | [diff] [blame] | 2175 |  | 
|  | 2176 | // b/358211032: This library gets linked into a rust rlib.  Disable LTO | 
|  | 2177 | // until cross-language lto is supported. | 
|  | 2178 | lto: { | 
|  | 2179 | never: true, | 
|  | 2180 | }, | 
| Pierre-Clément Tosi | 74a1458 | 2022-12-09 18:49:29 +0000 | [diff] [blame] | 2181 | } | 
|  | 2182 |  | 
|  | 2183 | // ======================================================== | 
| Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 2184 | // NDK headers. | 
|  | 2185 | // ======================================================== | 
|  | 2186 |  | 
| Dan Albert | cce5437 | 2024-08-22 18:24:30 +0000 | [diff] [blame] | 2187 | ndk_headers { | 
| Dan Albert | 22805ea | 2017-03-22 15:28:05 -0700 | [diff] [blame] | 2188 | name: "common_libc", | 
|  | 2189 | from: "include", | 
|  | 2190 | to: "", | 
| Dan Albert | cce5437 | 2024-08-22 18:24:30 +0000 | [diff] [blame] | 2191 | srcs: ["include/**/*.h"], | 
| Dan Albert | 22805ea | 2017-03-22 15:28:05 -0700 | [diff] [blame] | 2192 | license: "NOTICE", | 
| Dan Albert | cce5437 | 2024-08-22 18:24:30 +0000 | [diff] [blame] | 2193 | // These don't pass the bad verification we do because many of them are | 
|  | 2194 | // arch-specific, and they aren't necessarily independently includable. | 
|  | 2195 | // That's not much of a problem though, since C-incompaitibilities in the | 
|  | 2196 | // UAPI headers should run into problems long before they reach us. | 
|  | 2197 | skip_verification: true, | 
| Dan Albert | 22805ea | 2017-03-22 15:28:05 -0700 | [diff] [blame] | 2198 | } | 
| Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2199 |  | 
|  | 2200 | ndk_headers { | 
| Dan Albert | 063e86a | 2016-11-29 11:09:12 -0800 | [diff] [blame] | 2201 | name: "libc_uapi", | 
|  | 2202 | from: "kernel/uapi", | 
|  | 2203 | to: "", | 
|  | 2204 | srcs: [ | 
|  | 2205 | "kernel/uapi/asm-generic/**/*.h", | 
|  | 2206 | "kernel/uapi/drm/**/*.h", | 
|  | 2207 | "kernel/uapi/linux/**/*.h", | 
|  | 2208 | "kernel/uapi/misc/**/*.h", | 
|  | 2209 | "kernel/uapi/mtd/**/*.h", | 
|  | 2210 | "kernel/uapi/rdma/**/*.h", | 
|  | 2211 | "kernel/uapi/scsi/**/*.h", | 
|  | 2212 | "kernel/uapi/sound/**/*.h", | 
|  | 2213 | "kernel/uapi/video/**/*.h", | 
|  | 2214 | "kernel/uapi/xen/**/*.h", | 
|  | 2215 | ], | 
| Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2216 | license: "NOTICE", | 
| Dan Albert | 6aa6277 | 2024-08-13 22:01:23 +0000 | [diff] [blame] | 2217 | skip_verification: true, | 
| Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2218 | } | 
|  | 2219 |  | 
|  | 2220 | ndk_headers { | 
| Elliott Hughes | 2fad0d5 | 2017-04-27 16:26:55 -0700 | [diff] [blame] | 2221 | name: "libc_kernel_android_uapi_linux", | 
| Dan Albert | bae16ef | 2016-09-14 17:15:48 -0700 | [diff] [blame] | 2222 | from: "kernel/android/uapi/linux", | 
|  | 2223 | to: "linux", | 
|  | 2224 | srcs: ["kernel/android/uapi/linux/**/*.h"], | 
| Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2225 | license: "NOTICE", | 
| Dan Albert | bae16ef | 2016-09-14 17:15:48 -0700 | [diff] [blame] | 2226 | } | 
|  | 2227 |  | 
|  | 2228 | ndk_headers { | 
| Elliott Hughes | 2fad0d5 | 2017-04-27 16:26:55 -0700 | [diff] [blame] | 2229 | name: "libc_kernel_android_scsi", | 
| Elliott Hughes | 5059939 | 2017-05-25 17:13:32 -0700 | [diff] [blame] | 2230 | from: "kernel/android/scsi/scsi", | 
| Elliott Hughes | 2fad0d5 | 2017-04-27 16:26:55 -0700 | [diff] [blame] | 2231 | to: "scsi", | 
|  | 2232 | srcs: ["kernel/android/scsi/**/*.h"], | 
|  | 2233 | license: "NOTICE", | 
| Dan Albert | 6aa6277 | 2024-08-13 22:01:23 +0000 | [diff] [blame] | 2234 | skip_verification: true, | 
| Elliott Hughes | 2fad0d5 | 2017-04-27 16:26:55 -0700 | [diff] [blame] | 2235 | } | 
|  | 2236 |  | 
|  | 2237 | ndk_headers { | 
| Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2238 | name: "libc_asm_arm", | 
|  | 2239 | from: "kernel/uapi/asm-arm", | 
|  | 2240 | to: "arm-linux-androideabi", | 
|  | 2241 | srcs: ["kernel/uapi/asm-arm/**/*.h"], | 
| Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2242 | license: "NOTICE", | 
| Dan Albert | 6aa6277 | 2024-08-13 22:01:23 +0000 | [diff] [blame] | 2243 | skip_verification: true, | 
| Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2244 | } | 
|  | 2245 |  | 
|  | 2246 | ndk_headers { | 
|  | 2247 | name: "libc_asm_arm64", | 
|  | 2248 | from: "kernel/uapi/asm-arm64", | 
|  | 2249 | to: "aarch64-linux-android", | 
|  | 2250 | srcs: ["kernel/uapi/asm-arm64/**/*.h"], | 
| Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2251 | license: "NOTICE", | 
| Dan Albert | 6aa6277 | 2024-08-13 22:01:23 +0000 | [diff] [blame] | 2252 | skip_verification: true, | 
| Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2253 | } | 
|  | 2254 |  | 
| Lazar Trsic | 790d2f7 | 2017-11-27 11:54:11 +0100 | [diff] [blame] | 2255 | ndk_headers { | 
| Colin Cross | bd26e0f | 2022-10-19 15:03:14 -0700 | [diff] [blame] | 2256 | name: "libc_asm_riscv64", | 
|  | 2257 | from: "kernel/uapi/asm-riscv", | 
|  | 2258 | to: "riscv64-linux-android", | 
|  | 2259 | srcs: ["kernel/uapi/asm-riscv/**/*.h"], | 
|  | 2260 | license: "NOTICE", | 
| Dan Albert | 6aa6277 | 2024-08-13 22:01:23 +0000 | [diff] [blame] | 2261 | skip_verification: true, | 
| Colin Cross | bd26e0f | 2022-10-19 15:03:14 -0700 | [diff] [blame] | 2262 | } | 
|  | 2263 |  | 
|  | 2264 | ndk_headers { | 
| Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2265 | name: "libc_asm_x86", | 
|  | 2266 | from: "kernel/uapi/asm-x86", | 
|  | 2267 | to: "i686-linux-android", | 
|  | 2268 | srcs: ["kernel/uapi/asm-x86/**/*.h"], | 
| Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2269 | license: "NOTICE", | 
| Dan Albert | 6aa6277 | 2024-08-13 22:01:23 +0000 | [diff] [blame] | 2270 | skip_verification: true, | 
| Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2271 | } | 
|  | 2272 |  | 
|  | 2273 | ndk_headers { | 
|  | 2274 | name: "libc_asm_x86_64", | 
|  | 2275 | from: "kernel/uapi/asm-x86", | 
|  | 2276 | to: "x86_64-linux-android", | 
|  | 2277 | srcs: ["kernel/uapi/asm-x86/**/*.h"], | 
| Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2278 | license: "NOTICE", | 
| Dan Albert | 6aa6277 | 2024-08-13 22:01:23 +0000 | [diff] [blame] | 2279 | skip_verification: true, | 
| Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2280 | } | 
|  | 2281 |  | 
| Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2282 | ndk_library { | 
| Dan Willemsen | 51a9bf1 | 2017-04-07 14:09:18 -0700 | [diff] [blame] | 2283 | name: "libc", | 
| Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2284 | symbol_file: "libc.map.txt", | 
|  | 2285 | first_version: "9", | 
|  | 2286 | } | 
|  | 2287 |  | 
| Dan Albert | df31aff | 2016-10-06 15:50:41 -0700 | [diff] [blame] | 2288 | ndk_library { | 
| Dan Willemsen | 51a9bf1 | 2017-04-07 14:09:18 -0700 | [diff] [blame] | 2289 | name: "libstdc++", | 
| Dan Albert | df31aff | 2016-10-06 15:50:41 -0700 | [diff] [blame] | 2290 | symbol_file: "libstdc++.map.txt", | 
|  | 2291 | first_version: "9", | 
|  | 2292 | } | 
|  | 2293 |  | 
| Dan Willemsen | ca056d7 | 2018-01-08 14:00:24 -0800 | [diff] [blame] | 2294 | // Export these headers for toolbox to process | 
|  | 2295 | filegroup { | 
|  | 2296 | name: "kernel_input_headers", | 
|  | 2297 | srcs: [ | 
|  | 2298 | "kernel/uapi/linux/input.h", | 
|  | 2299 | "kernel/uapi/linux/input-event-codes.h", | 
|  | 2300 | ], | 
|  | 2301 | } | 
| Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2302 |  | 
|  | 2303 | // Generate a syscall name / number mapping. These objects are text files | 
|  | 2304 | // (thanks to the -dD -E flags) and not binary files. They will then be | 
|  | 2305 | // consumed by the genseccomp.py script and converted into C++ code. | 
|  | 2306 | cc_defaults { | 
|  | 2307 | name: "libseccomp_gen_syscall_nrs_defaults", | 
|  | 2308 | recovery_available: true, | 
|  | 2309 | srcs: ["seccomp/gen_syscall_nrs.cpp"], | 
|  | 2310 | cflags: [ | 
|  | 2311 | "-dD", | 
|  | 2312 | "-E", | 
|  | 2313 | "-Wall", | 
|  | 2314 | "-Werror", | 
|  | 2315 | "-nostdinc", | 
|  | 2316 | ], | 
|  | 2317 | } | 
|  | 2318 |  | 
|  | 2319 | cc_object { | 
|  | 2320 | name: "libseccomp_gen_syscall_nrs_arm", | 
|  | 2321 | defaults: ["libseccomp_gen_syscall_nrs_defaults"], | 
|  | 2322 | local_include_dirs: [ | 
|  | 2323 | "kernel/uapi/asm-arm", | 
|  | 2324 | "kernel/uapi", | 
|  | 2325 | ], | 
|  | 2326 | } | 
|  | 2327 |  | 
|  | 2328 | cc_object { | 
|  | 2329 | name: "libseccomp_gen_syscall_nrs_arm64", | 
|  | 2330 | defaults: ["libseccomp_gen_syscall_nrs_defaults"], | 
|  | 2331 | local_include_dirs: [ | 
|  | 2332 | "kernel/uapi/asm-arm64", | 
|  | 2333 | "kernel/uapi", | 
|  | 2334 | ], | 
|  | 2335 | } | 
|  | 2336 |  | 
|  | 2337 | cc_object { | 
| Elliott Hughes | 704772b | 2022-10-10 17:06:43 +0000 | [diff] [blame] | 2338 | name: "libseccomp_gen_syscall_nrs_riscv64", | 
|  | 2339 | defaults: ["libseccomp_gen_syscall_nrs_defaults"], | 
|  | 2340 | local_include_dirs: [ | 
|  | 2341 | "kernel/uapi/asm-riscv", | 
|  | 2342 | "kernel/uapi", | 
|  | 2343 | ], | 
|  | 2344 | } | 
|  | 2345 |  | 
|  | 2346 | cc_object { | 
| Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2347 | name: "libseccomp_gen_syscall_nrs_x86", | 
|  | 2348 | defaults: ["libseccomp_gen_syscall_nrs_defaults"], | 
|  | 2349 | srcs: ["seccomp/gen_syscall_nrs_x86.cpp"], | 
|  | 2350 | exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"], | 
|  | 2351 | local_include_dirs: [ | 
|  | 2352 | "kernel/uapi/asm-x86", | 
|  | 2353 | "kernel/uapi", | 
|  | 2354 | ], | 
|  | 2355 | } | 
|  | 2356 |  | 
|  | 2357 | cc_object { | 
|  | 2358 | name: "libseccomp_gen_syscall_nrs_x86_64", | 
|  | 2359 | defaults: ["libseccomp_gen_syscall_nrs_defaults"], | 
|  | 2360 | srcs: ["seccomp/gen_syscall_nrs_x86_64.cpp"], | 
|  | 2361 | exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"], | 
|  | 2362 | local_include_dirs: [ | 
|  | 2363 | "kernel/uapi/asm-x86", | 
|  | 2364 | "kernel/uapi", | 
|  | 2365 | ], | 
|  | 2366 | } | 
|  | 2367 |  | 
| Jingwen Chen | ca36633 | 2021-01-29 05:16:32 -0500 | [diff] [blame] | 2368 | filegroup { | 
|  | 2369 | name: "all_kernel_uapi_headers", | 
|  | 2370 | srcs: ["kernel/uapi/**/*.h"], | 
| Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2371 | } | 
|  | 2372 |  | 
| Martijn Coenen | 0c6de75 | 2019-01-02 12:52:51 +0100 | [diff] [blame] | 2373 | cc_genrule { | 
|  | 2374 | name: "func_to_syscall_nrs", | 
|  | 2375 | recovery_available: true, | 
|  | 2376 | cmd: "$(location genfunctosyscallnrs) --out-dir=$(genDir) $(in)", | 
|  | 2377 |  | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2378 | tools: ["genfunctosyscallnrs"], | 
| Martijn Coenen | 0c6de75 | 2019-01-02 12:52:51 +0100 | [diff] [blame] | 2379 |  | 
|  | 2380 | srcs: [ | 
|  | 2381 | "SYSCALLS.TXT", | 
| Martijn Coenen | 0c6de75 | 2019-01-02 12:52:51 +0100 | [diff] [blame] | 2382 | ], | 
|  | 2383 |  | 
| Elliott Hughes | 704772b | 2022-10-10 17:06:43 +0000 | [diff] [blame] | 2384 | arch: { | 
|  | 2385 | arm: { | 
|  | 2386 | srcs: [ | 
|  | 2387 | ":libseccomp_gen_syscall_nrs_arm", | 
|  | 2388 | ":libseccomp_gen_syscall_nrs_arm64", | 
|  | 2389 | ], | 
|  | 2390 | }, | 
|  | 2391 | arm64: { | 
|  | 2392 | srcs: [ | 
|  | 2393 | ":libseccomp_gen_syscall_nrs_arm", | 
|  | 2394 | ":libseccomp_gen_syscall_nrs_arm64", | 
|  | 2395 | ], | 
|  | 2396 | }, | 
|  | 2397 | riscv64: { | 
|  | 2398 | srcs: [":libseccomp_gen_syscall_nrs_riscv64"], | 
|  | 2399 | }, | 
|  | 2400 | x86: { | 
|  | 2401 | srcs: [ | 
|  | 2402 | ":libseccomp_gen_syscall_nrs_x86", | 
|  | 2403 | ":libseccomp_gen_syscall_nrs_x86_64", | 
|  | 2404 | ], | 
|  | 2405 | }, | 
|  | 2406 | x86_64: { | 
|  | 2407 | srcs: [ | 
|  | 2408 | ":libseccomp_gen_syscall_nrs_x86", | 
|  | 2409 | ":libseccomp_gen_syscall_nrs_x86_64", | 
|  | 2410 | ], | 
|  | 2411 | }, | 
|  | 2412 | }, | 
|  | 2413 |  | 
| Martijn Coenen | 0c6de75 | 2019-01-02 12:52:51 +0100 | [diff] [blame] | 2414 | out: [ | 
|  | 2415 | "func_to_syscall_nrs.h", | 
|  | 2416 | ], | 
|  | 2417 | } | 
|  | 2418 |  | 
| Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2419 | // SECCOMP_BLOCKLIST_APP_ZYGOTE.TXT = SECCOMP_BLOCKLIST_APP.txt - setresgid* | 
| Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2420 | genrule { | 
| Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2421 | name: "generate_app_zygote_blocklist", | 
|  | 2422 | out: ["SECCOMP_BLOCKLIST_APP_ZYGOTE.TXT"], | 
|  | 2423 | srcs: ["SECCOMP_BLOCKLIST_APP.TXT"], | 
| Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2424 | cmd: "grep -v '^int[ \t]*setresgid' $(in) > $(out)", | 
|  | 2425 | } | 
|  | 2426 |  | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2427 | filegroup { | 
|  | 2428 | name: "seccomp_syscalls_sources_zygote", | 
| Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2429 | srcs: [ | 
|  | 2430 | "SYSCALLS.TXT", | 
| Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2431 | "SECCOMP_ALLOWLIST_COMMON.TXT", | 
|  | 2432 | "SECCOMP_ALLOWLIST_APP.TXT", | 
|  | 2433 | "SECCOMP_BLOCKLIST_COMMON.TXT", | 
| Bram Bonné | acadd09 | 2020-05-06 13:49:55 +0200 | [diff] [blame] | 2434 | "SECCOMP_PRIORITY.TXT", | 
| Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2435 | ":generate_app_zygote_blocklist", | 
| Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2436 | ], | 
| Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2437 | } | 
|  | 2438 |  | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2439 | filegroup { | 
|  | 2440 | name: "seccomp_syscalls_sources_app", | 
| Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2441 | srcs: [ | 
|  | 2442 | "SYSCALLS.TXT", | 
| Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2443 | "SECCOMP_ALLOWLIST_COMMON.TXT", | 
|  | 2444 | "SECCOMP_ALLOWLIST_APP.TXT", | 
|  | 2445 | "SECCOMP_BLOCKLIST_COMMON.TXT", | 
|  | 2446 | "SECCOMP_BLOCKLIST_APP.TXT", | 
| Bram Bonné | acadd09 | 2020-05-06 13:49:55 +0200 | [diff] [blame] | 2447 | "SECCOMP_PRIORITY.TXT", | 
| Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2448 | ], | 
| Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2449 | } | 
|  | 2450 |  | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2451 | filegroup { | 
|  | 2452 | name: "seccomp_syscalls_sources_system", | 
| Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2453 | srcs: [ | 
|  | 2454 | "SYSCALLS.TXT", | 
| Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2455 | "SECCOMP_ALLOWLIST_COMMON.TXT", | 
|  | 2456 | "SECCOMP_ALLOWLIST_SYSTEM.TXT", | 
|  | 2457 | "SECCOMP_BLOCKLIST_COMMON.TXT", | 
| Bram Bonné | acadd09 | 2020-05-06 13:49:55 +0200 | [diff] [blame] | 2458 | "SECCOMP_PRIORITY.TXT", | 
| Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2459 | ], | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2460 | } | 
| Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2461 |  | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2462 | cc_genrule { | 
|  | 2463 | name: "libseccomp_policy_app_zygote_sources_x86", | 
|  | 2464 | recovery_available: true, | 
|  | 2465 | cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)", | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2466 | tools: ["genseccomp"], | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2467 | srcs: [ | 
|  | 2468 | ":seccomp_syscalls_sources_zygote", | 
|  | 2469 | ":libseccomp_gen_syscall_nrs_x86", | 
|  | 2470 | ":libseccomp_gen_syscall_nrs_x86_64", | 
|  | 2471 | ], | 
|  | 2472 | out: [ | 
|  | 2473 | "x86_app_zygote_policy.cpp", | 
|  | 2474 | "x86_64_app_zygote_policy.cpp", | 
|  | 2475 | ], | 
|  | 2476 | enabled: false, | 
| Yu Liu | 3a57969 | 2022-10-18 03:02:32 +0000 | [diff] [blame] | 2477 | arch: { | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2478 | x86: { | 
|  | 2479 | enabled: true, | 
|  | 2480 | }, | 
|  | 2481 | x86_64: { | 
|  | 2482 | enabled: true, | 
|  | 2483 | }, | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2484 | }, | 
|  | 2485 | } | 
|  | 2486 |  | 
|  | 2487 | cc_genrule { | 
|  | 2488 | name: "libseccomp_policy_app_zygote_sources_arm", | 
|  | 2489 | recovery_available: true, | 
|  | 2490 | cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)", | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2491 | tools: ["genseccomp"], | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2492 | srcs: [ | 
|  | 2493 | ":seccomp_syscalls_sources_zygote", | 
|  | 2494 | ":libseccomp_gen_syscall_nrs_arm", | 
|  | 2495 | ":libseccomp_gen_syscall_nrs_arm64", | 
|  | 2496 | ], | 
|  | 2497 | out: [ | 
|  | 2498 | "arm_app_zygote_policy.cpp", | 
|  | 2499 | "arm64_app_zygote_policy.cpp", | 
|  | 2500 | ], | 
|  | 2501 | enabled: false, | 
|  | 2502 | arch: { | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2503 | arm: { | 
|  | 2504 | enabled: true, | 
|  | 2505 | }, | 
|  | 2506 | arm64: { | 
|  | 2507 | enabled: true, | 
|  | 2508 | }, | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2509 | }, | 
|  | 2510 | } | 
|  | 2511 |  | 
|  | 2512 | cc_genrule { | 
|  | 2513 | name: "libseccomp_policy_app_zygote_sources_riscv64", | 
|  | 2514 | recovery_available: true, | 
|  | 2515 | cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)", | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2516 | tools: ["genseccomp"], | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2517 | srcs: [ | 
|  | 2518 | ":seccomp_syscalls_sources_zygote", | 
|  | 2519 | ":libseccomp_gen_syscall_nrs_riscv64", | 
|  | 2520 | ], | 
|  | 2521 | out: [ | 
|  | 2522 | "riscv64_app_zygote_policy.cpp", | 
|  | 2523 | ], | 
|  | 2524 | enabled: false, | 
|  | 2525 | arch: { | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2526 | riscv64: { | 
|  | 2527 | enabled: true, | 
|  | 2528 | }, | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2529 | }, | 
|  | 2530 | } | 
|  | 2531 |  | 
|  | 2532 | cc_genrule { | 
|  | 2533 | name: "libseccomp_policy_app_sources_x86", | 
|  | 2534 | recovery_available: true, | 
|  | 2535 | cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)", | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2536 | tools: ["genseccomp"], | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2537 | srcs: [ | 
|  | 2538 | ":seccomp_syscalls_sources_app", | 
|  | 2539 | ":libseccomp_gen_syscall_nrs_x86", | 
|  | 2540 | ":libseccomp_gen_syscall_nrs_x86_64", | 
|  | 2541 | ], | 
|  | 2542 | out: [ | 
|  | 2543 | "x86_app_policy.cpp", | 
|  | 2544 | "x86_64_app_policy.cpp", | 
|  | 2545 | ], | 
|  | 2546 | enabled: false, | 
|  | 2547 | arch: { | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2548 | x86: { | 
|  | 2549 | enabled: true, | 
|  | 2550 | }, | 
|  | 2551 | x86_64: { | 
|  | 2552 | enabled: true, | 
|  | 2553 | }, | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2554 | }, | 
|  | 2555 | } | 
|  | 2556 |  | 
|  | 2557 | cc_genrule { | 
|  | 2558 | name: "libseccomp_policy_app_sources_arm", | 
|  | 2559 | recovery_available: true, | 
|  | 2560 | cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)", | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2561 | tools: ["genseccomp"], | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2562 | srcs: [ | 
|  | 2563 | ":seccomp_syscalls_sources_app", | 
|  | 2564 | ":libseccomp_gen_syscall_nrs_arm", | 
|  | 2565 | ":libseccomp_gen_syscall_nrs_arm64", | 
|  | 2566 | ], | 
|  | 2567 | out: [ | 
|  | 2568 | "arm_app_policy.cpp", | 
|  | 2569 | "arm64_app_policy.cpp", | 
|  | 2570 | ], | 
|  | 2571 | enabled: false, | 
|  | 2572 | arch: { | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2573 | arm: { | 
|  | 2574 | enabled: true, | 
|  | 2575 | }, | 
|  | 2576 | arm64: { | 
|  | 2577 | enabled: true, | 
|  | 2578 | }, | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2579 | }, | 
|  | 2580 | } | 
|  | 2581 |  | 
|  | 2582 | cc_genrule { | 
|  | 2583 | name: "libseccomp_policy_app_sources_riscv64", | 
|  | 2584 | recovery_available: true, | 
|  | 2585 | cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)", | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2586 | tools: ["genseccomp"], | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2587 | srcs: [ | 
|  | 2588 | ":seccomp_syscalls_sources_app", | 
|  | 2589 | ":libseccomp_gen_syscall_nrs_riscv64", | 
|  | 2590 | ], | 
|  | 2591 | out: [ | 
|  | 2592 | "riscv64_app_policy.cpp", | 
|  | 2593 | ], | 
|  | 2594 | enabled: false, | 
|  | 2595 | arch: { | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2596 | riscv64: { | 
|  | 2597 | enabled: true, | 
|  | 2598 | }, | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2599 | }, | 
|  | 2600 | } | 
|  | 2601 |  | 
|  | 2602 | cc_genrule { | 
|  | 2603 | name: "libseccomp_policy_system_sources_x86", | 
|  | 2604 | recovery_available: true, | 
|  | 2605 | cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)", | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2606 | tools: ["genseccomp"], | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2607 | srcs: [ | 
|  | 2608 | ":seccomp_syscalls_sources_system", | 
|  | 2609 | ":libseccomp_gen_syscall_nrs_x86", | 
|  | 2610 | ":libseccomp_gen_syscall_nrs_x86_64", | 
|  | 2611 | ], | 
|  | 2612 | out: [ | 
|  | 2613 | "x86_system_policy.cpp", | 
|  | 2614 | "x86_64_system_policy.cpp", | 
|  | 2615 | ], | 
|  | 2616 | enabled: false, | 
|  | 2617 | arch: { | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2618 | x86: { | 
|  | 2619 | enabled: true, | 
|  | 2620 | }, | 
|  | 2621 | x86_64: { | 
|  | 2622 | enabled: true, | 
|  | 2623 | }, | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2624 | }, | 
|  | 2625 | } | 
|  | 2626 |  | 
|  | 2627 | cc_genrule { | 
|  | 2628 | name: "libseccomp_policy_system_sources_arm", | 
|  | 2629 | recovery_available: true, | 
|  | 2630 | cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)", | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2631 | tools: ["genseccomp"], | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2632 | srcs: [ | 
|  | 2633 | ":seccomp_syscalls_sources_system", | 
|  | 2634 | ":libseccomp_gen_syscall_nrs_arm", | 
|  | 2635 | ":libseccomp_gen_syscall_nrs_arm64", | 
|  | 2636 | ], | 
|  | 2637 | out: [ | 
|  | 2638 | "arm_system_policy.cpp", | 
|  | 2639 | "arm64_system_policy.cpp", | 
|  | 2640 | ], | 
|  | 2641 | enabled: false, | 
|  | 2642 | arch: { | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2643 | arm: { | 
|  | 2644 | enabled: true, | 
|  | 2645 | }, | 
|  | 2646 | arm64: { | 
|  | 2647 | enabled: true, | 
|  | 2648 | }, | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2649 | }, | 
|  | 2650 | } | 
|  | 2651 |  | 
|  | 2652 | cc_genrule { | 
|  | 2653 | name: "libseccomp_policy_system_sources_riscv64", | 
|  | 2654 | recovery_available: true, | 
|  | 2655 | cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)", | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2656 | tools: ["genseccomp"], | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2657 | srcs: [ | 
|  | 2658 | ":seccomp_syscalls_sources_system", | 
|  | 2659 | ":libseccomp_gen_syscall_nrs_riscv64", | 
|  | 2660 | ], | 
|  | 2661 | out: [ | 
|  | 2662 | "riscv64_system_policy.cpp", | 
|  | 2663 | ], | 
|  | 2664 | enabled: false, | 
|  | 2665 | arch: { | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2666 | riscv64: { | 
|  | 2667 | enabled: true, | 
|  | 2668 | }, | 
| Yu Liu | 3a57969 | 2022-10-18 03:02:32 +0000 | [diff] [blame] | 2669 | }, | 
| Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2670 | } | 
|  | 2671 |  | 
| Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2672 | cc_library { | 
|  | 2673 | name: "libseccomp_policy", | 
|  | 2674 | recovery_available: true, | 
| Martijn Coenen | d269d9b | 2018-11-08 16:41:42 +0100 | [diff] [blame] | 2675 | generated_headers: ["func_to_syscall_nrs"], | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2676 |  | 
|  | 2677 | arch: { | 
|  | 2678 | arm: { | 
|  | 2679 | generated_sources: [ | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2680 | "libseccomp_policy_app_sources_arm", | 
|  | 2681 | "libseccomp_policy_app_zygote_sources_arm", | 
|  | 2682 | "libseccomp_policy_system_sources_arm", | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2683 | ], | 
|  | 2684 | }, | 
|  | 2685 | arm64: { | 
|  | 2686 | generated_sources: [ | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2687 | "libseccomp_policy_app_sources_arm", | 
|  | 2688 | "libseccomp_policy_app_zygote_sources_arm", | 
|  | 2689 | "libseccomp_policy_system_sources_arm", | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2690 | ], | 
|  | 2691 | }, | 
|  | 2692 | riscv64: { | 
|  | 2693 | generated_sources: [ | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2694 | "libseccomp_policy_app_sources_riscv64", | 
|  | 2695 | "libseccomp_policy_app_zygote_sources_riscv64", | 
|  | 2696 | "libseccomp_policy_system_sources_riscv64", | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2697 | ], | 
|  | 2698 | }, | 
|  | 2699 | x86: { | 
|  | 2700 | generated_sources: [ | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2701 | "libseccomp_policy_app_sources_x86", | 
|  | 2702 | "libseccomp_policy_app_zygote_sources_x86", | 
|  | 2703 | "libseccomp_policy_system_sources_x86", | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2704 | ], | 
|  | 2705 | }, | 
|  | 2706 | x86_64: { | 
|  | 2707 | generated_sources: [ | 
| Elliott Hughes | 1eacc0e | 2024-01-19 19:05:36 +0000 | [diff] [blame] | 2708 | "libseccomp_policy_app_sources_x86", | 
|  | 2709 | "libseccomp_policy_app_zygote_sources_x86", | 
|  | 2710 | "libseccomp_policy_system_sources_x86", | 
| Yu Liu | 938ec9b | 2022-10-17 16:36:30 -0700 | [diff] [blame] | 2711 | ], | 
|  | 2712 | }, | 
|  | 2713 | }, | 
| Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2714 |  | 
|  | 2715 | srcs: [ | 
|  | 2716 | "seccomp/seccomp_policy.cpp", | 
|  | 2717 | ], | 
|  | 2718 |  | 
|  | 2719 | export_include_dirs: ["seccomp/include"], | 
|  | 2720 | cflags: [ | 
|  | 2721 | "-Wall", | 
|  | 2722 | "-Werror", | 
|  | 2723 | ], | 
|  | 2724 | shared: { | 
|  | 2725 | shared_libs: ["libbase"], | 
|  | 2726 | }, | 
|  | 2727 | static: { | 
|  | 2728 | static_libs: ["libbase"], | 
|  | 2729 | }, | 
|  | 2730 | } | 
| Christopher Ferris | fc26d71 | 2019-02-27 18:07:55 -0800 | [diff] [blame] | 2731 |  | 
| Colin Cross | 048f24e | 2021-09-01 17:26:00 -0700 | [diff] [blame] | 2732 | cc_library_host_static { | 
|  | 2733 | name: "libfts", | 
|  | 2734 | srcs: [ | 
|  | 2735 | "bionic/fts.c", | 
|  | 2736 | "upstream-openbsd/lib/libc/stdlib/recallocarray.c", | 
|  | 2737 | ], | 
|  | 2738 | export_include_dirs: ["fts/include"], | 
|  | 2739 | local_include_dirs: [ | 
|  | 2740 | "private", | 
|  | 2741 | "upstream-openbsd/android/include", | 
|  | 2742 | ], | 
|  | 2743 | cflags: [ | 
|  | 2744 | "-include openbsd-compat.h", | 
|  | 2745 | "-Wno-unused-parameter", | 
|  | 2746 | ], | 
|  | 2747 | enabled: false, | 
|  | 2748 | target: { | 
|  | 2749 | musl: { | 
|  | 2750 | enabled: true, | 
|  | 2751 | }, | 
|  | 2752 | }, | 
| Colin Cross | 2a9843f | 2022-01-13 12:26:30 -0800 | [diff] [blame] | 2753 | stl: "none", | 
|  | 2754 | } | 
|  | 2755 |  | 
|  | 2756 | cc_library_host_static { | 
|  | 2757 | name: "libexecinfo", | 
|  | 2758 | visibility: ["//external/musl"], | 
|  | 2759 | srcs: ["bionic/execinfo.cpp"], | 
|  | 2760 | export_include_dirs: ["execinfo/include"], | 
|  | 2761 | local_include_dirs: ["private"], | 
|  | 2762 | enabled: false, | 
|  | 2763 | target: { | 
|  | 2764 | musl: { | 
|  | 2765 | enabled: true, | 
|  | 2766 | system_shared_libs: [], | 
|  | 2767 | header_libs: ["libc_musl_headers"], | 
|  | 2768 | }, | 
|  | 2769 | }, | 
|  | 2770 | stl: "none", | 
| Colin Cross | 048f24e | 2021-09-01 17:26:00 -0700 | [diff] [blame] | 2771 | } | 
|  | 2772 |  | 
| Colin Cross | 9da85fa | 2022-01-24 18:20:05 -0800 | [diff] [blame] | 2773 | cc_library_host_static { | 
|  | 2774 | name: "libb64", | 
|  | 2775 | visibility: ["//external/musl"], | 
|  | 2776 | srcs: ["upstream-openbsd/lib/libc/net/base64.c"], | 
|  | 2777 | export_include_dirs: ["b64/include"], | 
|  | 2778 | local_include_dirs: [ | 
|  | 2779 | "private", | 
|  | 2780 | "upstream-openbsd/android/include", | 
|  | 2781 | ], | 
|  | 2782 | cflags: [ | 
|  | 2783 | "-include openbsd-compat.h", | 
|  | 2784 | ], | 
|  | 2785 | enabled: false, | 
|  | 2786 | target: { | 
|  | 2787 | musl: { | 
|  | 2788 | enabled: true, | 
|  | 2789 | system_shared_libs: [], | 
|  | 2790 | header_libs: ["libc_musl_headers"], | 
|  | 2791 | }, | 
|  | 2792 | }, | 
|  | 2793 | stl: "none", | 
|  | 2794 | } | 
|  | 2795 |  | 
| Colin Cross | 9d4a56e | 2022-02-03 10:20:32 -0800 | [diff] [blame] | 2796 | // Export kernel uapi headers to be used in the musl sysroot. | 
|  | 2797 | // Also include the execinfo headers for the libexecinfo and the | 
|  | 2798 | // b64 headers for libb64 embedded in musl libc. | 
|  | 2799 | cc_genrule { | 
|  | 2800 | name: "libc_musl_sysroot_bionic_headers", | 
|  | 2801 | visibility: ["//external/musl"], | 
|  | 2802 | host_supported: true, | 
|  | 2803 | device_supported: false, | 
|  | 2804 | enabled: false, | 
|  | 2805 | target: { | 
|  | 2806 | musl: { | 
|  | 2807 | enabled: true, | 
|  | 2808 | }, | 
|  | 2809 | }, | 
|  | 2810 | srcs: [ | 
|  | 2811 | "kernel/uapi/**/*.h", | 
|  | 2812 | "kernel/android/**/*.h", | 
| Colin Cross | 9d4a56e | 2022-02-03 10:20:32 -0800 | [diff] [blame] | 2813 | "execinfo/include/**/*.h", | 
| Colin Cross | 9d4a56e | 2022-02-03 10:20:32 -0800 | [diff] [blame] | 2814 | "b64/include/**/*.h", | 
| Colin Cross | aeef9f0 | 2022-02-07 21:01:26 -0800 | [diff] [blame] | 2815 |  | 
| Colin Cross | aeef9f0 | 2022-02-07 21:01:26 -0800 | [diff] [blame] | 2816 | "NOTICE", | 
| Colin Cross | 9d4a56e | 2022-02-03 10:20:32 -0800 | [diff] [blame] | 2817 |  | 
|  | 2818 | ":libc_musl_sysroot_bionic_arch_headers", | 
|  | 2819 | ], | 
|  | 2820 | out: ["libc_musl_sysroot_bionic_headers.zip"], | 
|  | 2821 | tools: [ | 
|  | 2822 | "soong_zip", | 
|  | 2823 | "merge_zips", | 
|  | 2824 | "zip2zip", | 
|  | 2825 | ], | 
| Colin Cross | aeef9f0 | 2022-02-07 21:01:26 -0800 | [diff] [blame] | 2826 | cmd: "BIONIC_LIBC_DIR=$$(dirname $(location NOTICE)) && " + | 
|  | 2827 | "$(location soong_zip) -o $(genDir)/sysroot.zip -symlinks=false" + | 
| Colin Cross | ad33d02 | 2022-02-25 18:27:04 -0800 | [diff] [blame] | 2828 | // NOTICE | 
|  | 2829 | " -j -f $(location NOTICE) " + | 
| Colin Cross | 9d4a56e | 2022-02-03 10:20:32 -0800 | [diff] [blame] | 2830 | // headers | 
|  | 2831 | " -P include " + | 
| Colin Cross | aeef9f0 | 2022-02-07 21:01:26 -0800 | [diff] [blame] | 2832 | "  -C $${BIONIC_LIBC_DIR}/kernel/uapi " + | 
|  | 2833 | "  -D $${BIONIC_LIBC_DIR}/kernel/uapi " + | 
|  | 2834 | "  -C $${BIONIC_LIBC_DIR}/kernel/android/scsi " + | 
|  | 2835 | "  -D $${BIONIC_LIBC_DIR}/kernel/android/scsi " + | 
|  | 2836 | "  -C $${BIONIC_LIBC_DIR}/kernel/android/uapi " + | 
|  | 2837 | "  -D $${BIONIC_LIBC_DIR}/kernel/android/uapi " + | 
|  | 2838 | "  -C $${BIONIC_LIBC_DIR}/execinfo/include " + | 
|  | 2839 | "  -D $${BIONIC_LIBC_DIR}/execinfo/include " + | 
|  | 2840 | "  -C $${BIONIC_LIBC_DIR}/b64/include " + | 
|  | 2841 | "  -D $${BIONIC_LIBC_DIR}/b64/include " + | 
| Colin Cross | 9d4a56e | 2022-02-03 10:20:32 -0800 | [diff] [blame] | 2842 | " && " + | 
| Colin Cross | ad33d02 | 2022-02-25 18:27:04 -0800 | [diff] [blame] | 2843 | "$(location zip2zip) -i $(genDir)/sysroot.zip -o $(genDir)/sysroot-renamed.zip " + | 
| Colin Cross | 1c0a7a0 | 2022-08-11 12:22:26 -0700 | [diff] [blame] | 2844 | " -x **/BUILD " + | 
| Colin Cross | ad33d02 | 2022-02-25 18:27:04 -0800 | [diff] [blame] | 2845 | " include/**/*:include/ " + | 
|  | 2846 | " NOTICE:NOTICE.bionic " + | 
|  | 2847 | " && " + | 
|  | 2848 | "$(location merge_zips) $(out) $(location :libc_musl_sysroot_bionic_arch_headers) $(genDir)/sysroot-renamed.zip", | 
| Colin Cross | 9d4a56e | 2022-02-03 10:20:32 -0800 | [diff] [blame] | 2849 | } | 
|  | 2850 |  | 
|  | 2851 | // The architecture-specific bits have to be handled separately because the label varies based | 
|  | 2852 | // on architecture, which prevents using $(locations) to find them and requires using $(in) | 
|  | 2853 | // instead, which would mix in all the other files if this were part of the main libc_musl_sysroot | 
|  | 2854 | // genrule. | 
|  | 2855 | cc_genrule { | 
|  | 2856 | name: "libc_musl_sysroot_bionic_arch_headers", | 
|  | 2857 | visibility: ["//visibility:private"], | 
|  | 2858 | host_supported: true, | 
|  | 2859 | device_supported: false, | 
|  | 2860 | enabled: false, | 
|  | 2861 | target: { | 
|  | 2862 | musl: { | 
|  | 2863 | enabled: true, | 
|  | 2864 | }, | 
|  | 2865 | }, | 
|  | 2866 | arch: { | 
|  | 2867 | arm: { | 
|  | 2868 | srcs: ["kernel/uapi/asm-arm/**/*.h"], | 
|  | 2869 | }, | 
|  | 2870 | arm64: { | 
|  | 2871 | srcs: ["kernel/uapi/asm-arm64/**/*.h"], | 
|  | 2872 | }, | 
|  | 2873 | x86: { | 
|  | 2874 | srcs: ["kernel/uapi/asm-x86/**/*.h"], | 
|  | 2875 | }, | 
|  | 2876 | x86_64: { | 
|  | 2877 | srcs: ["kernel/uapi/asm-x86/**/*.h"], | 
|  | 2878 | }, | 
|  | 2879 | }, | 
|  | 2880 | out: ["libc_musl_sysroot_bionic_arch_headers.zip"], | 
|  | 2881 | tools: ["soong_zip"], | 
|  | 2882 | cmd: "includes=($(in)) && $(location soong_zip) -o $(out) -P include/asm -j -D $$(dirname $${includes[0]})", | 
|  | 2883 | } | 
| Colin Cross | 290c495 | 2022-10-13 12:51:13 -0700 | [diff] [blame] | 2884 |  | 
|  | 2885 | cc_genrule { | 
|  | 2886 | name: "bionic_sysroot_crt_objects", | 
|  | 2887 | visibility: ["//visibility:private"], | 
|  | 2888 | out: ["bionic_sysroot_crt_objects.zip"], | 
|  | 2889 | tools: ["soong_zip"], | 
|  | 2890 | srcs: [ | 
|  | 2891 | ":crtbegin_dynamic", | 
|  | 2892 | ":crtbegin_so", | 
|  | 2893 | ":crtbegin_static", | 
|  | 2894 | ":crtend_android", | 
|  | 2895 | ":crtend_so", | 
|  | 2896 | ], | 
|  | 2897 | cmd: "$(location soong_zip) -o $(out) -j " + | 
|  | 2898 | "-f $(location :crtbegin_dynamic) " + | 
|  | 2899 | "-f $(location :crtbegin_so) " + | 
|  | 2900 | "-f $(location :crtbegin_static) " + | 
|  | 2901 | "-f $(location :crtend_android) " + | 
|  | 2902 | "-f $(location :crtend_so)", | 
|  | 2903 | dist: { | 
|  | 2904 | targets: ["bionic_sysroot_crt_objects"], | 
|  | 2905 | }, | 
|  | 2906 | arch: { | 
|  | 2907 | arm: { | 
|  | 2908 | dist: { | 
|  | 2909 | suffix: "_arm", | 
|  | 2910 | }, | 
|  | 2911 | }, | 
|  | 2912 | arm64: { | 
|  | 2913 | dist: { | 
|  | 2914 | suffix: "_arm64", | 
|  | 2915 | }, | 
|  | 2916 | }, | 
|  | 2917 | riscv64: { | 
|  | 2918 | dist: { | 
|  | 2919 | suffix: "_riscv64", | 
|  | 2920 | }, | 
|  | 2921 | }, | 
|  | 2922 | x86: { | 
|  | 2923 | dist: { | 
|  | 2924 | suffix: "_x86", | 
|  | 2925 | }, | 
|  | 2926 | }, | 
|  | 2927 | x86_64: { | 
|  | 2928 | dist: { | 
|  | 2929 | suffix: "_x86_64", | 
|  | 2930 | }, | 
|  | 2931 | }, | 
|  | 2932 | }, | 
|  | 2933 | } | 
| Spandan Das | 8fce52a | 2023-09-28 18:00:12 +0000 | [diff] [blame] | 2934 |  | 
| Jiyong Park | 35a280d | 2024-05-03 16:53:39 +0900 | [diff] [blame] | 2935 | filegroup { | 
|  | 2936 | name: "linux_capability_header", | 
|  | 2937 | srcs: ["kernel/uapi/linux/capability.h"], | 
|  | 2938 | } |