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