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