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