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