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