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