Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1 | // Define the common source files for all the libc instances |
| 2 | // ========================================================= |
| 3 | libc_common_src_files = [ |
Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 4 | "async_safe/async_safe_log.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 5 | "bionic/ether_aton.c", |
| 6 | "bionic/ether_ntoa.c", |
Victor Khimenko | 8e0707d | 2020-06-09 21:57:05 +0200 | [diff] [blame] | 7 | "bionic/exit.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 8 | "bionic/fts.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 9 | "bionic/initgroups.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 10 | "bionic/isatty.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 11 | "bionic/sched_cpualloc.c", |
| 12 | "bionic/sched_cpucount.c", |
Elliott Hughes | 3a4c454 | 2017-07-19 17:20:24 -0700 | [diff] [blame] | 13 | "stdio/fmemopen.cpp", |
Elliott Hughes | 7f0849f | 2016-08-26 16:17:17 -0700 | [diff] [blame] | 14 | "stdio/parsefloat.c", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 15 | "stdio/refill.c", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 16 | "stdio/stdio.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 17 | "stdio/stdio_ext.cpp", |
Elliott Hughes | 38e4aef | 2018-01-18 10:21:29 -0800 | [diff] [blame] | 18 | "stdio/vfscanf.cpp", |
Elliott Hughes | 7f0849f | 2016-08-26 16:17:17 -0700 | [diff] [blame] | 19 | "stdio/vfwscanf.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 20 | ] |
| 21 | |
Peter Collingbourne | 570de33 | 2019-12-11 10:00:58 -0800 | [diff] [blame] | 22 | // off64_t/time64_t support on LP32. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 23 | // ======================================================== |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 24 | libc_common_src_files_32 = [ |
| 25 | "bionic/legacy_32_bit_support.cpp", |
| 26 | "bionic/time64.c", |
| 27 | ] |
| 28 | |
Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 29 | libc_common_flags = [ |
| 30 | "-D_LIBC=1", |
Elliott Hughes | 25f17e4 | 2018-02-12 15:48:01 -0800 | [diff] [blame] | 31 | "-D__BIONIC_LP32_USE_STAT64", |
Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 32 | "-Wall", |
| 33 | "-Wextra", |
| 34 | "-Wunused", |
Elliott Hughes | 3048a36 | 2018-01-19 17:58:07 -0800 | [diff] [blame] | 35 | "-Wno-char-subscripts", |
Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 36 | "-Wno-deprecated-declarations", |
Elliott Hughes | b348d5c | 2017-07-24 16:53:11 -0700 | [diff] [blame] | 37 | "-Wno-gcc-compat", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 38 | "-Wframe-larger-than=2048", |
Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 39 | |
| 40 | // Try to catch typical 32-bit assumptions that break with 64-bit pointers. |
| 41 | "-Werror=pointer-to-int-cast", |
| 42 | "-Werror=int-to-pointer-cast", |
| 43 | "-Werror=type-limits", |
| 44 | "-Werror", |
Ryan Prichard | 8f41957 | 2018-02-20 17:09:05 -0800 | [diff] [blame] | 45 | |
| 46 | // Clang's exit-time destructor registration hides __dso_handle, but |
| 47 | // __dso_handle needs to have default visibility on ARM32. See b/73485611. |
| 48 | "-Wexit-time-destructors", |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 49 | |
| 50 | // GWP-ASan requires platform TLS. |
| 51 | "-fno-emulated-tls", |
Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 52 | ] |
| 53 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 54 | // Define some common cflags |
| 55 | // ======================================================== |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 56 | cc_defaults { |
| 57 | name: "libc_defaults", |
Dan Willemsen | 7ec52b1 | 2016-11-28 17:02:25 -0800 | [diff] [blame] | 58 | defaults: ["linux_bionic_supported"], |
Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 59 | cflags: libc_common_flags, |
| 60 | asflags: libc_common_flags, |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 61 | conlyflags: ["-std=gnu99"], |
| 62 | cppflags: [], |
Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 63 | include_dirs: [ |
| 64 | "bionic/libc/async_safe/include", |
Peter Collingbourne | 5d3aa86 | 2020-09-11 15:05:17 -0700 | [diff] [blame] | 65 | "bionic/libc/platform", |
Tom Cherry | 379ed1e | 2020-09-17 09:36:25 -0700 | [diff] [blame] | 66 | // For android_filesystem_config.h. |
| 67 | "system/core/libcutils/include", |
Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 68 | ], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 69 | |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 70 | header_libs: [ |
| 71 | "libc_headers", |
| 72 | "gwp_asan_headers", |
| 73 | ], |
| 74 | export_header_lib_headers: [ |
| 75 | "libc_headers", |
| 76 | ], |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 77 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 78 | stl: "none", |
| 79 | system_shared_libs: [], |
Colin Cross | 27c43c5 | 2016-04-07 13:27:24 -0700 | [diff] [blame] | 80 | sanitize: { |
Evgenii Stepanov | be551f5 | 2018-08-13 16:46:15 -0700 | [diff] [blame] | 81 | address: false, |
| 82 | integer_overflow: false, |
Mitch Phillips | dfde0ee | 2019-05-01 14:26:13 -0700 | [diff] [blame] | 83 | // TODO(b/132640749): Fix broken fuzzer support. |
| 84 | fuzzer: false, |
Colin Cross | 27c43c5 | 2016-04-07 13:27:24 -0700 | [diff] [blame] | 85 | }, |
Yifan Hong | 5a39cee | 2020-01-21 16:43:56 -0800 | [diff] [blame] | 86 | ramdisk_available: true, |
Yifan Hong | b04490d | 2020-10-21 18:36:36 -0700 | [diff] [blame] | 87 | vendor_ramdisk_available: true, |
Jiyong Park | 5603c6e | 2018-04-27 21:53:11 +0900 | [diff] [blame] | 88 | recovery_available: true, |
dimitry | 7f04880 | 2019-05-03 15:57:34 +0200 | [diff] [blame] | 89 | native_bridge_supported: true, |
Ivan Lozano | f17fd1d | 2018-11-27 07:56:17 -0800 | [diff] [blame] | 90 | |
Yi Kong | e3d90de | 2019-02-20 14:28:56 -0800 | [diff] [blame] | 91 | // lld complains about duplicate symbols in libcrt and libgcc. Suppress the |
| 92 | // warning since this is intended right now. |
| 93 | ldflags: ["-Wl,-z,muldefs"], |
Peter Collingbourne | e99912f | 2019-11-01 15:37:00 -0700 | [diff] [blame] | 94 | |
| 95 | product_variables: { |
Evgenii Stepanov | 5a73e03 | 2020-04-29 14:59:44 -0700 | [diff] [blame] | 96 | malloc_zero_contents: { |
| 97 | cflags: ["-DSCUDO_ZERO_CONTENTS"], |
| 98 | }, |
| 99 | malloc_pattern_fill_contents: { |
| 100 | cflags: ["-DSCUDO_PATTERN_FILL_CONTENTS"], |
| 101 | }, |
Steven Moreland | fb65ee4 | 2020-07-31 00:18:38 +0000 | [diff] [blame] | 102 | malloc_not_svelte: { |
| 103 | cflags: ["-DUSE_SCUDO"], |
| 104 | }, |
Peter Collingbourne | e99912f | 2019-11-01 15:37:00 -0700 | [diff] [blame] | 105 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 106 | } |
| 107 | |
Christopher Ferris | 4df29ed | 2020-01-24 18:06:42 -0800 | [diff] [blame] | 108 | libc_scudo_product_variables = { |
| 109 | malloc_not_svelte: { |
| 110 | cflags: ["-DUSE_SCUDO"], |
| 111 | whole_static_libs: ["libscudo"], |
| 112 | exclude_static_libs: [ |
| 113 | "libjemalloc5", |
| 114 | "libc_jemalloc_wrapper", |
| 115 | ], |
| 116 | }, |
| 117 | } |
| 118 | |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 119 | // Defaults for native allocator libs/includes to make it |
| 120 | // easier to change. |
Christopher Ferris | 062eba2 | 2020-01-31 22:40:45 -0800 | [diff] [blame] | 121 | // To disable scudo for the non-svelte config remove the line: |
Christopher Ferris | 4df29ed | 2020-01-24 18:06:42 -0800 | [diff] [blame] | 122 | // product_variables: libc_scudo_product_variables, |
Christopher Ferris | 062eba2 | 2020-01-31 22:40:45 -0800 | [diff] [blame] | 123 | // in the cc_defaults below. |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 124 | // ======================================================== |
| 125 | cc_defaults { |
| 126 | name: "libc_native_allocator_defaults", |
| 127 | |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 128 | whole_static_libs: [ |
| 129 | "libjemalloc5", |
| 130 | "libc_jemalloc_wrapper", |
| 131 | ], |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 132 | header_libs: ["gwp_asan_headers"], |
Christopher Ferris | 062eba2 | 2020-01-31 22:40:45 -0800 | [diff] [blame] | 133 | product_variables: libc_scudo_product_variables, |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | // Functions not implemented by jemalloc directly, or that need to |
| 137 | // be modified for Android. |
| 138 | cc_library_static { |
| 139 | name: "libc_jemalloc_wrapper", |
| 140 | defaults: ["libc_defaults"], |
| 141 | srcs: ["bionic/jemalloc_wrapper.cpp"], |
| 142 | cflags: ["-fvisibility=hidden"], |
| 143 | |
Christopher Ferris | 4df29ed | 2020-01-24 18:06:42 -0800 | [diff] [blame] | 144 | // Used to pull in the jemalloc include directory so that if the |
| 145 | // library is removed, the include directory is also removed. |
| 146 | static_libs: ["libjemalloc5"], |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 147 | } |
| 148 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 149 | // ======================================================== |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 150 | // libc_bootstrap.a - -fno-stack-protector and -ffreestanding |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 151 | // ======================================================== |
| 152 | // |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 153 | // Code that implements the stack protector (or that runs before TLS has been set up) needs to be |
| 154 | // compiled with -fno-stack-protector, since it accesses the stack canary TLS slot. In the linker, |
| 155 | // some of this code runs before ifunc resolvers have made string.h functions work, so compile with |
| 156 | // -ffreestanding. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 157 | |
| 158 | cc_library_static { |
| 159 | |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 160 | srcs: [ |
| 161 | "bionic/__libc_init_main_thread.cpp", |
| 162 | "bionic/__stack_chk_fail.cpp", |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 163 | "bionic/bionic_call_ifunc_resolver.cpp", |
| 164 | "bionic/getauxval.cpp", |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 165 | ], |
| 166 | arch: { |
| 167 | arm64: { |
| 168 | srcs: ["arch-arm64/bionic/__set_tls.c"], |
| 169 | }, |
| 170 | x86: { |
Ryan Prichard | 27475b5 | 2018-05-17 17:14:18 -0700 | [diff] [blame] | 171 | srcs: [ |
| 172 | "arch-x86/bionic/__libc_init_sysinfo.cpp", |
| 173 | "arch-x86/bionic/__set_tls.cpp", |
| 174 | ], |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 175 | }, |
| 176 | x86_64: { |
| 177 | srcs: ["arch-x86_64/bionic/__set_tls.c"], |
| 178 | }, |
| 179 | }, |
| 180 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 181 | defaults: ["libc_defaults"], |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 182 | cflags: ["-fno-stack-protector", "-ffreestanding"], |
| 183 | name: "libc_bootstrap", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 184 | } |
| 185 | |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 186 | // libc_init_static.cpp and libc_init_dynamic.cpp need to be built without stack protector. |
| 187 | // libc_init_static.cpp sets up TLS for static executables, and libc_init_dynamic.cpp initializes |
| 188 | // the stack protector global variable. |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 189 | |
| 190 | cc_library_static { |
| 191 | name: "libc_init_static", |
| 192 | defaults: ["libc_defaults"], |
| 193 | srcs: ["bionic/libc_init_static.cpp"], |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 194 | cflags: [ |
| 195 | "-fno-stack-protector", |
| 196 | |
| 197 | // Compile libc_init_static.cpp with -ffreestanding, because some of its code is called |
| 198 | // from the linker before ifunc resolvers have made string.h functions available. |
| 199 | "-ffreestanding", |
| 200 | ], |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 201 | } |
| 202 | |
Stephen Crane | f4b1cbd | 2017-05-09 14:27:43 -0700 | [diff] [blame] | 203 | cc_library_static { |
| 204 | name: "libc_init_dynamic", |
| 205 | defaults: ["libc_defaults"], |
| 206 | srcs: ["bionic/libc_init_dynamic.cpp"], |
| 207 | cflags: ["-fno-stack-protector"], |
| 208 | } |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 209 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 210 | // ======================================================== |
| 211 | // libc_tzcode.a - upstream 'tzcode' code |
| 212 | // ======================================================== |
| 213 | |
| 214 | cc_library_static { |
| 215 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 216 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 217 | srcs: [ |
Dan Willemsen | 9c9aa74 | 2016-01-15 16:00:57 -0800 | [diff] [blame] | 218 | "tzcode/**/*.c", |
Elliott Hughes | 0e8616a | 2017-04-11 14:44:51 -0700 | [diff] [blame] | 219 | "tzcode/bionic.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 220 | "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one. |
| 221 | ], |
| 222 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 223 | cflags: [ |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 224 | "-Wno-unused-parameter", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 225 | // Don't use ridiculous amounts of stack. |
| 226 | "-DALL_STATE", |
| 227 | // Include tzsetwall, timelocal, timegm, time2posix, and posix2time. |
| 228 | "-DSTD_INSPIRED", |
Colin Cross | a35d23d | 2015-11-19 13:32:49 -0800 | [diff] [blame] | 229 | // Obviously, we want to be thread-safe. |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 230 | "-DTHREAD_SAFE", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 231 | // The name of the tm_gmtoff field in our struct tm. |
| 232 | "-DTM_GMTOFF=tm_gmtoff", |
| 233 | // Where we store our tzdata. |
Colin Cross | 7b29495 | 2016-09-29 14:08:13 -0700 | [diff] [blame] | 234 | "-DTZDIR=\"/system/usr/share/zoneinfo\"", |
Elliott Hughes | 0a610d0 | 2016-07-29 14:04:17 -0700 | [diff] [blame] | 235 | // Include `tzname`, `timezone`, and `daylight` globals. |
| 236 | "-DHAVE_POSIX_DECLS=0", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 237 | "-DUSG_COMPAT=1", |
Colin Cross | a35d23d | 2015-11-19 13:32:49 -0800 | [diff] [blame] | 238 | // Use the empty string (instead of " ") as the timezone abbreviation |
| 239 | // fallback. |
Colin Cross | 7b29495 | 2016-09-29 14:08:13 -0700 | [diff] [blame] | 240 | "-DWILDABBR=\"\"", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 241 | "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU", |
| 242 | "-Dlint", |
| 243 | ], |
| 244 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 245 | local_include_dirs: ["tzcode/"], |
| 246 | name: "libc_tzcode", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 247 | } |
| 248 | |
| 249 | // ======================================================== |
| 250 | // libc_dns.a - modified NetBSD DNS code |
| 251 | // ======================================================== |
| 252 | |
| 253 | cc_library_static { |
| 254 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 255 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 256 | srcs: [ |
Dan Willemsen | 9c9aa74 | 2016-01-15 16:00:57 -0800 | [diff] [blame] | 257 | "dns/**/*.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 258 | |
| 259 | "upstream-netbsd/lib/libc/isc/ev_streams.c", |
| 260 | "upstream-netbsd/lib/libc/isc/ev_timers.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 261 | ], |
| 262 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 263 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 264 | "-DANDROID_CHANGES", |
| 265 | "-DINET6", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 266 | "-Wno-unused-parameter", |
| 267 | "-include netbsd-compat.h", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 268 | "-Wframe-larger-than=66000", |
Elliott Hughes | e1dc4f6 | 2021-01-11 11:51:29 -0800 | [diff] [blame] | 269 | "-include private/bsd_sys_param.h", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 270 | ], |
| 271 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 272 | local_include_dirs: [ |
| 273 | "dns/include", |
| 274 | "private", |
| 275 | "upstream-netbsd/lib/libc/include", |
| 276 | "upstream-netbsd/android/include", |
| 277 | ], |
| 278 | |
| 279 | name: "libc_dns", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 280 | } |
| 281 | |
| 282 | // ======================================================== |
| 283 | // libc_freebsd.a - upstream FreeBSD C library code |
| 284 | // ======================================================== |
| 285 | // |
| 286 | // These files are built with the freebsd-compat.h header file |
| 287 | // automatically included. |
| 288 | |
| 289 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 290 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 291 | srcs: [ |
| 292 | "upstream-freebsd/lib/libc/gen/ldexp.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 293 | "upstream-freebsd/lib/libc/stdlib/getopt_long.c", |
Elliott Hughes | 5702c6f | 2017-08-31 17:27:05 -0700 | [diff] [blame] | 294 | "upstream-freebsd/lib/libc/stdlib/hcreate.c", |
| 295 | "upstream-freebsd/lib/libc/stdlib/hcreate_r.c", |
| 296 | "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c", |
| 297 | "upstream-freebsd/lib/libc/stdlib/hsearch_r.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 298 | "upstream-freebsd/lib/libc/stdlib/qsort.c", |
| 299 | "upstream-freebsd/lib/libc/stdlib/quick_exit.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 300 | "upstream-freebsd/lib/libc/string/wcpcpy.c", |
| 301 | "upstream-freebsd/lib/libc/string/wcpncpy.c", |
| 302 | "upstream-freebsd/lib/libc/string/wcscasecmp.c", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 303 | "upstream-freebsd/lib/libc/string/wcscat.c", |
| 304 | "upstream-freebsd/lib/libc/string/wcschr.c", |
| 305 | "upstream-freebsd/lib/libc/string/wcscmp.c", |
| 306 | "upstream-freebsd/lib/libc/string/wcscpy.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 307 | "upstream-freebsd/lib/libc/string/wcscspn.c", |
| 308 | "upstream-freebsd/lib/libc/string/wcsdup.c", |
| 309 | "upstream-freebsd/lib/libc/string/wcslcat.c", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 310 | "upstream-freebsd/lib/libc/string/wcslen.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 311 | "upstream-freebsd/lib/libc/string/wcsncasecmp.c", |
| 312 | "upstream-freebsd/lib/libc/string/wcsncat.c", |
| 313 | "upstream-freebsd/lib/libc/string/wcsncmp.c", |
| 314 | "upstream-freebsd/lib/libc/string/wcsncpy.c", |
| 315 | "upstream-freebsd/lib/libc/string/wcsnlen.c", |
| 316 | "upstream-freebsd/lib/libc/string/wcspbrk.c", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 317 | "upstream-freebsd/lib/libc/string/wcsrchr.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 318 | "upstream-freebsd/lib/libc/string/wcsspn.c", |
Elliott Hughes | 20f3399 | 2017-07-13 09:45:00 -0700 | [diff] [blame] | 319 | "upstream-freebsd/lib/libc/string/wcsstr.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 320 | "upstream-freebsd/lib/libc/string/wcstok.c", |
| 321 | "upstream-freebsd/lib/libc/string/wmemchr.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 322 | "upstream-freebsd/lib/libc/string/wmemcmp.c", |
Elliott Hughes | 20f3399 | 2017-07-13 09:45:00 -0700 | [diff] [blame] | 323 | "upstream-freebsd/lib/libc/string/wmemcpy.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 324 | "upstream-freebsd/lib/libc/string/wmemmove.c", |
Dan Willemsen | 9c9aa74 | 2016-01-15 16:00:57 -0800 | [diff] [blame] | 325 | "upstream-freebsd/lib/libc/string/wmemset.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 326 | ], |
| 327 | arch: { |
| 328 | arm64: { |
| 329 | exclude_srcs: [ |
| 330 | "upstream-freebsd/lib/libc/string/wmemmove.c", |
| 331 | ], |
| 332 | }, |
| 333 | x86: { |
| 334 | exclude_srcs: [ |
| 335 | "upstream-freebsd/lib/libc/string/wcschr.c", |
| 336 | "upstream-freebsd/lib/libc/string/wcscmp.c", |
| 337 | "upstream-freebsd/lib/libc/string/wcslen.c", |
| 338 | "upstream-freebsd/lib/libc/string/wcsrchr.c", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 339 | "upstream-freebsd/lib/libc/string/wmemcmp.c", |
| 340 | "upstream-freebsd/lib/libc/string/wcscat.c", |
| 341 | "upstream-freebsd/lib/libc/string/wcscpy.c", |
| 342 | "upstream-freebsd/lib/libc/string/wmemcmp.c", |
Shalini Salomi Bodapati | 4ed2f47 | 2019-06-13 09:54:08 +0530 | [diff] [blame] | 343 | "upstream-freebsd/lib/libc/string/wmemset.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 344 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 345 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 346 | }, |
| 347 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 348 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 349 | "-Wno-sign-compare", |
Elliott Hughes | 5702c6f | 2017-08-31 17:27:05 -0700 | [diff] [blame] | 350 | "-Wno-unused-parameter", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 351 | "-include freebsd-compat.h", |
| 352 | ], |
| 353 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 354 | local_include_dirs: [ |
| 355 | "upstream-freebsd/android/include", |
| 356 | ], |
| 357 | |
| 358 | name: "libc_freebsd", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 359 | } |
| 360 | |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 361 | cc_library_static { |
| 362 | defaults: ["libc_defaults"], |
| 363 | srcs: [ |
Elliott Hughes | f1c568d | 2017-09-26 17:09:07 -0700 | [diff] [blame] | 364 | "upstream-freebsd/lib/libc/gen/glob.c", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 365 | ], |
| 366 | |
| 367 | cflags: [ |
| 368 | "-Wno-sign-compare", |
| 369 | "-include freebsd-compat.h", |
Elliott Hughes | f1c568d | 2017-09-26 17:09:07 -0700 | [diff] [blame] | 370 | "-Wframe-larger-than=66000", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 371 | ], |
| 372 | |
| 373 | local_include_dirs: [ |
| 374 | "upstream-freebsd/android/include", |
| 375 | ], |
| 376 | |
| 377 | name: "libc_freebsd_large_stack", |
| 378 | } |
| 379 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 380 | // ======================================================== |
| 381 | // libc_netbsd.a - upstream NetBSD C library code |
| 382 | // ======================================================== |
| 383 | // |
| 384 | // These files are built with the netbsd-compat.h header file |
| 385 | // automatically included. |
| 386 | |
| 387 | cc_library_static { |
| 388 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 389 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 390 | srcs: [ |
| 391 | "upstream-netbsd/common/lib/libc/stdlib/random.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 392 | "upstream-netbsd/lib/libc/gen/nice.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 393 | "upstream-netbsd/lib/libc/gen/psignal.c", |
| 394 | "upstream-netbsd/lib/libc/gen/utime.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 395 | "upstream-netbsd/lib/libc/inet/nsap_addr.c", |
| 396 | "upstream-netbsd/lib/libc/regex/regcomp.c", |
| 397 | "upstream-netbsd/lib/libc/regex/regerror.c", |
| 398 | "upstream-netbsd/lib/libc/regex/regexec.c", |
| 399 | "upstream-netbsd/lib/libc/regex/regfree.c", |
| 400 | "upstream-netbsd/lib/libc/stdlib/bsearch.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 401 | "upstream-netbsd/lib/libc/stdlib/drand48.c", |
| 402 | "upstream-netbsd/lib/libc/stdlib/erand48.c", |
| 403 | "upstream-netbsd/lib/libc/stdlib/jrand48.c", |
| 404 | "upstream-netbsd/lib/libc/stdlib/lcong48.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 405 | "upstream-netbsd/lib/libc/stdlib/lrand48.c", |
| 406 | "upstream-netbsd/lib/libc/stdlib/mrand48.c", |
| 407 | "upstream-netbsd/lib/libc/stdlib/nrand48.c", |
| 408 | "upstream-netbsd/lib/libc/stdlib/_rand48.c", |
| 409 | "upstream-netbsd/lib/libc/stdlib/rand_r.c", |
| 410 | "upstream-netbsd/lib/libc/stdlib/reallocarr.c", |
| 411 | "upstream-netbsd/lib/libc/stdlib/seed48.c", |
| 412 | "upstream-netbsd/lib/libc/stdlib/srand48.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 413 | ], |
| 414 | multilib: { |
| 415 | lib32: { |
| 416 | // LP32 cruft |
| 417 | srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"], |
| 418 | }, |
| 419 | }, |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 420 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 421 | "-Wno-sign-compare", |
Dan Willemsen | 879cec2 | 2016-02-29 10:37:56 -0800 | [diff] [blame] | 422 | "-Wno-unused-parameter", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 423 | "-DPOSIX_MISTAKE", |
| 424 | "-include netbsd-compat.h", |
| 425 | ], |
| 426 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 427 | local_include_dirs: [ |
| 428 | "upstream-netbsd/android/include", |
| 429 | "upstream-netbsd/lib/libc/include", |
| 430 | ], |
| 431 | |
| 432 | name: "libc_netbsd", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 433 | } |
| 434 | |
| 435 | // ======================================================== |
| 436 | // libc_openbsd_ndk.a - upstream OpenBSD C library code |
| 437 | // that can be safely included in the libc_ndk.a (doesn't |
| 438 | // contain any troublesome global data or constructors). |
| 439 | // ======================================================== |
| 440 | // |
| 441 | // These files are built with the openbsd-compat.h header file |
| 442 | // automatically included. |
| 443 | |
| 444 | cc_library_static { |
| 445 | name: "libc_openbsd_ndk", |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 446 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 447 | srcs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 448 | "upstream-openbsd/lib/libc/gen/alarm.c", |
| 449 | "upstream-openbsd/lib/libc/gen/ctype_.c", |
| 450 | "upstream-openbsd/lib/libc/gen/daemon.c", |
| 451 | "upstream-openbsd/lib/libc/gen/err.c", |
| 452 | "upstream-openbsd/lib/libc/gen/errx.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 453 | "upstream-openbsd/lib/libc/gen/fnmatch.c", |
| 454 | "upstream-openbsd/lib/libc/gen/ftok.c", |
| 455 | "upstream-openbsd/lib/libc/gen/getprogname.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 456 | "upstream-openbsd/lib/libc/gen/setprogname.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 457 | "upstream-openbsd/lib/libc/gen/verr.c", |
| 458 | "upstream-openbsd/lib/libc/gen/verrx.c", |
| 459 | "upstream-openbsd/lib/libc/gen/vwarn.c", |
| 460 | "upstream-openbsd/lib/libc/gen/vwarnx.c", |
| 461 | "upstream-openbsd/lib/libc/gen/warn.c", |
| 462 | "upstream-openbsd/lib/libc/gen/warnx.c", |
| 463 | "upstream-openbsd/lib/libc/locale/btowc.c", |
| 464 | "upstream-openbsd/lib/libc/locale/mbrlen.c", |
| 465 | "upstream-openbsd/lib/libc/locale/mbstowcs.c", |
| 466 | "upstream-openbsd/lib/libc/locale/mbtowc.c", |
| 467 | "upstream-openbsd/lib/libc/locale/wcscoll.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 468 | "upstream-openbsd/lib/libc/locale/wcstoimax.c", |
| 469 | "upstream-openbsd/lib/libc/locale/wcstol.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 470 | "upstream-openbsd/lib/libc/locale/wcstoll.c", |
| 471 | "upstream-openbsd/lib/libc/locale/wcstombs.c", |
| 472 | "upstream-openbsd/lib/libc/locale/wcstoul.c", |
| 473 | "upstream-openbsd/lib/libc/locale/wcstoull.c", |
| 474 | "upstream-openbsd/lib/libc/locale/wcstoumax.c", |
| 475 | "upstream-openbsd/lib/libc/locale/wcsxfrm.c", |
| 476 | "upstream-openbsd/lib/libc/locale/wctob.c", |
| 477 | "upstream-openbsd/lib/libc/locale/wctomb.c", |
Elliott Hughes | 26fda77 | 2016-04-06 11:56:41 -0700 | [diff] [blame] | 478 | "upstream-openbsd/lib/libc/net/base64.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 479 | "upstream-openbsd/lib/libc/net/htonl.c", |
| 480 | "upstream-openbsd/lib/libc/net/htons.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 481 | "upstream-openbsd/lib/libc/net/inet_lnaof.c", |
| 482 | "upstream-openbsd/lib/libc/net/inet_makeaddr.c", |
| 483 | "upstream-openbsd/lib/libc/net/inet_netof.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 484 | "upstream-openbsd/lib/libc/net/inet_ntoa.c", |
| 485 | "upstream-openbsd/lib/libc/net/inet_ntop.c", |
| 486 | "upstream-openbsd/lib/libc/net/inet_pton.c", |
| 487 | "upstream-openbsd/lib/libc/net/ntohl.c", |
| 488 | "upstream-openbsd/lib/libc/net/ntohs.c", |
Colin Cross | 8ce38af | 2016-01-19 12:50:20 -0800 | [diff] [blame] | 489 | "upstream-openbsd/lib/libc/net/res_random.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 490 | "upstream-openbsd/lib/libc/stdio/fgetln.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 491 | "upstream-openbsd/lib/libc/stdio/fgetwc.c", |
| 492 | "upstream-openbsd/lib/libc/stdio/fgetws.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 493 | "upstream-openbsd/lib/libc/stdio/flags.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 494 | "upstream-openbsd/lib/libc/stdio/fpurge.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 495 | "upstream-openbsd/lib/libc/stdio/fputwc.c", |
| 496 | "upstream-openbsd/lib/libc/stdio/fputws.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 497 | "upstream-openbsd/lib/libc/stdio/fvwrite.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 498 | "upstream-openbsd/lib/libc/stdio/fwide.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 499 | "upstream-openbsd/lib/libc/stdio/getdelim.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 500 | "upstream-openbsd/lib/libc/stdio/gets.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 501 | "upstream-openbsd/lib/libc/stdio/makebuf.c", |
| 502 | "upstream-openbsd/lib/libc/stdio/mktemp.c", |
| 503 | "upstream-openbsd/lib/libc/stdio/open_memstream.c", |
| 504 | "upstream-openbsd/lib/libc/stdio/open_wmemstream.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 505 | "upstream-openbsd/lib/libc/stdio/rget.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 506 | "upstream-openbsd/lib/libc/stdio/setvbuf.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 507 | "upstream-openbsd/lib/libc/stdio/ungetc.c", |
| 508 | "upstream-openbsd/lib/libc/stdio/ungetwc.c", |
| 509 | "upstream-openbsd/lib/libc/stdio/vasprintf.c", |
| 510 | "upstream-openbsd/lib/libc/stdio/vdprintf.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 511 | "upstream-openbsd/lib/libc/stdio/vsscanf.c", |
| 512 | "upstream-openbsd/lib/libc/stdio/vswprintf.c", |
| 513 | "upstream-openbsd/lib/libc/stdio/vswscanf.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 514 | "upstream-openbsd/lib/libc/stdio/wbuf.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 515 | "upstream-openbsd/lib/libc/stdio/wsetup.c", |
| 516 | "upstream-openbsd/lib/libc/stdlib/abs.c", |
Elliott Hughes | 01809e1 | 2019-02-05 16:48:22 -0800 | [diff] [blame] | 517 | "upstream-openbsd/lib/libc/stdlib/div.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 518 | "upstream-openbsd/lib/libc/stdlib/getenv.c", |
Colin Cross | b839610 | 2016-04-07 13:24:50 -0700 | [diff] [blame] | 519 | "upstream-openbsd/lib/libc/stdlib/getsubopt.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 520 | "upstream-openbsd/lib/libc/stdlib/insque.c", |
| 521 | "upstream-openbsd/lib/libc/stdlib/imaxabs.c", |
| 522 | "upstream-openbsd/lib/libc/stdlib/imaxdiv.c", |
| 523 | "upstream-openbsd/lib/libc/stdlib/labs.c", |
Elliott Hughes | 01809e1 | 2019-02-05 16:48:22 -0800 | [diff] [blame] | 524 | "upstream-openbsd/lib/libc/stdlib/ldiv.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 525 | "upstream-openbsd/lib/libc/stdlib/llabs.c", |
Elliott Hughes | 01809e1 | 2019-02-05 16:48:22 -0800 | [diff] [blame] | 526 | "upstream-openbsd/lib/libc/stdlib/lldiv.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 527 | "upstream-openbsd/lib/libc/stdlib/lsearch.c", |
Elliott Hughes | 26b0607 | 2020-07-31 11:00:10 -0700 | [diff] [blame] | 528 | "upstream-openbsd/lib/libc/stdlib/recallocarray.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 529 | "upstream-openbsd/lib/libc/stdlib/remque.c", |
| 530 | "upstream-openbsd/lib/libc/stdlib/setenv.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 531 | "upstream-openbsd/lib/libc/stdlib/tfind.c", |
| 532 | "upstream-openbsd/lib/libc/stdlib/tsearch.c", |
Elliott Hughes | fbac97a | 2019-02-04 16:46:24 -0800 | [diff] [blame] | 533 | "upstream-openbsd/lib/libc/string/memccpy.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 534 | "upstream-openbsd/lib/libc/string/strcasecmp.c", |
Elliott Hughes | fbac97a | 2019-02-04 16:46:24 -0800 | [diff] [blame] | 535 | "upstream-openbsd/lib/libc/string/strcasestr.c", |
| 536 | "upstream-openbsd/lib/libc/string/strcoll.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 537 | "upstream-openbsd/lib/libc/string/strcspn.c", |
| 538 | "upstream-openbsd/lib/libc/string/strdup.c", |
| 539 | "upstream-openbsd/lib/libc/string/strndup.c", |
| 540 | "upstream-openbsd/lib/libc/string/strpbrk.c", |
| 541 | "upstream-openbsd/lib/libc/string/strsep.c", |
| 542 | "upstream-openbsd/lib/libc/string/strspn.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 543 | "upstream-openbsd/lib/libc/string/strtok.c", |
Elliott Hughes | fbac97a | 2019-02-04 16:46:24 -0800 | [diff] [blame] | 544 | "upstream-openbsd/lib/libc/string/strxfrm.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 545 | "upstream-openbsd/lib/libc/string/wcslcpy.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 546 | "upstream-openbsd/lib/libc/string/wcswidth.c", |
| 547 | ], |
| 548 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 549 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 550 | "-Wno-sign-compare", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 551 | "-Wno-unused-parameter", |
| 552 | "-include openbsd-compat.h", |
| 553 | ], |
| 554 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 555 | local_include_dirs: [ |
| 556 | "private", |
| 557 | "stdio", |
| 558 | "upstream-openbsd/android/include", |
| 559 | "upstream-openbsd/lib/libc/include", |
| 560 | "upstream-openbsd/lib/libc/gdtoa/", |
| 561 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 562 | } |
| 563 | |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 564 | cc_library_static { |
| 565 | name: "libc_openbsd_large_stack", |
| 566 | defaults: ["libc_defaults"], |
| 567 | srcs: [ |
Elliott Hughes | 2f9c8ce | 2017-11-01 13:54:47 -0700 | [diff] [blame] | 568 | "stdio/vfprintf.cpp", |
| 569 | "stdio/vfwprintf.cpp", |
Elliott Hughes | 5633caa | 2020-08-06 14:32:43 -0700 | [diff] [blame] | 570 | "upstream-openbsd/lib/libc/string/memmem.c", |
Elliott Hughes | c6b38ae | 2019-11-22 11:15:42 -0800 | [diff] [blame] | 571 | "upstream-openbsd/lib/libc/string/strstr.c", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 572 | ], |
| 573 | cflags: [ |
| 574 | "-include openbsd-compat.h", |
| 575 | "-Wno-sign-compare", |
| 576 | "-Wframe-larger-than=5000", |
| 577 | ], |
| 578 | |
| 579 | local_include_dirs: [ |
Elliott Hughes | e1dc4f6 | 2021-01-11 11:51:29 -0800 | [diff] [blame] | 580 | "private", |
Elliott Hughes | 3a589c2 | 2017-10-30 11:43:58 -0700 | [diff] [blame] | 581 | "upstream-openbsd/android/include/", |
| 582 | "upstream-openbsd/lib/libc/include/", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 583 | "upstream-openbsd/lib/libc/gdtoa/", |
Elliott Hughes | 3a589c2 | 2017-10-30 11:43:58 -0700 | [diff] [blame] | 584 | "upstream-openbsd/lib/libc/stdio/", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 585 | ], |
| 586 | } |
| 587 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 588 | // ======================================================== |
| 589 | // libc_openbsd.a - upstream OpenBSD C library code |
| 590 | // ======================================================== |
| 591 | // |
| 592 | // These files are built with the openbsd-compat.h header file |
| 593 | // automatically included. |
| 594 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 595 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 596 | srcs: [ |
Elliott Hughes | 211c4d3 | 2018-02-02 15:10:32 -0800 | [diff] [blame] | 597 | // These two depend on getentropy, which isn't in libc_ndk.a. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 598 | "upstream-openbsd/lib/libc/crypt/arc4random.c", |
| 599 | "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c", |
| 600 | |
| 601 | // May be overriden by per-arch optimized versions |
| 602 | "upstream-openbsd/lib/libc/string/memchr.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 603 | "upstream-openbsd/lib/libc/string/memrchr.c", |
| 604 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 605 | "upstream-openbsd/lib/libc/string/stpncpy.c", |
| 606 | "upstream-openbsd/lib/libc/string/strcat.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 607 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 608 | "upstream-openbsd/lib/libc/string/strlcat.c", |
| 609 | "upstream-openbsd/lib/libc/string/strlcpy.c", |
| 610 | "upstream-openbsd/lib/libc/string/strncat.c", |
| 611 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 612 | "upstream-openbsd/lib/libc/string/strncpy.c", |
| 613 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 614 | |
| 615 | arch: { |
| 616 | arm: { |
| 617 | exclude_srcs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 618 | "upstream-openbsd/lib/libc/string/strcpy.c", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 619 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 620 | "upstream-openbsd/lib/libc/string/strcat.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 621 | ], |
| 622 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 623 | arm64: { |
| 624 | exclude_srcs: [ |
| 625 | "upstream-openbsd/lib/libc/string/memchr.c", |
Peter Collingbourne | 2361d4e | 2020-06-03 16:55:37 -0700 | [diff] [blame] | 626 | "upstream-openbsd/lib/libc/string/memrchr.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 627 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 628 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 629 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 630 | ], |
| 631 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 632 | x86: { |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 633 | exclude_srcs: [ |
| 634 | "upstream-openbsd/lib/libc/string/memchr.c", |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 635 | "upstream-openbsd/lib/libc/string/memrchr.c", |
| 636 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 637 | "upstream-openbsd/lib/libc/string/stpncpy.c", |
| 638 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 639 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 640 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 641 | "upstream-openbsd/lib/libc/string/strncpy.c", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 642 | "upstream-openbsd/lib/libc/string/strlcat.c", |
| 643 | "upstream-openbsd/lib/libc/string/strlcpy.c", |
| 644 | "upstream-openbsd/lib/libc/string/strncat.c", |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 645 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 646 | }, |
| 647 | |
| 648 | x86_64: { |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 649 | exclude_srcs: [ |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 650 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 651 | "upstream-openbsd/lib/libc/string/stpncpy.c", |
| 652 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 653 | "upstream-openbsd/lib/libc/string/strcpy.c", |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 654 | "upstream-openbsd/lib/libc/string/strncat.c", |
| 655 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 656 | "upstream-openbsd/lib/libc/string/strncpy.c", |
| 657 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 658 | }, |
| 659 | }, |
| 660 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 661 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 662 | "-Wno-sign-compare", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 663 | "-Wno-unused-parameter", |
| 664 | "-include openbsd-compat.h", |
| 665 | ], |
| 666 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 667 | local_include_dirs: [ |
| 668 | "private", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 669 | "upstream-openbsd/android/include", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 670 | ], |
| 671 | |
| 672 | name: "libc_openbsd", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 673 | } |
| 674 | |
| 675 | // ======================================================== |
| 676 | // libc_gdtoa.a - upstream OpenBSD C library gdtoa code |
| 677 | // ======================================================== |
| 678 | // |
| 679 | // These files are built with the openbsd-compat.h header file |
| 680 | // automatically included. |
| 681 | |
| 682 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 683 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 684 | srcs: [ |
| 685 | "upstream-openbsd/android/gdtoa_support.cpp", |
| 686 | "upstream-openbsd/lib/libc/gdtoa/dmisc.c", |
| 687 | "upstream-openbsd/lib/libc/gdtoa/dtoa.c", |
| 688 | "upstream-openbsd/lib/libc/gdtoa/gdtoa.c", |
| 689 | "upstream-openbsd/lib/libc/gdtoa/gethex.c", |
| 690 | "upstream-openbsd/lib/libc/gdtoa/gmisc.c", |
| 691 | "upstream-openbsd/lib/libc/gdtoa/hd_init.c", |
| 692 | "upstream-openbsd/lib/libc/gdtoa/hdtoa.c", |
| 693 | "upstream-openbsd/lib/libc/gdtoa/hexnan.c", |
| 694 | "upstream-openbsd/lib/libc/gdtoa/ldtoa.c", |
| 695 | "upstream-openbsd/lib/libc/gdtoa/misc.c", |
| 696 | "upstream-openbsd/lib/libc/gdtoa/smisc.c", |
| 697 | "upstream-openbsd/lib/libc/gdtoa/strtod.c", |
| 698 | "upstream-openbsd/lib/libc/gdtoa/strtodg.c", |
| 699 | "upstream-openbsd/lib/libc/gdtoa/strtof.c", |
| 700 | "upstream-openbsd/lib/libc/gdtoa/strtord.c", |
| 701 | "upstream-openbsd/lib/libc/gdtoa/sum.c", |
| 702 | "upstream-openbsd/lib/libc/gdtoa/ulp.c", |
| 703 | ], |
| 704 | multilib: { |
| 705 | lib64: { |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 706 | srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 707 | }, |
| 708 | }, |
| 709 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 710 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 711 | "-Wno-sign-compare", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 712 | "-include openbsd-compat.h", |
| 713 | ], |
| 714 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 715 | local_include_dirs: [ |
| 716 | "private", |
| 717 | "upstream-openbsd/android/include", |
| 718 | "upstream-openbsd/lib/libc/include", |
| 719 | ], |
| 720 | |
| 721 | name: "libc_gdtoa", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 722 | } |
| 723 | |
| 724 | // ======================================================== |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 725 | // libc_fortify.a - container for our FORITFY |
| 726 | // implementation details |
| 727 | // ======================================================== |
| 728 | cc_library_static { |
| 729 | defaults: ["libc_defaults"], |
George Burgess IV | d34b0a9 | 2017-07-25 11:43:39 -0700 | [diff] [blame] | 730 | srcs: ["bionic/fortify.cpp"], |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 731 | |
| 732 | name: "libc_fortify", |
| 733 | |
| 734 | // Disable FORTIFY for the compilation of these, so we don't end up having |
| 735 | // FORTIFY silently call itself. |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 736 | cflags: [ |
| 737 | "-U_FORTIFY_SOURCE", |
| 738 | "-D__BIONIC_DECLARE_FORTIFY_HELPERS", |
| 739 | ], |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 740 | |
| 741 | arch: { |
| 742 | arm: { |
Haibo Huang | f1c8d1a | 2018-11-27 15:38:47 -0800 | [diff] [blame] | 743 | cflags: [ |
| 744 | "-DNO___MEMCPY_CHK", |
| 745 | "-DRENAME___STRCAT_CHK", |
| 746 | "-DRENAME___STRCPY_CHK", |
| 747 | ], |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 748 | srcs: [ |
| 749 | "arch-arm/generic/bionic/__memcpy_chk.S", |
Haibo Huang | f1c8d1a | 2018-11-27 15:38:47 -0800 | [diff] [blame] | 750 | |
| 751 | "arch-arm/cortex-a15/bionic/__strcat_chk.S", |
| 752 | "arch-arm/cortex-a15/bionic/__strcpy_chk.S", |
| 753 | |
| 754 | "arch-arm/cortex-a7/bionic/__strcat_chk.S", |
| 755 | "arch-arm/cortex-a7/bionic/__strcpy_chk.S", |
| 756 | |
| 757 | "arch-arm/cortex-a9/bionic/__strcat_chk.S", |
| 758 | "arch-arm/cortex-a9/bionic/__strcpy_chk.S", |
| 759 | |
| 760 | "arch-arm/krait/bionic/__strcat_chk.S", |
| 761 | "arch-arm/krait/bionic/__strcpy_chk.S", |
| 762 | |
| 763 | "arch-arm/cortex-a53/bionic/__strcat_chk.S", |
| 764 | "arch-arm/cortex-a53/bionic/__strcpy_chk.S", |
| 765 | |
Haibo Huang | 01bfd89 | 2018-12-03 15:05:16 -0800 | [diff] [blame] | 766 | "arch-arm/cortex-a55/bionic/__strcat_chk.S", |
| 767 | "arch-arm/cortex-a55/bionic/__strcpy_chk.S", |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 768 | ], |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 769 | }, |
| 770 | arm64: { |
George Burgess IV | d34b0a9 | 2017-07-25 11:43:39 -0700 | [diff] [blame] | 771 | cflags: ["-DNO___MEMCPY_CHK"], |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 772 | srcs: [ |
| 773 | "arch-arm64/generic/bionic/__memcpy_chk.S", |
| 774 | ], |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 775 | }, |
| 776 | }, |
| 777 | } |
| 778 | |
| 779 | // ======================================================== |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 780 | // libc_bionic.a - home-grown C library code |
| 781 | // ======================================================== |
| 782 | |
| 783 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 784 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 785 | srcs: [ |
Elliott Hughes | 211c4d3 | 2018-02-02 15:10:32 -0800 | [diff] [blame] | 786 | // These require getauxval, which isn't available on older platforms. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 787 | "bionic/sysconf.cpp", |
| 788 | "bionic/vdso.cpp", |
Dan Willemsen | 35e91a1 | 2015-09-17 15:28:45 -0700 | [diff] [blame] | 789 | "bionic/setjmp_cookie.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 790 | |
Josh Gao | 10ec928 | 2017-04-03 15:13:29 -0700 | [diff] [blame] | 791 | // The following must not be statically linked into libc_ndk.a, because |
| 792 | // debuggerd will look for the abort message in libc.so's copy. |
| 793 | "bionic/android_set_abort_message.cpp", |
| 794 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 795 | "bionic/strchr.cpp", |
Peter Collingbourne | 337a5b3 | 2020-02-21 12:11:02 -0800 | [diff] [blame] | 796 | "bionic/strchrnul.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 797 | "bionic/strnlen.c", |
| 798 | "bionic/strrchr.cpp", |
| 799 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 800 | |
| 801 | arch: { |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 802 | arm: { |
Elliott Hughes | 1b61d78 | 2019-06-04 10:38:34 -0700 | [diff] [blame] | 803 | asflags: libc_common_flags + ["-mno-restrict-it"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 804 | srcs: [ |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 805 | "arch-arm/generic/bionic/memcmp.S", |
Elliott Hughes | da46cae | 2018-05-24 14:40:32 -0700 | [diff] [blame] | 806 | "arch-arm/generic/bionic/memmove.S", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 807 | "arch-arm/generic/bionic/memset.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 808 | "arch-arm/generic/bionic/stpcpy.c", |
| 809 | "arch-arm/generic/bionic/strcat.c", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 810 | "arch-arm/generic/bionic/strcmp.S", |
| 811 | "arch-arm/generic/bionic/strcpy.S", |
| 812 | "arch-arm/generic/bionic/strlen.c", |
| 813 | |
Ryan Prichard | 45024fe | 2018-12-30 21:10:26 -0800 | [diff] [blame] | 814 | "arch-arm/bionic/__aeabi_read_tp.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 815 | "arch-arm/bionic/__bionic_clone.S", |
Yi Kong | b410d0e | 2019-04-22 16:00:46 -0700 | [diff] [blame] | 816 | "arch-arm/bionic/__restore.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 817 | "arch-arm/bionic/_exit_with_stack_teardown.S", |
Yi Kong | b410d0e | 2019-04-22 16:00:46 -0700 | [diff] [blame] | 818 | "arch-arm/bionic/atomics_arm.c", |
| 819 | "arch-arm/bionic/bpabi.c", |
Yi Kong | 165b1cf | 2019-02-13 14:10:10 -0800 | [diff] [blame] | 820 | "arch-arm/bionic/libcrt_compat.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 821 | "arch-arm/bionic/popcount_tab.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 822 | "arch-arm/bionic/setjmp.S", |
| 823 | "arch-arm/bionic/syscall.S", |
| 824 | "arch-arm/bionic/vfork.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 825 | |
| 826 | "arch-arm/cortex-a15/bionic/memcpy.S", |
| 827 | "arch-arm/cortex-a15/bionic/memmove.S", |
| 828 | "arch-arm/cortex-a15/bionic/memset.S", |
| 829 | "arch-arm/cortex-a15/bionic/stpcpy.S", |
| 830 | "arch-arm/cortex-a15/bionic/strcat.S", |
| 831 | "arch-arm/cortex-a15/bionic/strcmp.S", |
| 832 | "arch-arm/cortex-a15/bionic/strcpy.S", |
| 833 | "arch-arm/cortex-a15/bionic/strlen.S", |
| 834 | |
| 835 | "arch-arm/cortex-a7/bionic/memcpy.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 836 | "arch-arm/cortex-a7/bionic/memset.S", |
| 837 | |
| 838 | "arch-arm/cortex-a9/bionic/memcpy.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 839 | "arch-arm/cortex-a9/bionic/memset.S", |
| 840 | "arch-arm/cortex-a9/bionic/stpcpy.S", |
| 841 | "arch-arm/cortex-a9/bionic/strcat.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 842 | "arch-arm/cortex-a9/bionic/strcpy.S", |
| 843 | "arch-arm/cortex-a9/bionic/strlen.S", |
| 844 | |
| 845 | "arch-arm/krait/bionic/memcpy.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 846 | "arch-arm/krait/bionic/memset.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 847 | |
| 848 | "arch-arm/cortex-a53/bionic/memcpy.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 849 | |
Haibo Huang | 01bfd89 | 2018-12-03 15:05:16 -0800 | [diff] [blame] | 850 | "arch-arm/cortex-a55/bionic/memcpy.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 851 | |
| 852 | "arch-arm/kryo/bionic/memcpy.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 853 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 854 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 855 | arm64: { |
| 856 | srcs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 857 | "arch-arm64/generic/bionic/memcpy.S", |
| 858 | "arch-arm64/generic/bionic/memmove.S", |
| 859 | "arch-arm64/generic/bionic/memset.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 860 | "arch-arm64/generic/bionic/wmemmove.S", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 861 | |
| 862 | "arch-arm64/bionic/__bionic_clone.S", |
| 863 | "arch-arm64/bionic/_exit_with_stack_teardown.S", |
| 864 | "arch-arm64/bionic/setjmp.S", |
| 865 | "arch-arm64/bionic/syscall.S", |
| 866 | "arch-arm64/bionic/vfork.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 867 | ], |
| 868 | exclude_srcs: [ |
| 869 | "bionic/__memcpy_chk.cpp", |
| 870 | "bionic/strchr.cpp", |
Peter Collingbourne | 337a5b3 | 2020-02-21 12:11:02 -0800 | [diff] [blame] | 871 | "bionic/strchrnul.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 872 | "bionic/strnlen.c", |
Peter Collingbourne | 337a5b3 | 2020-02-21 12:11:02 -0800 | [diff] [blame] | 873 | "bionic/strrchr.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 874 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 875 | }, |
| 876 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 877 | x86: { |
| 878 | srcs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 879 | "arch-x86/generic/string/memcmp.S", |
| 880 | "arch-x86/generic/string/strcmp.S", |
| 881 | "arch-x86/generic/string/strncmp.S", |
| 882 | "arch-x86/generic/string/strcat.S", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 883 | |
| 884 | "arch-x86/generic/string/strlcat.c", |
| 885 | "arch-x86/generic/string/strlcpy.c", |
| 886 | "arch-x86/generic/string/strncat.c", |
| 887 | "arch-x86/generic/string/wcscat.c", |
| 888 | "arch-x86/generic/string/wcscpy.c", |
| 889 | "arch-x86/generic/string/wmemcmp.c", |
Shalini Salomi Bodapati | 4ed2f47 | 2019-06-13 09:54:08 +0530 | [diff] [blame] | 890 | "arch-x86/generic/string/wmemset.c", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 891 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 892 | "arch-x86/atom/string/sse2-memchr-atom.S", |
| 893 | "arch-x86/atom/string/sse2-memrchr-atom.S", |
| 894 | "arch-x86/atom/string/sse2-strchr-atom.S", |
| 895 | "arch-x86/atom/string/sse2-strnlen-atom.S", |
| 896 | "arch-x86/atom/string/sse2-strrchr-atom.S", |
| 897 | "arch-x86/atom/string/sse2-wcschr-atom.S", |
| 898 | "arch-x86/atom/string/sse2-wcsrchr-atom.S", |
| 899 | "arch-x86/atom/string/sse2-wcslen-atom.S", |
| 900 | "arch-x86/atom/string/sse2-wcscmp-atom.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 901 | "arch-x86/silvermont/string/sse2-memmove-slm.S", |
| 902 | "arch-x86/silvermont/string/sse2-memset-slm.S", |
| 903 | "arch-x86/silvermont/string/sse2-stpcpy-slm.S", |
| 904 | "arch-x86/silvermont/string/sse2-stpncpy-slm.S", |
| 905 | "arch-x86/silvermont/string/sse2-strcpy-slm.S", |
| 906 | "arch-x86/silvermont/string/sse2-strlen-slm.S", |
| 907 | "arch-x86/silvermont/string/sse2-strncpy-slm.S", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 908 | |
| 909 | "arch-x86/bionic/__bionic_clone.S", |
| 910 | "arch-x86/bionic/_exit_with_stack_teardown.S", |
Yi Kong | 165b1cf | 2019-02-13 14:10:10 -0800 | [diff] [blame] | 911 | "arch-x86/bionic/libcrt_compat.c", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 912 | "arch-x86/bionic/__restore.S", |
| 913 | "arch-x86/bionic/setjmp.S", |
| 914 | "arch-x86/bionic/syscall.S", |
| 915 | "arch-x86/bionic/vfork.S", |
Ryan Prichard | a992a06 | 2020-04-18 02:59:24 -0700 | [diff] [blame] | 916 | "arch-x86/bionic/__x86.get_pc_thunk.S", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 917 | |
| 918 | // ssse3 functions |
| 919 | "arch-x86/atom/string/ssse3-strcat-atom.S", |
| 920 | "arch-x86/atom/string/ssse3-strcmp-atom.S", |
| 921 | "arch-x86/atom/string/ssse3-strlcat-atom.S", |
| 922 | "arch-x86/atom/string/ssse3-strlcpy-atom.S", |
| 923 | "arch-x86/atom/string/ssse3-strncat-atom.S", |
| 924 | "arch-x86/atom/string/ssse3-strncmp-atom.S", |
| 925 | "arch-x86/atom/string/ssse3-wcscat-atom.S", |
| 926 | "arch-x86/atom/string/ssse3-wcscpy-atom.S", |
| 927 | |
| 928 | // sse4 functions |
| 929 | "arch-x86/silvermont/string/sse4-memcmp-slm.S", |
| 930 | "arch-x86/silvermont/string/sse4-wmemcmp-slm.S", |
| 931 | |
| 932 | // atom functions |
| 933 | "arch-x86/atom/string/sse2-memset-atom.S", |
| 934 | "arch-x86/atom/string/sse2-strlen-atom.S", |
| 935 | "arch-x86/atom/string/ssse3-memcmp-atom.S", |
Haibo Huang | e141362 | 2018-11-13 14:20:43 -0800 | [diff] [blame] | 936 | "arch-x86/atom/string/ssse3-memmove-atom.S", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 937 | "arch-x86/atom/string/ssse3-strcpy-atom.S", |
| 938 | "arch-x86/atom/string/ssse3-strncpy-atom.S", |
| 939 | "arch-x86/atom/string/ssse3-wmemcmp-atom.S", |
Shalini Salomi Bodapati | 4ed2f47 | 2019-06-13 09:54:08 +0530 | [diff] [blame] | 940 | |
| 941 | // avx2 functions |
| 942 | "arch-x86/kabylake/string/avx2-wmemset-kbl.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 943 | ], |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 944 | |
| 945 | exclude_srcs: [ |
| 946 | "bionic/strchr.cpp", |
| 947 | "bionic/strnlen.c", |
| 948 | "bionic/strrchr.cpp", |
| 949 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 950 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 951 | x86_64: { |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 952 | srcs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 953 | "arch-x86_64/string/sse2-memmove-slm.S", |
| 954 | "arch-x86_64/string/sse2-memset-slm.S", |
| 955 | "arch-x86_64/string/sse2-stpcpy-slm.S", |
| 956 | "arch-x86_64/string/sse2-stpncpy-slm.S", |
| 957 | "arch-x86_64/string/sse2-strcat-slm.S", |
| 958 | "arch-x86_64/string/sse2-strcpy-slm.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 959 | "arch-x86_64/string/sse2-strlen-slm.S", |
| 960 | "arch-x86_64/string/sse2-strncat-slm.S", |
| 961 | "arch-x86_64/string/sse2-strncpy-slm.S", |
| 962 | "arch-x86_64/string/sse4-memcmp-slm.S", |
| 963 | "arch-x86_64/string/ssse3-strcmp-slm.S", |
| 964 | "arch-x86_64/string/ssse3-strncmp-slm.S", |
Shalini Salomi Bodapati | 4ed2f47 | 2019-06-13 09:54:08 +0530 | [diff] [blame] | 965 | "arch-x86_64/string/avx2-wmemset-kbl.S", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 966 | |
| 967 | "arch-x86_64/bionic/__bionic_clone.S", |
| 968 | "arch-x86_64/bionic/_exit_with_stack_teardown.S", |
| 969 | "arch-x86_64/bionic/__restore_rt.S", |
| 970 | "arch-x86_64/bionic/setjmp.S", |
| 971 | "arch-x86_64/bionic/syscall.S", |
| 972 | "arch-x86_64/bionic/vfork.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 973 | ], |
| 974 | }, |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 975 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 976 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 977 | cppflags: ["-Wold-style-cast"], |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 978 | include_dirs: ["bionic/libstdc++/include"], |
| 979 | name: "libc_bionic", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 980 | } |
| 981 | |
Elliott Hughes | 3f6eee9 | 2016-12-13 23:47:25 +0000 | [diff] [blame] | 982 | genrule { |
| 983 | name: "generated_android_ids", |
Colin Cross | 35bbed8 | 2017-01-17 18:16:07 -0800 | [diff] [blame] | 984 | out: ["generated_android_ids.h"], |
| 985 | srcs: [":android_filesystem_config_header"], |
| 986 | tool_files: ["fs_config_generator.py"], |
| 987 | cmd: "$(location fs_config_generator.py) aidarray $(in) > $(out)", |
Elliott Hughes | 3f6eee9 | 2016-12-13 23:47:25 +0000 | [diff] [blame] | 988 | } |
| 989 | |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 990 | // ======================================================== |
| 991 | // libc_bionic_ndk.a- The portions of libc_bionic that can |
| 992 | // be safely used in libc_ndk.a (no troublesome global data |
| 993 | // or constructors). |
| 994 | // ======================================================== |
| 995 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 996 | defaults: ["libc_defaults"], |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 997 | srcs: [ |
Dan Albert | e2fd010 | 2017-07-11 14:27:07 -0700 | [diff] [blame] | 998 | "bionic/NetdClientDispatch.cpp", |
Sandeep Patil | 9b1ca56 | 2017-08-21 12:17:19 -0700 | [diff] [blame] | 999 | "bionic/__bionic_get_shell_path.cpp", |
Dan Albert | e2fd010 | 2017-07-11 14:27:07 -0700 | [diff] [blame] | 1000 | "bionic/__cmsg_nxthdr.cpp", |
| 1001 | "bionic/__errno.cpp", |
| 1002 | "bionic/__gnu_basename.cpp", |
| 1003 | "bionic/__libc_current_sigrtmax.cpp", |
| 1004 | "bionic/__libc_current_sigrtmin.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1005 | "bionic/abort.cpp", |
| 1006 | "bionic/accept.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1007 | "bionic/access.cpp", |
| 1008 | "bionic/arpa_inet.cpp", |
| 1009 | "bionic/assert.cpp", |
| 1010 | "bionic/atof.cpp", |
Bram Bonné | 95ca52a | 2020-12-03 19:03:55 +0100 | [diff] [blame] | 1011 | "bionic/bind.cpp", |
Ryan Prichard | 083d850 | 2019-01-24 13:47:13 -0800 | [diff] [blame] | 1012 | "bionic/bionic_allocator.cpp", |
Bram Bonné | 95ca52a | 2020-12-03 19:03:55 +0100 | [diff] [blame] | 1013 | "bionic/bionic_appcompat.cpp", |
Josh Gao | a170d9b | 2016-11-10 16:08:29 -0800 | [diff] [blame] | 1014 | "bionic/bionic_arc4random.cpp", |
Tom Cherry | ac49ced | 2017-08-17 13:18:52 -0700 | [diff] [blame] | 1015 | "bionic/bionic_futex.cpp", |
Colin Cross | 8ce38af | 2016-01-19 12:50:20 -0800 | [diff] [blame] | 1016 | "bionic/bionic_netlink.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1017 | "bionic/bionic_time_conversions.cpp", |
| 1018 | "bionic/brk.cpp", |
| 1019 | "bionic/c16rtomb.cpp", |
| 1020 | "bionic/c32rtomb.cpp", |
| 1021 | "bionic/chmod.cpp", |
| 1022 | "bionic/chown.cpp", |
| 1023 | "bionic/clearenv.cpp", |
| 1024 | "bionic/clock.cpp", |
| 1025 | "bionic/clock_getcpuclockid.cpp", |
| 1026 | "bionic/clock_nanosleep.cpp", |
| 1027 | "bionic/clone.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1028 | "bionic/ctype.cpp", |
| 1029 | "bionic/dirent.cpp", |
Josh Gao | 9727192 | 2019-11-06 13:15:00 -0800 | [diff] [blame] | 1030 | "bionic/dup.cpp", |
Victor Khimenko | 0a0743f | 2017-07-10 21:15:37 +0200 | [diff] [blame] | 1031 | "bionic/environ.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1032 | "bionic/error.cpp", |
Josh Gao | 7de4124 | 2020-04-29 17:08:46 -0700 | [diff] [blame] | 1033 | "bionic/eventfd.cpp", |
Elliott Hughes | e19c672 | 2016-08-26 16:15:57 +0000 | [diff] [blame] | 1034 | "bionic/exec.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1035 | "bionic/faccessat.cpp", |
| 1036 | "bionic/fchmod.cpp", |
| 1037 | "bionic/fchmodat.cpp", |
Josh Gao | 9727192 | 2019-11-06 13:15:00 -0800 | [diff] [blame] | 1038 | "bionic/fcntl.cpp", |
Josh Gao | f6e5b58 | 2018-06-01 15:30:54 -0700 | [diff] [blame] | 1039 | "bionic/fdsan.cpp", |
Josh Gao | 9727192 | 2019-11-06 13:15:00 -0800 | [diff] [blame] | 1040 | "bionic/fdtrack.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1041 | "bionic/ffs.cpp", |
| 1042 | "bionic/fgetxattr.cpp", |
| 1043 | "bionic/flistxattr.cpp", |
| 1044 | "bionic/flockfile.cpp", |
| 1045 | "bionic/fpclassify.cpp", |
| 1046 | "bionic/fsetxattr.cpp", |
| 1047 | "bionic/ftruncate.cpp", |
Elliott Hughes | 13d79ab | 2016-04-15 17:40:33 -0700 | [diff] [blame] | 1048 | "bionic/ftw.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1049 | "bionic/futimens.cpp", |
| 1050 | "bionic/getcwd.cpp", |
Dan Willemsen | 23aae1c | 2016-03-29 15:21:38 -0700 | [diff] [blame] | 1051 | "bionic/getdomainname.cpp", |
Elliott Hughes | 211c4d3 | 2018-02-02 15:10:32 -0800 | [diff] [blame] | 1052 | "bionic/getentropy.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1053 | "bionic/gethostname.cpp", |
Elliott Hughes | 2d0b28b | 2018-10-23 11:23:00 -0700 | [diff] [blame] | 1054 | "bionic/getloadavg.cpp", |
Elliott Hughes | e4510a2 | 2016-04-06 08:34:58 -0700 | [diff] [blame] | 1055 | "bionic/getpagesize.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1056 | "bionic/getpgrp.cpp", |
| 1057 | "bionic/getpid.cpp", |
Elliott Hughes | 8f0e42f | 2016-11-29 15:10:29 -0800 | [diff] [blame] | 1058 | "bionic/getpriority.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1059 | "bionic/gettid.cpp", |
Elliott Hughes | ce934e3 | 2018-09-06 13:26:08 -0700 | [diff] [blame] | 1060 | "bionic/get_device_api_level.cpp", |
Mark Salyzyn | b38347a | 2016-04-05 09:09:46 -0700 | [diff] [blame] | 1061 | "bionic/grp_pwd.cpp", |
Tom Cherry | 6034ef8 | 2018-02-02 16:10:07 -0800 | [diff] [blame] | 1062 | "bionic/grp_pwd_file.cpp", |
Mitch Phillips | 9cad842 | 2021-01-20 16:03:27 -0800 | [diff] [blame] | 1063 | "bionic/heap_zero_init.cpp", |
Elliott Hughes | a648733 | 2017-08-15 23:16:48 -0700 | [diff] [blame] | 1064 | "bionic/iconv.cpp", |
Elliott Hughes | c41b560 | 2017-07-27 17:08:08 -0700 | [diff] [blame] | 1065 | "bionic/icu_wrappers.cpp", |
Dan Willemsen | 9b59acc | 2016-01-05 14:32:06 -0800 | [diff] [blame] | 1066 | "bionic/ifaddrs.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1067 | "bionic/inotify_init.cpp", |
Dan Willemsen | dc6b0a7 | 2015-11-09 14:03:46 -0800 | [diff] [blame] | 1068 | "bionic/ioctl.cpp", |
Elliott Hughes | 7532b32 | 2017-07-11 15:00:17 -0700 | [diff] [blame] | 1069 | "bionic/killpg.cpp", |
Elliott Hughes | fc8e688 | 2016-11-18 16:27:29 -0800 | [diff] [blame] | 1070 | "bionic/langinfo.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1071 | "bionic/lchown.cpp", |
| 1072 | "bionic/lfs64_support.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1073 | "bionic/libc_init_common.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1074 | "bionic/libgen.cpp", |
| 1075 | "bionic/link.cpp", |
| 1076 | "bionic/locale.cpp", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 1077 | "bionic/lockf.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1078 | "bionic/lstat.cpp", |
Colin Cross | ee84786 | 2016-04-29 14:06:07 -0700 | [diff] [blame] | 1079 | "bionic/mblen.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1080 | "bionic/mbrtoc16.cpp", |
| 1081 | "bionic/mbrtoc32.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1082 | "bionic/mempcpy.cpp", |
| 1083 | "bionic/mkdir.cpp", |
| 1084 | "bionic/mkfifo.cpp", |
| 1085 | "bionic/mknod.cpp", |
| 1086 | "bionic/mntent.cpp", |
Dan Willemsen | dc6b0a7 | 2015-11-09 14:03:46 -0800 | [diff] [blame] | 1087 | "bionic/mremap.cpp", |
Colin Cross | 8ce38af | 2016-01-19 12:50:20 -0800 | [diff] [blame] | 1088 | "bionic/net_if.cpp", |
Dan Albert | e2fd010 | 2017-07-11 14:27:07 -0700 | [diff] [blame] | 1089 | "bionic/netdb.cpp", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 1090 | "bionic/netinet_in.cpp", |
Elliott Hughes | 6cfb84b | 2016-04-06 17:14:45 -0700 | [diff] [blame] | 1091 | "bionic/nl_types.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1092 | "bionic/open.cpp", |
| 1093 | "bionic/pathconf.cpp", |
| 1094 | "bionic/pause.cpp", |
| 1095 | "bionic/pipe.cpp", |
| 1096 | "bionic/poll.cpp", |
| 1097 | "bionic/posix_fadvise.cpp", |
| 1098 | "bionic/posix_fallocate.cpp", |
| 1099 | "bionic/posix_madvise.cpp", |
| 1100 | "bionic/posix_timers.cpp", |
| 1101 | "bionic/ptrace.cpp", |
| 1102 | "bionic/pty.cpp", |
| 1103 | "bionic/raise.cpp", |
| 1104 | "bionic/rand.cpp", |
| 1105 | "bionic/readlink.cpp", |
Elliott Hughes | 22fb267 | 2019-11-01 08:07:25 -0700 | [diff] [blame] | 1106 | "bionic/realpath.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1107 | "bionic/reboot.cpp", |
| 1108 | "bionic/recv.cpp", |
Josh Gao | 9727192 | 2019-11-06 13:15:00 -0800 | [diff] [blame] | 1109 | "bionic/recvmsg.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1110 | "bionic/rename.cpp", |
| 1111 | "bionic/rmdir.cpp", |
| 1112 | "bionic/scandir.cpp", |
| 1113 | "bionic/sched_getaffinity.cpp", |
| 1114 | "bionic/sched_getcpu.cpp", |
| 1115 | "bionic/semaphore.cpp", |
| 1116 | "bionic/send.cpp", |
| 1117 | "bionic/setegid.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1118 | "bionic/seteuid.cpp", |
| 1119 | "bionic/setpgrp.cpp", |
| 1120 | "bionic/sigaction.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1121 | "bionic/signal.cpp", |
Elliott Hughes | 7ae3912 | 2018-02-26 16:49:43 -0800 | [diff] [blame] | 1122 | "bionic/sigprocmask.cpp", |
Elliott Hughes | ca3f8e4 | 2019-10-28 15:59:38 -0700 | [diff] [blame] | 1123 | "bionic/sleep.cpp", |
Josh Gao | b107eab | 2020-04-29 17:17:56 -0700 | [diff] [blame] | 1124 | "bionic/socketpair.cpp", |
Elliott Hughes | 14e3ff9 | 2017-10-06 16:58:36 -0700 | [diff] [blame] | 1125 | "bionic/spawn.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1126 | "bionic/stat.cpp", |
Dan Albert | e2fd010 | 2017-07-11 14:27:07 -0700 | [diff] [blame] | 1127 | "bionic/stdlib_l.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1128 | "bionic/strerror.cpp", |
Dan Albert | e2fd010 | 2017-07-11 14:27:07 -0700 | [diff] [blame] | 1129 | "bionic/string_l.cpp", |
| 1130 | "bionic/strings_l.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1131 | "bionic/strsignal.cpp", |
Elliott Hughes | 1921dce | 2017-12-19 10:27:27 -0800 | [diff] [blame] | 1132 | "bionic/strtol.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1133 | "bionic/strtold.cpp", |
Elliott Hughes | fa386e0 | 2017-10-18 13:34:32 -0700 | [diff] [blame] | 1134 | "bionic/swab.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1135 | "bionic/symlink.cpp", |
Colin Cross | fc8ed2f | 2016-04-11 14:51:38 -0700 | [diff] [blame] | 1136 | "bionic/sync_file_range.cpp", |
Elliott Hughes | 5905d6f | 2018-01-30 15:09:51 -0800 | [diff] [blame] | 1137 | "bionic/sys_epoll.cpp", |
Elliott Hughes | 7c59f3f | 2016-08-16 18:14:26 -0700 | [diff] [blame] | 1138 | "bionic/sys_msg.cpp", |
| 1139 | "bionic/sys_sem.cpp", |
| 1140 | "bionic/sys_shm.cpp", |
Elliott Hughes | 6dafb4a | 2018-01-26 17:47:56 -0800 | [diff] [blame] | 1141 | "bionic/sys_signalfd.cpp", |
Elliott Hughes | 261bd74 | 2019-08-29 20:45:14 -0700 | [diff] [blame] | 1142 | "bionic/sys_statfs.cpp", |
| 1143 | "bionic/sys_statvfs.cpp", |
Elliott Hughes | 449eff0 | 2016-06-08 19:51:20 -0700 | [diff] [blame] | 1144 | "bionic/sys_time.cpp", |
Dan Albert | e2fd010 | 2017-07-11 14:27:07 -0700 | [diff] [blame] | 1145 | "bionic/sysinfo.cpp", |
| 1146 | "bionic/syslog.cpp", |
Elliott Hughes | 71ba589 | 2018-02-07 12:44:45 -0800 | [diff] [blame] | 1147 | "bionic/system.cpp", |
Tom Cherry | e275d6d | 2017-12-11 23:31:33 -0800 | [diff] [blame] | 1148 | "bionic/system_property_api.cpp", |
| 1149 | "bionic/system_property_set.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1150 | "bionic/tdestroy.cpp", |
| 1151 | "bionic/termios.cpp", |
| 1152 | "bionic/thread_private.cpp", |
Elliott Hughes | 4206711 | 2019-04-18 14:27:24 -0700 | [diff] [blame] | 1153 | "bionic/threads.cpp", |
Elliott Hughes | f98d87b | 2018-07-17 13:21:05 -0700 | [diff] [blame] | 1154 | "bionic/timespec_get.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1155 | "bionic/tmpfile.cpp", |
| 1156 | "bionic/umount.cpp", |
| 1157 | "bionic/unlink.cpp", |
Elliott Hughes | ca3f8e4 | 2019-10-28 15:59:38 -0700 | [diff] [blame] | 1158 | "bionic/usleep.cpp", |
Elliott Hughes | 9a1d397 | 2020-08-07 15:55:02 -0700 | [diff] [blame] | 1159 | "bionic/utmp.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1160 | "bionic/wait.cpp", |
| 1161 | "bionic/wchar.cpp", |
Dan Albert | e2fd010 | 2017-07-11 14:27:07 -0700 | [diff] [blame] | 1162 | "bionic/wchar_l.cpp", |
Elliott Hughes | 7f0849f | 2016-08-26 16:17:17 -0700 | [diff] [blame] | 1163 | "bionic/wcstod.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1164 | "bionic/wctype.cpp", |
Elliott Hughes | c41b560 | 2017-07-27 17:08:08 -0700 | [diff] [blame] | 1165 | "bionic/wcwidth.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1166 | "bionic/wmempcpy.cpp", |
Josh Gao | 0e0e370 | 2017-10-12 13:34:42 -0700 | [diff] [blame] | 1167 | |
| 1168 | // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp, |
| 1169 | // which will be overridden by the actual one in libc.so. |
| 1170 | "bionic/icu_static.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1171 | ], |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1172 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1173 | multilib: { |
| 1174 | lib32: { |
| 1175 | // LP32 cruft |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 1176 | srcs: ["bionic/mmap.cpp"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1177 | }, |
| 1178 | }, |
Jayant Chowdhary | ab2f79c | 2017-09-01 16:29:44 -0700 | [diff] [blame] | 1179 | product_variables: { |
Steven Moreland | 96bbc5c | 2017-12-13 14:11:26 -0800 | [diff] [blame] | 1180 | treble_linker_namespaces: { |
| 1181 | cflags: ["-DTREBLE_LINKER_NAMESPACES"], |
Jayant Chowdhary | ab2f79c | 2017-09-01 16:29:44 -0700 | [diff] [blame] | 1182 | }, |
| 1183 | }, |
Bowgo Tsai | a9208f3 | 2020-07-24 17:29:52 +0800 | [diff] [blame] | 1184 | whole_static_libs: [ |
Bowgo Tsai | a9208f3 | 2020-07-24 17:29:52 +0800 | [diff] [blame] | 1185 | "libsystemproperties", |
| 1186 | ], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1187 | cppflags: ["-Wold-style-cast"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1188 | local_include_dirs: ["stdio"], |
| 1189 | include_dirs: ["bionic/libstdc++/include"], |
| 1190 | name: "libc_bionic_ndk", |
Elliott Hughes | 3f6eee9 | 2016-12-13 23:47:25 +0000 | [diff] [blame] | 1191 | generated_headers: ["generated_android_ids"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1192 | } |
| 1193 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1194 | // ======================================================== |
Bowgo Tsai | a9208f3 | 2020-07-24 17:29:52 +0800 | [diff] [blame] | 1195 | // libc_bionic_systrace.a |
| 1196 | // ======================================================== |
| 1197 | |
| 1198 | cc_library_static { |
| 1199 | name: "libc_bionic_systrace", |
| 1200 | defaults: ["libc_defaults"], |
| 1201 | srcs: [ |
| 1202 | "bionic/bionic_systrace.cpp", |
| 1203 | ], |
| 1204 | apex_available: [ |
| 1205 | "com.android.runtime", |
| 1206 | ], |
| 1207 | } |
| 1208 | |
| 1209 | // ======================================================== |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1210 | // libc_pthread.a - pthreads parts that previously lived in |
| 1211 | // libc_bionic.a. Relocated to their own library because |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 1212 | // they can't be included in libc_ndk.a (as the layout of |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1213 | // pthread_t has changed over the years and has ABI |
| 1214 | // compatibility issues). |
| 1215 | // ======================================================== |
| 1216 | |
| 1217 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1218 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1219 | srcs: [ |
Ryan Prichard | 45d1349 | 2019-01-03 02:51:30 -0800 | [diff] [blame] | 1220 | "bionic/bionic_elf_tls.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1221 | "bionic/pthread_atfork.cpp", |
| 1222 | "bionic/pthread_attr.cpp", |
Colin Cross | a35d23d | 2015-11-19 13:32:49 -0800 | [diff] [blame] | 1223 | "bionic/pthread_barrier.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1224 | "bionic/pthread_cond.cpp", |
| 1225 | "bionic/pthread_create.cpp", |
| 1226 | "bionic/pthread_detach.cpp", |
| 1227 | "bionic/pthread_equal.cpp", |
| 1228 | "bionic/pthread_exit.cpp", |
| 1229 | "bionic/pthread_getcpuclockid.cpp", |
| 1230 | "bionic/pthread_getschedparam.cpp", |
| 1231 | "bionic/pthread_gettid_np.cpp", |
Elliott Hughes | 7484c21 | 2017-02-02 02:41:38 +0000 | [diff] [blame] | 1232 | "bionic/pthread_internal.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1233 | "bionic/pthread_join.cpp", |
| 1234 | "bionic/pthread_key.cpp", |
| 1235 | "bionic/pthread_kill.cpp", |
| 1236 | "bionic/pthread_mutex.cpp", |
| 1237 | "bionic/pthread_once.cpp", |
| 1238 | "bionic/pthread_rwlock.cpp", |
Josh Gao | 726b63f | 2018-08-27 16:00:58 -0700 | [diff] [blame] | 1239 | "bionic/pthread_sigqueue.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1240 | "bionic/pthread_self.cpp", |
| 1241 | "bionic/pthread_setname_np.cpp", |
| 1242 | "bionic/pthread_setschedparam.cpp", |
Colin Cross | a35d23d | 2015-11-19 13:32:49 -0800 | [diff] [blame] | 1243 | "bionic/pthread_spinlock.cpp", |
Vy Nguyen | d500751 | 2020-07-14 17:37:04 -0400 | [diff] [blame] | 1244 | "bionic/sys_thread_properties.cpp", |
Josh Gao | 0e0e370 | 2017-10-12 13:34:42 -0700 | [diff] [blame] | 1245 | |
| 1246 | // The following implementations depend on pthread data or implementation, |
| 1247 | // so we can't include them in libc_ndk.a. |
| 1248 | "bionic/__cxa_thread_atexit_impl.cpp", |
Peter Collingbourne | 5f45c18 | 2020-01-14 17:59:41 -0800 | [diff] [blame] | 1249 | "bionic/android_unsafe_frame_pointer_chase.cpp", |
Ryan Prichard | afa983c | 2020-02-04 15:46:15 -0800 | [diff] [blame] | 1250 | "bionic/atexit.cpp", |
Josh Gao | 0e0e370 | 2017-10-12 13:34:42 -0700 | [diff] [blame] | 1251 | "bionic/fork.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1252 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1253 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1254 | cppflags: ["-Wold-style-cast"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1255 | include_dirs: ["bionic/libstdc++/include"], |
Peter Collingbourne | 5f45c18 | 2020-01-14 17:59:41 -0800 | [diff] [blame] | 1256 | header_libs: ["bionic_libc_platform_headers"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1257 | name: "libc_pthread", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1258 | } |
| 1259 | |
| 1260 | // ======================================================== |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1261 | // libc_syscalls.a |
| 1262 | // ======================================================== |
| 1263 | |
Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1264 | genrule { |
| 1265 | name: "syscalls-arm.S", |
| 1266 | out: ["syscalls-arm.S"], |
| 1267 | srcs: ["SYSCALLS.TXT"], |
| 1268 | tool_files: [":bionic-gensyscalls"], |
| 1269 | cmd: "$(location :bionic-gensyscalls) arm $(in) > $(out)", |
Chris Parsons | 8b768d3 | 2020-09-29 02:44:25 -0400 | [diff] [blame] | 1270 | bazel_module: { label: "//bionic/libc:syscalls-arm" } |
Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1271 | } |
| 1272 | |
| 1273 | genrule { |
| 1274 | name: "syscalls-arm64.S", |
| 1275 | out: ["syscalls-arm64.S"], |
| 1276 | srcs: ["SYSCALLS.TXT"], |
| 1277 | tool_files: [":bionic-gensyscalls"], |
| 1278 | cmd: "$(location :bionic-gensyscalls) arm64 $(in) > $(out)", |
Chris Parsons | 8b768d3 | 2020-09-29 02:44:25 -0400 | [diff] [blame] | 1279 | bazel_module: { label: "//bionic/libc:syscalls-arm64" }, |
Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1280 | } |
| 1281 | |
| 1282 | genrule { |
| 1283 | name: "syscalls-x86.S", |
| 1284 | out: ["syscalls-x86.S"], |
| 1285 | srcs: ["SYSCALLS.TXT"], |
| 1286 | tool_files: [":bionic-gensyscalls"], |
| 1287 | cmd: "$(location :bionic-gensyscalls) x86 $(in) > $(out)", |
Chris Parsons | 8b768d3 | 2020-09-29 02:44:25 -0400 | [diff] [blame] | 1288 | bazel_module: { label: "//bionic/libc:syscalls-x86" }, |
Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1289 | } |
| 1290 | |
| 1291 | genrule { |
| 1292 | name: "syscalls-x86_64.S", |
| 1293 | out: ["syscalls-x86_64.S"], |
| 1294 | srcs: ["SYSCALLS.TXT"], |
| 1295 | tool_files: [":bionic-gensyscalls"], |
| 1296 | cmd: "$(location :bionic-gensyscalls) x86_64 $(in) > $(out)", |
Chris Parsons | 8b768d3 | 2020-09-29 02:44:25 -0400 | [diff] [blame] | 1297 | bazel_module: { label: "//bionic/libc:syscalls-x86_64" }, |
Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1298 | } |
| 1299 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1300 | cc_library_static { |
Colin Cross | 27c43c5 | 2016-04-07 13:27:24 -0700 | [diff] [blame] | 1301 | defaults: ["libc_defaults"], |
Josh Gao | 0e0e370 | 2017-10-12 13:34:42 -0700 | [diff] [blame] | 1302 | srcs: ["bionic/__set_errno.cpp"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1303 | arch: { |
| 1304 | arm: { |
Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1305 | srcs: [":syscalls-arm.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1306 | }, |
| 1307 | arm64: { |
Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1308 | srcs: [":syscalls-arm64.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1309 | }, |
| 1310 | x86: { |
Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1311 | srcs: [":syscalls-x86.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1312 | }, |
| 1313 | x86_64: { |
Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1314 | srcs: [":syscalls-x86_64.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1315 | }, |
| 1316 | }, |
| 1317 | name: "libc_syscalls", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1318 | } |
| 1319 | |
| 1320 | // ======================================================== |
| 1321 | // libc_aeabi.a |
| 1322 | // This is an LP32 ARM-only library that needs to be built with -fno-builtin |
| 1323 | // to avoid infinite recursion. For the other architectures we just build an |
| 1324 | // empty library to keep this makefile simple. |
| 1325 | // ======================================================== |
| 1326 | |
| 1327 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1328 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1329 | arch: { |
| 1330 | arm: { |
| 1331 | srcs: ["arch-arm/bionic/__aeabi.c"], |
| 1332 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1333 | }, |
| 1334 | name: "libc_aeabi", |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1335 | cflags: ["-fno-builtin"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1336 | } |
| 1337 | |
| 1338 | // ======================================================== |
| 1339 | // libc_ndk.a |
| 1340 | // Compatibility library for the NDK. This library contains |
| 1341 | // all the parts of libc that are safe to statically link. |
| 1342 | // We can't safely statically link things that can only run |
| 1343 | // on a certain version of the OS. Examples include |
| 1344 | // anything that talks to netd (a large portion of the DNS |
| 1345 | // code) and anything that is dependent on the layout of a |
| 1346 | // data structure that has changed across releases (such as |
| 1347 | // pthread_t). |
| 1348 | // ======================================================== |
| 1349 | |
| 1350 | cc_library_static { |
| 1351 | name: "libc_ndk", |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 1352 | defaults: [ |
| 1353 | "libc_defaults", |
| 1354 | "libc_native_allocator_defaults", |
| 1355 | ], |
Yifan Hong | 5a39cee | 2020-01-21 16:43:56 -0800 | [diff] [blame] | 1356 | ramdisk_available: false, |
Yifan Hong | b04490d | 2020-10-21 18:36:36 -0700 | [diff] [blame] | 1357 | vendor_ramdisk_available: false, |
Christopher Ferris | e4cdbc4 | 2019-02-08 17:30:58 -0800 | [diff] [blame] | 1358 | srcs: libc_common_src_files + [ |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1359 | "bionic/gwp_asan_wrappers.cpp", |
Peter Collingbourne | 1e110fb | 2020-01-09 10:48:22 -0800 | [diff] [blame] | 1360 | "bionic/heap_tagging.cpp", |
Christopher Ferris | e4cdbc4 | 2019-02-08 17:30:58 -0800 | [diff] [blame] | 1361 | "bionic/malloc_common.cpp", |
Christopher Ferris | 1fc5ccf | 2019-02-15 18:06:15 -0800 | [diff] [blame] | 1362 | "bionic/malloc_limit.cpp", |
Christopher Ferris | e4cdbc4 | 2019-02-08 17:30:58 -0800 | [diff] [blame] | 1363 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1364 | multilib: { |
| 1365 | lib32: { |
| 1366 | srcs: libc_common_src_files_32, |
| 1367 | }, |
| 1368 | }, |
| 1369 | arch: { |
| 1370 | arm: { |
| 1371 | srcs: [ |
| 1372 | "arch-arm/bionic/exidx_dynamic.c", |
| 1373 | "arch-common/bionic/crtbegin_so.c", |
| 1374 | "arch-arm/bionic/atexit_legacy.c", |
| 1375 | "arch-common/bionic/crtend_so.S", |
| 1376 | ], |
| 1377 | whole_static_libs: ["libc_aeabi"], |
| 1378 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1379 | }, |
| 1380 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1381 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1382 | "-fvisibility=hidden", |
| 1383 | "-DLIBC_STATIC", |
| 1384 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1385 | |
| 1386 | whole_static_libs: [ |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1387 | "gwp_asan", |
Peter Collingbourne | 337a5b3 | 2020-02-21 12:11:02 -0800 | [diff] [blame] | 1388 | "libarm-optimized-routines-string", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1389 | "libc_bionic_ndk", |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1390 | "libc_bootstrap", |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 1391 | "libc_fortify", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1392 | "libc_freebsd", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 1393 | "libc_freebsd_large_stack", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1394 | "libc_gdtoa", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1395 | "libc_netbsd", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 1396 | "libc_openbsd_large_stack", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1397 | "libc_openbsd_ndk", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1398 | "libc_syscalls", |
| 1399 | "libc_tzcode", |
| 1400 | "libm", |
Elliott Hughes | 816fab9 | 2016-05-27 17:57:46 -0700 | [diff] [blame] | 1401 | "libstdc++", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1402 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1403 | } |
| 1404 | |
| 1405 | // ======================================================== |
Josh Gao | 0e0e370 | 2017-10-12 13:34:42 -0700 | [diff] [blame] | 1406 | // libc_nopthread.a |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1407 | // ======================================================== |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1408 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1409 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1410 | srcs: libc_common_src_files, |
| 1411 | multilib: { |
| 1412 | lib32: { |
| 1413 | srcs: libc_common_src_files_32, |
| 1414 | }, |
| 1415 | }, |
Josh Gao | 0e0e370 | 2017-10-12 13:34:42 -0700 | [diff] [blame] | 1416 | name: "libc_nopthread", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1417 | |
| 1418 | whole_static_libs: [ |
Peter Collingbourne | 337a5b3 | 2020-02-21 12:11:02 -0800 | [diff] [blame] | 1419 | "libarm-optimized-routines-string", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1420 | "libc_bionic", |
| 1421 | "libc_bionic_ndk", |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1422 | "libc_bootstrap", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1423 | "libc_dns", |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 1424 | "libc_fortify", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1425 | "libc_freebsd", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 1426 | "libc_freebsd_large_stack", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1427 | "libc_gdtoa", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1428 | "libc_netbsd", |
| 1429 | "libc_openbsd", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 1430 | "libc_openbsd_large_stack", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1431 | "libc_openbsd_ndk", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1432 | "libc_syscalls", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1433 | "libc_tzcode", |
Elliott Hughes | 816fab9 | 2016-05-27 17:57:46 -0700 | [diff] [blame] | 1434 | "libstdc++", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1435 | ], |
| 1436 | |
| 1437 | arch: { |
| 1438 | arm: { |
| 1439 | whole_static_libs: ["libc_aeabi"], |
| 1440 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1441 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1442 | } |
| 1443 | |
| 1444 | // ======================================================== |
Josh Gao | 0e0e370 | 2017-10-12 13:34:42 -0700 | [diff] [blame] | 1445 | // libc_common.a |
| 1446 | // ======================================================== |
| 1447 | |
| 1448 | cc_library_static { |
| 1449 | defaults: ["libc_defaults"], |
| 1450 | name: "libc_common", |
| 1451 | |
| 1452 | whole_static_libs: [ |
| 1453 | "libc_nopthread", |
| 1454 | "libc_pthread", |
| 1455 | ], |
| 1456 | } |
| 1457 | |
| 1458 | // ======================================================== |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1459 | // libc_static_dispatch.a |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1460 | // ======================================================== |
| 1461 | cc_library_static { |
| 1462 | defaults: ["libc_defaults"], |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1463 | name: "libc_static_dispatch", |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1464 | |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1465 | arch: { |
| 1466 | x86: { |
| 1467 | srcs: ["arch-x86/static_function_dispatch.S"], |
| 1468 | }, |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1469 | arm: { |
| 1470 | srcs: ["arch-arm/static_function_dispatch.S"], |
| 1471 | }, |
Peter Collingbourne | 900d07d | 2019-10-28 13:11:00 -0700 | [diff] [blame] | 1472 | arm64: { |
| 1473 | srcs: ["arch-arm64/static_function_dispatch.S"], |
| 1474 | }, |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1475 | }, |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1476 | } |
| 1477 | |
| 1478 | // ======================================================== |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1479 | // libc_dynamic_dispatch.a |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1480 | // ======================================================== |
| 1481 | cc_library_static { |
| 1482 | defaults: ["libc_defaults"], |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1483 | name: "libc_dynamic_dispatch", |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1484 | |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1485 | cflags: [ |
Peter Collingbourne | 36a5644 | 2019-10-31 17:11:54 -0700 | [diff] [blame] | 1486 | "-ffreestanding", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1487 | "-fno-stack-protector", |
| 1488 | "-fno-jump-tables", |
| 1489 | ], |
| 1490 | arch: { |
| 1491 | x86: { |
| 1492 | srcs: ["arch-x86/dynamic_function_dispatch.cpp"], |
| 1493 | }, |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1494 | arm: { |
Elliott Hughes | 927fe99 | 2019-01-31 22:29:22 +0000 | [diff] [blame] | 1495 | srcs: ["arch-arm/dynamic_function_dispatch.cpp"], |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1496 | }, |
Peter Collingbourne | 900d07d | 2019-10-28 13:11:00 -0700 | [diff] [blame] | 1497 | arm64: { |
| 1498 | srcs: ["arch-arm64/dynamic_function_dispatch.cpp"], |
| 1499 | }, |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1500 | }, |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1501 | } |
| 1502 | |
| 1503 | // ======================================================== |
| 1504 | // libc_common_static.a For static binaries. |
| 1505 | // ======================================================== |
| 1506 | cc_library_static { |
| 1507 | defaults: ["libc_defaults"], |
| 1508 | name: "libc_common_static", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1509 | |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1510 | whole_static_libs: [ |
| 1511 | "libc_common", |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1512 | "libc_static_dispatch", |
| 1513 | ], |
| 1514 | } |
| 1515 | |
| 1516 | // ======================================================== |
| 1517 | // libc_common_shared.a For shared libraries. |
| 1518 | // ======================================================== |
| 1519 | cc_library_static { |
| 1520 | defaults: ["libc_defaults"], |
| 1521 | name: "libc_common_shared", |
| 1522 | |
| 1523 | whole_static_libs: [ |
| 1524 | "libc_common", |
| 1525 | "libc_dynamic_dispatch", |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1526 | ], |
| 1527 | } |
| 1528 | |
Ryan Prichard | 22a6a05 | 2019-10-10 23:59:30 -0700 | [diff] [blame] | 1529 | // Versions of dl_iterate_phdr and similar APIs used to lookup unwinding information in a static |
| 1530 | // executable. |
| 1531 | cc_library_static { |
| 1532 | name: "libc_unwind_static", |
| 1533 | defaults: ["libc_defaults"], |
| 1534 | cflags: ["-DLIBC_STATIC"], |
| 1535 | |
| 1536 | srcs: ["bionic/dl_iterate_phdr_static.cpp"], |
| 1537 | arch: { |
| 1538 | // arm32-specific dl_unwind_find_exidx and __gnu_Unwind_Find_exidx APIs |
| 1539 | arm: { |
| 1540 | srcs: ["arch-arm/bionic/exidx_static.c"], |
| 1541 | }, |
| 1542 | }, |
| 1543 | } |
| 1544 | |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1545 | // ======================================================== |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1546 | // libc_nomalloc.a |
| 1547 | // ======================================================== |
| 1548 | // |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1549 | // This is a version of the static C library used by the dynamic linker that exclude malloc. It also |
| 1550 | // excludes functions selected using ifunc's (e.g. for string.h). Link in either |
| 1551 | // libc_static_dispatch or libc_dynamic_dispatch to provide those functions. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1552 | |
| 1553 | cc_library_static { |
Dimitry Ivanov | fc0d480 | 2016-12-06 11:10:09 -0800 | [diff] [blame] | 1554 | name: "libc_nomalloc", |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1555 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1556 | |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 1557 | whole_static_libs: [ |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1558 | "libc_common", |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 1559 | "libc_init_static", |
Ryan Prichard | 22a6a05 | 2019-10-10 23:59:30 -0700 | [diff] [blame] | 1560 | "libc_unwind_static", |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 1561 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1562 | } |
| 1563 | |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1564 | filegroup { |
| 1565 | name: "libc_sources_shared", |
| 1566 | srcs: [ |
| 1567 | "arch-common/bionic/crtbegin_so.c", |
| 1568 | "arch-common/bionic/crtbrand.S", |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1569 | "bionic/gwp_asan_wrappers.cpp", |
Peter Collingbourne | 1e110fb | 2020-01-09 10:48:22 -0800 | [diff] [blame] | 1570 | "bionic/heap_tagging.cpp", |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1571 | "bionic/icu.cpp", |
| 1572 | "bionic/malloc_common.cpp", |
Christopher Ferris | e4cdbc4 | 2019-02-08 17:30:58 -0800 | [diff] [blame] | 1573 | "bionic/malloc_common_dynamic.cpp", |
Ryan Savitski | 175c886 | 2020-01-02 19:54:57 +0000 | [diff] [blame] | 1574 | "bionic/android_profiling_dynamic.cpp", |
Christopher Ferris | e4cdbc4 | 2019-02-08 17:30:58 -0800 | [diff] [blame] | 1575 | "bionic/malloc_heapprofd.cpp", |
Christopher Ferris | 1fc5ccf | 2019-02-15 18:06:15 -0800 | [diff] [blame] | 1576 | "bionic/malloc_limit.cpp", |
Peter Collingbourne | 570de33 | 2019-12-11 10:00:58 -0800 | [diff] [blame] | 1577 | "bionic/ndk_cruft.cpp", |
| 1578 | "bionic/ndk_cruft_data.cpp", |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1579 | "bionic/NetdClient.cpp", |
| 1580 | "arch-common/bionic/crtend_so.S", |
| 1581 | ], |
Jingwen Chen | d6a3b78 | 2021-02-05 10:05:29 -0500 | [diff] [blame^] | 1582 | bazel_module: { bp2build_available: true }, |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1583 | } |
| 1584 | |
| 1585 | filegroup { |
| 1586 | name: "libc_sources_static", |
| 1587 | srcs: [ |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1588 | "bionic/gwp_asan_wrappers.cpp", |
Peter Collingbourne | 1e110fb | 2020-01-09 10:48:22 -0800 | [diff] [blame] | 1589 | "bionic/heap_tagging.cpp", |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1590 | "bionic/malloc_common.cpp", |
Christopher Ferris | 1fc5ccf | 2019-02-15 18:06:15 -0800 | [diff] [blame] | 1591 | "bionic/malloc_limit.cpp", |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1592 | ], |
Jingwen Chen | d6a3b78 | 2021-02-05 10:05:29 -0500 | [diff] [blame^] | 1593 | bazel_module: { bp2build_available: true }, |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1594 | } |
| 1595 | |
| 1596 | filegroup { |
| 1597 | name: "libc_sources_shared_arm", |
| 1598 | srcs: [ |
| 1599 | "arch-arm/bionic/exidx_dynamic.c", |
| 1600 | "arch-arm/bionic/atexit_legacy.c", |
| 1601 | ], |
Jingwen Chen | d6a3b78 | 2021-02-05 10:05:29 -0500 | [diff] [blame^] | 1602 | bazel_module: { bp2build_available: true }, |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1603 | } |
| 1604 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1605 | // ======================================================== |
| 1606 | // libc.a + libc.so |
| 1607 | // ======================================================== |
| 1608 | cc_library { |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 1609 | defaults: [ |
| 1610 | "libc_defaults", |
| 1611 | "libc_native_allocator_defaults", |
| 1612 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1613 | name: "libc", |
Dan Albert | 40f15ec | 2017-10-27 11:21:20 -0700 | [diff] [blame] | 1614 | static_ndk_lib: true, |
Colin Cross | 8393a8b | 2020-10-19 13:37:49 -0700 | [diff] [blame] | 1615 | llndk_stubs: "libc.llndk", |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1616 | product_variables: { |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1617 | platform_sdk_version: { |
| 1618 | asflags: ["-DPLATFORM_SDK_VERSION=%d"], |
| 1619 | }, |
| 1620 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1621 | static: { |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1622 | srcs: [ ":libc_sources_static" ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1623 | cflags: ["-DLIBC_STATIC"], |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1624 | whole_static_libs: [ |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1625 | "gwp_asan", |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1626 | "libc_init_static", |
| 1627 | "libc_common_static", |
Ryan Prichard | 22a6a05 | 2019-10-10 23:59:30 -0700 | [diff] [blame] | 1628 | "libc_unwind_static", |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1629 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1630 | }, |
| 1631 | shared: { |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1632 | srcs: [ ":libc_sources_shared" ], |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1633 | whole_static_libs: [ |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1634 | "gwp_asan", |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1635 | "libc_init_dynamic", |
| 1636 | "libc_common_shared", |
Ryan Prichard | cdf7175 | 2020-12-16 03:37:22 -0800 | [diff] [blame] | 1637 | "libunwind-exported", |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1638 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1639 | }, |
| 1640 | |
Neil Fuller | a7db90f | 2019-04-25 09:28:27 +0100 | [diff] [blame] | 1641 | required: [ |
| 1642 | "tzdata", |
| 1643 | "tz_version", // Version metadata for tzdata to help debugging. |
| 1644 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1645 | |
Colin Cross | 4ce94d2 | 2016-11-15 13:15:43 -0800 | [diff] [blame] | 1646 | // Do not pack libc.so relocations; see http://b/20645321 for details. |
| 1647 | pack_relocations: false, |
| 1648 | |
dimitry | 06016f2 | 2018-01-05 11:39:28 +0100 | [diff] [blame] | 1649 | // WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so! |
| 1650 | // If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the |
| 1651 | // LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into |
| 1652 | // those new libraries from libgcc.a are not declared external; if that were the case, |
| 1653 | // then libc would not pull those symbols from libgcc.a as it should, instead relying |
| 1654 | // on the external symbols from the dependent libraries. That would create a "cloaked" |
| 1655 | // 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] | 1656 | |
dimitry | 06016f2 | 2018-01-05 11:39:28 +0100 | [diff] [blame] | 1657 | shared_libs: [ |
| 1658 | "ld-android", |
| 1659 | "libdl", |
| 1660 | ], |
Jiyong Park | 3ff116a | 2019-04-02 23:04:52 +0900 | [diff] [blame] | 1661 | static_libs: [ |
| 1662 | "libdl_android", |
| 1663 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1664 | |
| 1665 | nocrt: true, |
| 1666 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1667 | arch: { |
| 1668 | arm: { |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1669 | // 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] | 1670 | pack_relocations: false, |
Ian Pedowitz | b6310c2 | 2018-01-18 16:26:19 -0800 | [diff] [blame] | 1671 | ldflags: ["-Wl,--hash-style=both"], |
| 1672 | |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1673 | version_script: ":libc.arm.map", |
Ryan Prichard | c22562c | 2021-01-27 17:27:31 -0800 | [diff] [blame] | 1674 | no_libcrt: true, |
Dan Willemsen | 9e6f98f | 2015-11-03 14:30:57 -0800 | [diff] [blame] | 1675 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1676 | shared: { |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1677 | srcs: [":libc_sources_shared_arm"], |
Dan Willemsen | 0c65708 | 2016-05-12 01:43:07 -0700 | [diff] [blame] | 1678 | // special for arm |
| 1679 | cflags: ["-DCRT_LEGACY_WORKAROUND"], |
Ryan Prichard | c22562c | 2021-01-27 17:27:31 -0800 | [diff] [blame] | 1680 | // For backwards-compatibility, some arm32 builtins are exported from libc.so. |
| 1681 | static_libs: ["libclang_rt.builtins-arm-android-exported"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1682 | }, |
Christopher Ferris | 0c0f6fb | 2019-05-17 16:22:56 -0700 | [diff] [blame] | 1683 | |
| 1684 | // Arm 32 bit does not produce complete exidx unwind information |
| 1685 | // so keep the .debug_frame which is relatively small and does |
| 1686 | // include needed unwind information. |
| 1687 | // See b/132992102 for details. |
| 1688 | strip: { |
| 1689 | keep_symbols_and_debug_frame: true, |
| 1690 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1691 | }, |
Dan Willemsen | 9e6f98f | 2015-11-03 14:30:57 -0800 | [diff] [blame] | 1692 | arm64: { |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1693 | version_script: ":libc.arm64.map", |
Christopher Ferris | 0c0f6fb | 2019-05-17 16:22:56 -0700 | [diff] [blame] | 1694 | |
| 1695 | // Leave the symbols in the shared library so that stack unwinders can produce |
| 1696 | // meaningful name resolution. |
| 1697 | strip: { |
| 1698 | keep_symbols: true, |
| 1699 | }, |
Dan Willemsen | 9e6f98f | 2015-11-03 14:30:57 -0800 | [diff] [blame] | 1700 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1701 | x86: { |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1702 | // 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] | 1703 | pack_relocations: false, |
Ian Pedowitz | b6310c2 | 2018-01-18 16:26:19 -0800 | [diff] [blame] | 1704 | ldflags: ["-Wl,--hash-style=both"], |
| 1705 | |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1706 | version_script: ":libc.x86.map", |
Ryan Prichard | c22562c | 2021-01-27 17:27:31 -0800 | [diff] [blame] | 1707 | no_libcrt: true, |
| 1708 | |
| 1709 | shared: { |
| 1710 | // For backwards-compatibility, some x86 builtins are exported from libc.so. |
| 1711 | static_libs: ["libclang_rt.builtins-i686-android-exported"], |
| 1712 | }, |
Christopher Ferris | 0c0f6fb | 2019-05-17 16:22:56 -0700 | [diff] [blame] | 1713 | |
| 1714 | // Leave the symbols in the shared library so that stack unwinders can produce |
| 1715 | // meaningful name resolution. |
| 1716 | strip: { |
| 1717 | keep_symbols: true, |
| 1718 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1719 | }, |
| 1720 | x86_64: { |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1721 | version_script: ":libc.x86_64.map", |
Christopher Ferris | 0c0f6fb | 2019-05-17 16:22:56 -0700 | [diff] [blame] | 1722 | |
| 1723 | // Leave the symbols in the shared library so that stack unwinders can produce |
| 1724 | // meaningful name resolution. |
| 1725 | strip: { |
| 1726 | keep_symbols: true, |
| 1727 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1728 | }, |
| 1729 | }, |
Jiyong Park | c45fe9f | 2018-12-13 18:26:48 +0900 | [diff] [blame] | 1730 | |
| 1731 | stubs: { |
| 1732 | symbol_file: "libc.map.txt", |
Jooyung Han | 26ddc4d | 2020-02-27 18:33:25 +0900 | [diff] [blame] | 1733 | versions: [ |
| 1734 | "29", |
Jooyung Han | dbfa074 | 2020-03-30 13:18:44 +0900 | [diff] [blame] | 1735 | "R", |
Dan Albert | 48943b2 | 2020-07-27 13:28:56 -0700 | [diff] [blame] | 1736 | "current", |
Jooyung Han | 26ddc4d | 2020-02-27 18:33:25 +0900 | [diff] [blame] | 1737 | ], |
Jiyong Park | c45fe9f | 2018-12-13 18:26:48 +0900 | [diff] [blame] | 1738 | }, |
Vic Yang | 6903fb8 | 2019-01-14 11:34:39 -0800 | [diff] [blame] | 1739 | |
Jiyong Park | e87e0dc | 2019-10-02 17:09:33 +0900 | [diff] [blame] | 1740 | apex_available: [ |
| 1741 | "//apex_available:platform", |
| 1742 | "com.android.runtime", |
| 1743 | ], |
| 1744 | |
Vic Yang | 03ff436 | 2019-06-24 16:11:37 -0700 | [diff] [blame] | 1745 | // Sorting bss symbols by size usually results in less dirty pages at run |
| 1746 | // time, because small symbols are grouped together. |
| 1747 | sort_bss_symbols_by_size: true, |
Yi Kong | 15a05a7 | 2020-09-22 00:56:13 +0800 | [diff] [blame] | 1748 | |
| 1749 | lto: { |
| 1750 | never: true, |
| 1751 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1752 | } |
| 1753 | |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1754 | genrule { |
| 1755 | name: "libc.arm.map", |
| 1756 | out: ["libc.arm.map"], |
| 1757 | srcs: ["libc.map.txt"], |
| 1758 | tool_files: [":bionic-generate-version-script"], |
| 1759 | cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)", |
Jingwen Chen | d6a3b78 | 2021-02-05 10:05:29 -0500 | [diff] [blame^] | 1760 | bazel_module: { bp2build_available: true }, |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1761 | } |
| 1762 | |
| 1763 | genrule { |
| 1764 | name: "libc.arm64.map", |
| 1765 | out: ["libc.arm64.map"], |
| 1766 | srcs: ["libc.map.txt"], |
| 1767 | tool_files: [":bionic-generate-version-script"], |
| 1768 | cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)", |
Jingwen Chen | d6a3b78 | 2021-02-05 10:05:29 -0500 | [diff] [blame^] | 1769 | bazel_module: { bp2build_available: true }, |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1770 | } |
| 1771 | |
| 1772 | genrule { |
| 1773 | name: "libc.x86.map", |
| 1774 | out: ["libc.x86.map"], |
| 1775 | srcs: ["libc.map.txt"], |
| 1776 | tool_files: [":bionic-generate-version-script"], |
| 1777 | cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)", |
Jingwen Chen | d6a3b78 | 2021-02-05 10:05:29 -0500 | [diff] [blame^] | 1778 | bazel_module: { bp2build_available: true }, |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1779 | } |
| 1780 | |
| 1781 | genrule { |
| 1782 | name: "libc.x86_64.map", |
| 1783 | out: ["libc.x86_64.map"], |
| 1784 | srcs: ["libc.map.txt"], |
| 1785 | tool_files: [":bionic-generate-version-script"], |
| 1786 | cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)", |
Jingwen Chen | d6a3b78 | 2021-02-05 10:05:29 -0500 | [diff] [blame^] | 1787 | bazel_module: { bp2build_available: true }, |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1788 | } |
| 1789 | |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1790 | // Headers that only other parts of the platform can include. |
| 1791 | cc_library_headers { |
| 1792 | name: "bionic_libc_platform_headers", |
Martin Stjernholm | a276343 | 2020-04-23 16:47:19 +0100 | [diff] [blame] | 1793 | defaults: ["linux_bionic_supported"], |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1794 | visibility: [ |
Christopher Ferris | c5d3a43 | 2019-09-25 17:50:36 -0700 | [diff] [blame] | 1795 | "//art:__subpackages__", |
Josh Gao | 9727192 | 2019-11-06 13:15:00 -0800 | [diff] [blame] | 1796 | "//bionic:__subpackages__", |
Christopher Ferris | c5d3a43 | 2019-09-25 17:50:36 -0700 | [diff] [blame] | 1797 | "//frameworks:__subpackages__", |
Roman Kiryanov | 067f518 | 2020-05-07 14:58:30 -0700 | [diff] [blame] | 1798 | "//device/generic/goldfish-opengl:__subpackages__", |
Mitch Phillips | 3309b3d | 2020-03-25 15:05:48 -0700 | [diff] [blame] | 1799 | "//external/gwp_asan:__subpackages__", |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1800 | "//external/perfetto:__subpackages__", |
Christopher Ferris | c5d3a43 | 2019-09-25 17:50:36 -0700 | [diff] [blame] | 1801 | "//external/scudo:__subpackages__", |
Josh Gao | 5074e7d | 2019-12-13 13:55:53 -0800 | [diff] [blame] | 1802 | "//system/core/debuggerd:__subpackages__", |
Steven Moreland | 0cdf132 | 2020-10-05 21:55:26 +0000 | [diff] [blame] | 1803 | "//system/core/libcutils:__subpackages__", |
Peter Collingbourne | 6a363f7 | 2020-01-13 10:39:33 -0800 | [diff] [blame] | 1804 | "//system/memory/libmemunreachable:__subpackages__", |
Baligh Uddin | db0c6de | 2020-10-15 04:49:00 +0000 | [diff] [blame] | 1805 | "//system/unwinding/libunwindstack:__subpackages__", |
Peter Collingbourne | 1541800 | 2020-05-12 16:02:50 -0700 | [diff] [blame] | 1806 | "//tools/security/sanitizer-status:__subpackages__", |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1807 | ], |
Peter Collingbourne | 6a363f7 | 2020-01-13 10:39:33 -0800 | [diff] [blame] | 1808 | vendor_available: true, |
Justin Yun | 869a0fa | 2020-11-11 15:16:11 +0900 | [diff] [blame] | 1809 | product_available: true, |
Yifan Hong | 5a39cee | 2020-01-21 16:43:56 -0800 | [diff] [blame] | 1810 | ramdisk_available: true, |
Yifan Hong | b04490d | 2020-10-21 18:36:36 -0700 | [diff] [blame] | 1811 | vendor_ramdisk_available: true, |
Christopher Ferris | c5d3a43 | 2019-09-25 17:50:36 -0700 | [diff] [blame] | 1812 | recovery_available: true, |
| 1813 | native_bridge_supported: true, |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1814 | export_include_dirs: [ |
| 1815 | "platform", |
| 1816 | ], |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 1817 | system_shared_libs: [], |
| 1818 | stl: "none", |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1819 | sdk_version: "current", |
Jiyong Park | 4ede160 | 2020-04-28 18:21:08 +0900 | [diff] [blame] | 1820 | |
Steven Moreland | 0cdf132 | 2020-10-05 21:55:26 +0000 | [diff] [blame] | 1821 | min_sdk_version: "29", |
Jiyong Park | 4ede160 | 2020-04-28 18:21:08 +0900 | [diff] [blame] | 1822 | apex_available: [ |
| 1823 | "//apex_available:platform", |
Steven Moreland | 0cdf132 | 2020-10-05 21:55:26 +0000 | [diff] [blame] | 1824 | "//apex_available:anyapex", |
Jiyong Park | 4ede160 | 2020-04-28 18:21:08 +0900 | [diff] [blame] | 1825 | ], |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1826 | } |
| 1827 | |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1828 | cc_library_headers { |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1829 | // Internal lib for use in libc_headers. Since we cannot intersect arch{} |
| 1830 | // and target{} in the same module, this one specifies the arch-dependent |
| 1831 | // include paths, and then libc_headers filters by target so that the |
| 1832 | // headers only are included for Bionic targets. |
| 1833 | name: "libc_headers_arch", |
| 1834 | visibility: ["//visibility:private"], |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1835 | |
| 1836 | host_supported: true, |
| 1837 | vendor_available: true, |
Justin Yun | 869a0fa | 2020-11-11 15:16:11 +0900 | [diff] [blame] | 1838 | product_available: true, |
Yifan Hong | 5a39cee | 2020-01-21 16:43:56 -0800 | [diff] [blame] | 1839 | ramdisk_available: true, |
Yifan Hong | b04490d | 2020-10-21 18:36:36 -0700 | [diff] [blame] | 1840 | vendor_ramdisk_available: true, |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1841 | recovery_available: true, |
dimitry | 7f04880 | 2019-05-03 15:57:34 +0200 | [diff] [blame] | 1842 | native_bridge_supported: true, |
Jiyong Park | 922a5c7 | 2020-03-07 17:35:02 +0900 | [diff] [blame] | 1843 | apex_available: [ |
| 1844 | "//apex_available:platform", |
Jiyong Park | ad9946c | 2020-03-30 18:36:07 +0900 | [diff] [blame] | 1845 | "//apex_available:anyapex", |
| 1846 | ], |
Jooyung Han | 15c32a8 | 2020-04-16 18:26:45 +0900 | [diff] [blame] | 1847 | // used by most APEXes indirectly via libunwind_llvm |
| 1848 | min_sdk_version: "apex_inherit", |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1849 | |
| 1850 | no_libcrt: true, |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1851 | stl: "none", |
| 1852 | system_shared_libs: [], |
| 1853 | |
Peter Collingbourne | f2b1e03 | 2019-12-10 17:41:16 -0800 | [diff] [blame] | 1854 | // The build system generally requires that any dependencies of a target |
| 1855 | // with an sdk_version must have a lower sdk_version. By setting sdk_version |
| 1856 | // to 1 we let targets with an sdk_version that need to depend on the libc |
| 1857 | // headers but cannot depend on libc itself due to circular dependencies |
| 1858 | // (such as libunwind_llvm) depend on the headers. Setting sdk_version to 1 |
| 1859 | // is correct because the headers can support any sdk_version. |
| 1860 | sdk_version: "1", |
| 1861 | |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1862 | export_system_include_dirs: [ |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1863 | "include", |
| 1864 | "kernel/uapi", |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1865 | "kernel/android/scsi", |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1866 | "kernel/android/uapi", |
| 1867 | ], |
| 1868 | |
| 1869 | arch: { |
| 1870 | arm: { |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1871 | export_system_include_dirs: ["kernel/uapi/asm-arm"], |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1872 | }, |
| 1873 | arm64: { |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1874 | export_system_include_dirs: ["kernel/uapi/asm-arm64"], |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1875 | }, |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1876 | x86: { |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1877 | export_system_include_dirs: ["kernel/uapi/asm-x86"], |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1878 | }, |
| 1879 | x86_64: { |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1880 | export_system_include_dirs: ["kernel/uapi/asm-x86"], |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1881 | }, |
| 1882 | }, |
| 1883 | } |
| 1884 | |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1885 | cc_library_headers { |
| 1886 | name: "libc_headers", |
| 1887 | host_supported: true, |
| 1888 | native_bridge_supported: true, |
| 1889 | vendor_available: true, |
Justin Yun | 869a0fa | 2020-11-11 15:16:11 +0900 | [diff] [blame] | 1890 | product_available: true, |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1891 | ramdisk_available: true, |
Yifan Hong | b04490d | 2020-10-21 18:36:36 -0700 | [diff] [blame] | 1892 | vendor_ramdisk_available: true, |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1893 | recovery_available: true, |
| 1894 | sdk_version: "1", |
| 1895 | |
| 1896 | apex_available: [ |
| 1897 | "//apex_available:platform", |
| 1898 | "//apex_available:anyapex", |
| 1899 | ], |
| 1900 | // used by most APEXes indirectly via libunwind_llvm |
| 1901 | min_sdk_version: "apex_inherit", |
| 1902 | visibility: [ |
| 1903 | "//bionic:__subpackages__", // visible to bionic |
| 1904 | // ... and only to these places (b/152668052) |
| 1905 | "//external/arm-optimized-routines", |
| 1906 | "//external/gwp_asan", |
| 1907 | "//external/jemalloc_new", |
| 1908 | "//external/libunwind_llvm", |
| 1909 | "//external/scudo", |
| 1910 | "//system/core/property_service/libpropertyinfoparser", |
| 1911 | "//system/extras/toolchain-extras", |
| 1912 | // TODO(b/153662223): Clean up these users that needed visibility when |
| 1913 | // the implicit addition of system Bionic paths was removed. |
| 1914 | "//art/tools/cpp-define-generator", |
| 1915 | "//external/boringssl", |
| 1916 | "//external/minijail", |
| 1917 | ], |
| 1918 | |
| 1919 | stl: "none", |
| 1920 | no_libcrt: true, |
| 1921 | system_shared_libs: [], |
| 1922 | |
| 1923 | target: { |
| 1924 | android: { |
| 1925 | header_libs: ["libc_headers_arch"], |
| 1926 | export_header_lib_headers: ["libc_headers_arch"], |
| 1927 | }, |
| 1928 | linux_bionic: { |
| 1929 | header_libs: ["libc_headers_arch"], |
| 1930 | export_header_lib_headers: ["libc_headers_arch"], |
| 1931 | }, |
| 1932 | } |
| 1933 | } |
| 1934 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1935 | // ======================================================== |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1936 | // libstdc++.so and libstdc++.a. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1937 | // ======================================================== |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1938 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1939 | cc_library { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1940 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1941 | include_dirs: ["bionic/libstdc++/include"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1942 | srcs: [ |
| 1943 | "bionic/__cxa_guard.cpp", |
| 1944 | "bionic/__cxa_pure_virtual.cpp", |
| 1945 | "bionic/new.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1946 | ], |
| 1947 | name: "libstdc++", |
Dan Albert | 40f15ec | 2017-10-27 11:21:20 -0700 | [diff] [blame] | 1948 | static_ndk_lib: true, |
Isaac Chen | 5e7c90b | 2017-09-20 14:44:42 +0800 | [diff] [blame] | 1949 | static_libs: ["libasync_safe"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1950 | |
Dan Willemsen | 6b3be17 | 2018-12-03 13:57:20 -0800 | [diff] [blame] | 1951 | static: { |
| 1952 | system_shared_libs: [], |
| 1953 | }, |
| 1954 | shared: { |
| 1955 | system_shared_libs: ["libc"], |
| 1956 | }, |
| 1957 | |
Ian Pedowitz | b6310c2 | 2018-01-18 16:26:19 -0800 | [diff] [blame] | 1958 | //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] | 1959 | arch: { |
| 1960 | arm: { |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1961 | // 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] | 1962 | pack_relocations: false, |
Ian Pedowitz | b6310c2 | 2018-01-18 16:26:19 -0800 | [diff] [blame] | 1963 | ldflags: ["-Wl,--hash-style=both"], |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1964 | version_script: ":libstdc++.arm.map", |
Dimitry Ivanov | 6cc8d47 | 2016-07-28 13:52:17 -0700 | [diff] [blame] | 1965 | }, |
| 1966 | arm64: { |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1967 | version_script: ":libstdc++.arm64.map", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1968 | }, |
| 1969 | x86: { |
Chih-Hung Hsieh | ecbff83 | 2018-05-23 18:45:53 -0700 | [diff] [blame] | 1970 | pack_relocations: false, |
Ian Pedowitz | b6310c2 | 2018-01-18 16:26:19 -0800 | [diff] [blame] | 1971 | ldflags: ["-Wl,--hash-style=both"], |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1972 | version_script: ":libstdc++.x86.map", |
Dimitry Ivanov | 6cc8d47 | 2016-07-28 13:52:17 -0700 | [diff] [blame] | 1973 | }, |
| 1974 | x86_64: { |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1975 | version_script: ":libstdc++.x86_64.map", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1976 | }, |
| 1977 | }, |
| 1978 | } |
| 1979 | |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1980 | genrule { |
| 1981 | name: "libstdc++.arm.map", |
| 1982 | out: ["libstdc++.arm.map"], |
| 1983 | srcs: ["libstdc++.map.txt"], |
| 1984 | tool_files: [":bionic-generate-version-script"], |
| 1985 | cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)", |
| 1986 | } |
| 1987 | |
| 1988 | genrule { |
| 1989 | name: "libstdc++.arm64.map", |
| 1990 | out: ["libstdc++.arm64.map"], |
| 1991 | srcs: ["libstdc++.map.txt"], |
| 1992 | tool_files: [":bionic-generate-version-script"], |
| 1993 | cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)", |
| 1994 | } |
| 1995 | |
| 1996 | genrule { |
| 1997 | name: "libstdc++.x86.map", |
| 1998 | out: ["libstdc++.x86.map"], |
| 1999 | srcs: ["libstdc++.map.txt"], |
| 2000 | tool_files: [":bionic-generate-version-script"], |
| 2001 | cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)", |
| 2002 | } |
| 2003 | |
| 2004 | genrule { |
| 2005 | name: "libstdc++.x86_64.map", |
| 2006 | out: ["libstdc++.x86_64.map"], |
| 2007 | srcs: ["libstdc++.map.txt"], |
| 2008 | tool_files: [":bionic-generate-version-script"], |
| 2009 | cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)", |
| 2010 | } |
| 2011 | |
| 2012 | // ======================================================== |
| 2013 | // crt object files. |
| 2014 | // ======================================================== |
| 2015 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2016 | cc_defaults { |
| 2017 | name: "crt_defaults", |
Dan Willemsen | 7ec52b1 | 2016-11-28 17:02:25 -0800 | [diff] [blame] | 2018 | defaults: ["linux_bionic_supported"], |
Dan Willemsen | 230a7a4 | 2017-04-07 14:09:05 -0700 | [diff] [blame] | 2019 | vendor_available: true, |
Justin Yun | 869a0fa | 2020-11-11 15:16:11 +0900 | [diff] [blame] | 2020 | product_available: true, |
Yifan Hong | 5a39cee | 2020-01-21 16:43:56 -0800 | [diff] [blame] | 2021 | ramdisk_available: true, |
Yifan Hong | b04490d | 2020-10-21 18:36:36 -0700 | [diff] [blame] | 2022 | vendor_ramdisk_available: true, |
Jiyong Park | 5603c6e | 2018-04-27 21:53:11 +0900 | [diff] [blame] | 2023 | recovery_available: true, |
dimitry | 7f04880 | 2019-05-03 15:57:34 +0200 | [diff] [blame] | 2024 | native_bridge_supported: true, |
Jiyong Park | 922a5c7 | 2020-03-07 17:35:02 +0900 | [diff] [blame] | 2025 | apex_available: [ |
| 2026 | "//apex_available:platform", |
| 2027 | "//apex_available:anyapex", |
| 2028 | ], |
Dan Albert | dc503f6 | 2020-07-15 17:22:18 -0700 | [diff] [blame] | 2029 | // Generate NDK variants of the CRT objects for every supported API level. |
| 2030 | min_sdk_version: "16", |
| 2031 | stl: "none", |
| 2032 | crt: true, |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 2033 | cflags: [ |
| 2034 | "-Wno-gcc-compat", |
| 2035 | "-Wall", |
| 2036 | "-Werror", |
| 2037 | ], |
Peter Collingbourne | 7eb851c | 2019-09-26 12:16:06 -0700 | [diff] [blame] | 2038 | sanitize: { |
| 2039 | never: true, |
| 2040 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2041 | } |
| 2042 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2043 | cc_defaults { |
| 2044 | name: "crt_so_defaults", |
Colin Cross | 7d7b368 | 2017-11-03 13:38:40 -0700 | [diff] [blame] | 2045 | defaults: ["crt_defaults"], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2046 | |
| 2047 | arch: { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2048 | x86: { |
| 2049 | cflags: ["-fPIC"], |
| 2050 | }, |
| 2051 | x86_64: { |
| 2052 | cflags: ["-fPIC"], |
| 2053 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2054 | }, |
Colin Cross | ab17944 | 2018-09-27 11:03:22 -0700 | [diff] [blame] | 2055 | stl: "none", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2056 | } |
| 2057 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2058 | cc_object { |
| 2059 | name: "crtbrand", |
Dan Willemsen | a3ed901 | 2017-04-04 15:51:26 -0700 | [diff] [blame] | 2060 | // crtbrand.c needs <stdint.h> and a #define for the platform SDK version. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2061 | local_include_dirs: ["include"], |
| 2062 | product_variables: { |
| 2063 | platform_sdk_version: { |
| 2064 | asflags: ["-DPLATFORM_SDK_VERSION=%d"], |
| 2065 | }, |
| 2066 | }, |
| 2067 | srcs: ["arch-common/bionic/crtbrand.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2068 | |
Colin Cross | 7d7b368 | 2017-11-03 13:38:40 -0700 | [diff] [blame] | 2069 | defaults: ["crt_so_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2070 | } |
| 2071 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2072 | cc_object { |
| 2073 | name: "crtbegin_so1", |
| 2074 | local_include_dirs: ["include"], |
| 2075 | srcs: ["arch-common/bionic/crtbegin_so.c"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2076 | |
Colin Cross | 7d7b368 | 2017-11-03 13:38:40 -0700 | [diff] [blame] | 2077 | defaults: ["crt_so_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2078 | } |
| 2079 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2080 | cc_object { |
| 2081 | name: "crtbegin_so", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2082 | |
Colin Cross | 7d7b368 | 2017-11-03 13:38:40 -0700 | [diff] [blame] | 2083 | defaults: ["crt_so_defaults"], |
Colin Cross | 77d57bf | 2016-04-11 14:34:18 -0700 | [diff] [blame] | 2084 | objs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2085 | "crtbegin_so1", |
| 2086 | "crtbrand", |
| 2087 | ], |
| 2088 | } |
| 2089 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2090 | cc_object { |
| 2091 | name: "crtend_so", |
| 2092 | local_include_dirs: ["include"], |
| 2093 | srcs: ["arch-common/bionic/crtend_so.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2094 | |
Colin Cross | 7d7b368 | 2017-11-03 13:38:40 -0700 | [diff] [blame] | 2095 | defaults: ["crt_so_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2096 | } |
| 2097 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2098 | cc_object { |
| 2099 | name: "crtbegin_static1", |
| 2100 | local_include_dirs: ["include"], |
| 2101 | srcs: ["arch-common/bionic/crtbegin.c"], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2102 | defaults: ["crt_defaults"], |
Jiyong Park | 268a600 | 2021-01-12 23:14:37 +0900 | [diff] [blame] | 2103 | // When using libc.a, we're using the latest library regardless of target API level. |
| 2104 | min_sdk_version: "current", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2105 | } |
| 2106 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2107 | cc_object { |
| 2108 | name: "crtbegin_static", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2109 | |
Colin Cross | 77d57bf | 2016-04-11 14:34:18 -0700 | [diff] [blame] | 2110 | objs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2111 | "crtbegin_static1", |
| 2112 | "crtbrand", |
| 2113 | ], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2114 | defaults: ["crt_defaults"], |
Jiyong Park | 268a600 | 2021-01-12 23:14:37 +0900 | [diff] [blame] | 2115 | // When using libc.a, we're using the latest library regardless of target API level. |
| 2116 | min_sdk_version: "current", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2117 | } |
| 2118 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2119 | cc_object { |
| 2120 | name: "crtbegin_dynamic1", |
| 2121 | local_include_dirs: ["include"], |
| 2122 | srcs: ["arch-common/bionic/crtbegin.c"], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2123 | defaults: ["crt_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2124 | } |
| 2125 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2126 | cc_object { |
| 2127 | name: "crtbegin_dynamic", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2128 | |
Colin Cross | 77d57bf | 2016-04-11 14:34:18 -0700 | [diff] [blame] | 2129 | objs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2130 | "crtbegin_dynamic1", |
| 2131 | "crtbrand", |
| 2132 | ], |
Dan Willemsen | 7ccc50d | 2017-09-18 21:28:14 -0700 | [diff] [blame] | 2133 | target: { |
| 2134 | linux_bionic: { |
| 2135 | generated_sources: ["host_bionic_linker_asm"], |
| 2136 | objs: [ |
| 2137 | "linker_wrapper", |
| 2138 | ], |
| 2139 | }, |
| 2140 | }, |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2141 | defaults: ["crt_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2142 | } |
| 2143 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2144 | cc_object { |
| 2145 | // We rename crtend.o to crtend_android.o to avoid a |
| 2146 | // name clash between gcc and bionic. |
| 2147 | name: "crtend_android", |
| 2148 | local_include_dirs: ["include"], |
| 2149 | srcs: ["arch-common/bionic/crtend.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2150 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2151 | defaults: ["crt_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2152 | } |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 2153 | |
Evgenii Stepanov | 8564b8d | 2020-12-15 13:55:32 -0800 | [diff] [blame] | 2154 | cc_library_static { |
| 2155 | name: "note_memtag_heap_async", |
| 2156 | arch: { |
| 2157 | arm64: { |
| 2158 | srcs: ["arch-arm64/bionic/note_memtag_heap_async.S"], |
| 2159 | } |
| 2160 | }, |
| 2161 | |
| 2162 | defaults: ["crt_defaults"], |
| 2163 | } |
| 2164 | |
| 2165 | cc_library_static { |
| 2166 | name: "note_memtag_heap_sync", |
| 2167 | arch: { |
| 2168 | arm64: { |
| 2169 | srcs: ["arch-arm64/bionic/note_memtag_heap_sync.S"], |
| 2170 | } |
| 2171 | }, |
| 2172 | |
| 2173 | defaults: ["crt_defaults"], |
| 2174 | } |
| 2175 | |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 2176 | // ======================================================== |
| 2177 | // NDK headers. |
| 2178 | // ======================================================== |
| 2179 | |
Dan Albert | 26e1c41 | 2018-05-24 14:56:46 -0700 | [diff] [blame] | 2180 | versioned_ndk_headers { |
Dan Albert | 22805ea | 2017-03-22 15:28:05 -0700 | [diff] [blame] | 2181 | name: "common_libc", |
| 2182 | from: "include", |
| 2183 | to: "", |
| 2184 | license: "NOTICE", |
| 2185 | } |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2186 | |
| 2187 | ndk_headers { |
Dan Albert | 063e86a | 2016-11-29 11:09:12 -0800 | [diff] [blame] | 2188 | name: "libc_uapi", |
| 2189 | from: "kernel/uapi", |
| 2190 | to: "", |
| 2191 | srcs: [ |
| 2192 | "kernel/uapi/asm-generic/**/*.h", |
| 2193 | "kernel/uapi/drm/**/*.h", |
| 2194 | "kernel/uapi/linux/**/*.h", |
| 2195 | "kernel/uapi/misc/**/*.h", |
| 2196 | "kernel/uapi/mtd/**/*.h", |
| 2197 | "kernel/uapi/rdma/**/*.h", |
| 2198 | "kernel/uapi/scsi/**/*.h", |
| 2199 | "kernel/uapi/sound/**/*.h", |
| 2200 | "kernel/uapi/video/**/*.h", |
| 2201 | "kernel/uapi/xen/**/*.h", |
| 2202 | ], |
Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2203 | license: "NOTICE", |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2204 | } |
| 2205 | |
| 2206 | ndk_headers { |
Elliott Hughes | 2fad0d5 | 2017-04-27 16:26:55 -0700 | [diff] [blame] | 2207 | name: "libc_kernel_android_uapi_linux", |
Dan Albert | bae16ef | 2016-09-14 17:15:48 -0700 | [diff] [blame] | 2208 | from: "kernel/android/uapi/linux", |
| 2209 | to: "linux", |
| 2210 | srcs: ["kernel/android/uapi/linux/**/*.h"], |
Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2211 | license: "NOTICE", |
Dan Albert | bae16ef | 2016-09-14 17:15:48 -0700 | [diff] [blame] | 2212 | } |
| 2213 | |
| 2214 | ndk_headers { |
Elliott Hughes | 2fad0d5 | 2017-04-27 16:26:55 -0700 | [diff] [blame] | 2215 | name: "libc_kernel_android_scsi", |
Elliott Hughes | 5059939 | 2017-05-25 17:13:32 -0700 | [diff] [blame] | 2216 | from: "kernel/android/scsi/scsi", |
Elliott Hughes | 2fad0d5 | 2017-04-27 16:26:55 -0700 | [diff] [blame] | 2217 | to: "scsi", |
| 2218 | srcs: ["kernel/android/scsi/**/*.h"], |
| 2219 | license: "NOTICE", |
| 2220 | } |
| 2221 | |
| 2222 | ndk_headers { |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2223 | name: "libc_asm_arm", |
| 2224 | from: "kernel/uapi/asm-arm", |
| 2225 | to: "arm-linux-androideabi", |
| 2226 | srcs: ["kernel/uapi/asm-arm/**/*.h"], |
Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2227 | license: "NOTICE", |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2228 | } |
| 2229 | |
| 2230 | ndk_headers { |
| 2231 | name: "libc_asm_arm64", |
| 2232 | from: "kernel/uapi/asm-arm64", |
| 2233 | to: "aarch64-linux-android", |
| 2234 | srcs: ["kernel/uapi/asm-arm64/**/*.h"], |
Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2235 | license: "NOTICE", |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2236 | } |
| 2237 | |
Lazar Trsic | 790d2f7 | 2017-11-27 11:54:11 +0100 | [diff] [blame] | 2238 | ndk_headers { |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2239 | name: "libc_asm_x86", |
| 2240 | from: "kernel/uapi/asm-x86", |
| 2241 | to: "i686-linux-android", |
| 2242 | srcs: ["kernel/uapi/asm-x86/**/*.h"], |
Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2243 | license: "NOTICE", |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2244 | } |
| 2245 | |
| 2246 | ndk_headers { |
| 2247 | name: "libc_asm_x86_64", |
| 2248 | from: "kernel/uapi/asm-x86", |
| 2249 | to: "x86_64-linux-android", |
| 2250 | srcs: ["kernel/uapi/asm-x86/**/*.h"], |
Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2251 | license: "NOTICE", |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2252 | } |
| 2253 | |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2254 | ndk_library { |
Dan Willemsen | 51a9bf1 | 2017-04-07 14:09:18 -0700 | [diff] [blame] | 2255 | name: "libc", |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2256 | symbol_file: "libc.map.txt", |
| 2257 | first_version: "9", |
| 2258 | } |
| 2259 | |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2260 | llndk_library { |
Colin Cross | 8393a8b | 2020-10-19 13:37:49 -0700 | [diff] [blame] | 2261 | name: "libc.llndk", |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2262 | symbol_file: "libc.map.txt", |
| 2263 | export_headers_as_system: true, |
| 2264 | export_preprocessed_headers: ["include"], |
dimitry | 7f04880 | 2019-05-03 15:57:34 +0200 | [diff] [blame] | 2265 | native_bridge_supported: true, |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 2266 | export_include_dirs: [ |
Wenhao Wang | 69537f1 | 2019-12-17 13:54:04 -0800 | [diff] [blame] | 2267 | "kernel/android/scsi", |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 2268 | "kernel/android/uapi", |
| 2269 | "kernel/uapi", |
| 2270 | ], |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2271 | arch: { |
| 2272 | arm: { |
| 2273 | export_include_dirs: [ |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2274 | "kernel/uapi/asm-arm", |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2275 | ], |
| 2276 | }, |
| 2277 | arm64: { |
| 2278 | export_include_dirs: [ |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2279 | "kernel/uapi/asm-arm64", |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2280 | ], |
| 2281 | }, |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2282 | x86: { |
| 2283 | export_include_dirs: [ |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2284 | "kernel/uapi/asm-x86", |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2285 | ], |
| 2286 | }, |
| 2287 | x86_64: { |
| 2288 | export_include_dirs: [ |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2289 | "kernel/uapi/asm-x86", |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2290 | ], |
| 2291 | }, |
| 2292 | }, |
| 2293 | } |
| 2294 | |
Dan Albert | df31aff | 2016-10-06 15:50:41 -0700 | [diff] [blame] | 2295 | ndk_library { |
Dan Willemsen | 51a9bf1 | 2017-04-07 14:09:18 -0700 | [diff] [blame] | 2296 | name: "libstdc++", |
Dan Albert | df31aff | 2016-10-06 15:50:41 -0700 | [diff] [blame] | 2297 | symbol_file: "libstdc++.map.txt", |
| 2298 | first_version: "9", |
| 2299 | } |
| 2300 | |
Dan Willemsen | ca056d7 | 2018-01-08 14:00:24 -0800 | [diff] [blame] | 2301 | // Export these headers for toolbox to process |
| 2302 | filegroup { |
| 2303 | name: "kernel_input_headers", |
| 2304 | srcs: [ |
| 2305 | "kernel/uapi/linux/input.h", |
| 2306 | "kernel/uapi/linux/input-event-codes.h", |
| 2307 | ], |
| 2308 | } |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2309 | |
| 2310 | // Generate a syscall name / number mapping. These objects are text files |
| 2311 | // (thanks to the -dD -E flags) and not binary files. They will then be |
| 2312 | // consumed by the genseccomp.py script and converted into C++ code. |
| 2313 | cc_defaults { |
| 2314 | name: "libseccomp_gen_syscall_nrs_defaults", |
| 2315 | recovery_available: true, |
| 2316 | srcs: ["seccomp/gen_syscall_nrs.cpp"], |
| 2317 | cflags: [ |
| 2318 | "-dD", |
| 2319 | "-E", |
| 2320 | "-Wall", |
| 2321 | "-Werror", |
| 2322 | "-nostdinc", |
| 2323 | ], |
| 2324 | } |
| 2325 | |
| 2326 | cc_object { |
| 2327 | name: "libseccomp_gen_syscall_nrs_arm", |
| 2328 | defaults: ["libseccomp_gen_syscall_nrs_defaults"], |
| 2329 | local_include_dirs: [ |
| 2330 | "kernel/uapi/asm-arm", |
| 2331 | "kernel/uapi", |
| 2332 | ], |
| 2333 | } |
| 2334 | |
| 2335 | cc_object { |
| 2336 | name: "libseccomp_gen_syscall_nrs_arm64", |
| 2337 | defaults: ["libseccomp_gen_syscall_nrs_defaults"], |
| 2338 | local_include_dirs: [ |
| 2339 | "kernel/uapi/asm-arm64", |
| 2340 | "kernel/uapi", |
| 2341 | ], |
| 2342 | } |
| 2343 | |
| 2344 | cc_object { |
| 2345 | name: "libseccomp_gen_syscall_nrs_x86", |
| 2346 | defaults: ["libseccomp_gen_syscall_nrs_defaults"], |
| 2347 | srcs: ["seccomp/gen_syscall_nrs_x86.cpp"], |
| 2348 | exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"], |
| 2349 | local_include_dirs: [ |
| 2350 | "kernel/uapi/asm-x86", |
| 2351 | "kernel/uapi", |
| 2352 | ], |
| 2353 | } |
| 2354 | |
| 2355 | cc_object { |
| 2356 | name: "libseccomp_gen_syscall_nrs_x86_64", |
| 2357 | defaults: ["libseccomp_gen_syscall_nrs_defaults"], |
| 2358 | srcs: ["seccomp/gen_syscall_nrs_x86_64.cpp"], |
| 2359 | exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"], |
| 2360 | local_include_dirs: [ |
| 2361 | "kernel/uapi/asm-x86", |
| 2362 | "kernel/uapi", |
| 2363 | ], |
| 2364 | } |
| 2365 | |
Jingwen Chen | ca36633 | 2021-01-29 05:16:32 -0500 | [diff] [blame] | 2366 | filegroup { |
| 2367 | name: "all_kernel_uapi_headers", |
| 2368 | srcs: ["kernel/uapi/**/*.h"], |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2369 | } |
| 2370 | |
Martijn Coenen | 0c6de75 | 2019-01-02 12:52:51 +0100 | [diff] [blame] | 2371 | |
| 2372 | cc_genrule { |
| 2373 | name: "func_to_syscall_nrs", |
| 2374 | recovery_available: true, |
| 2375 | cmd: "$(location genfunctosyscallnrs) --out-dir=$(genDir) $(in)", |
| 2376 | |
| 2377 | tools: [ "genfunctosyscallnrs" ], |
| 2378 | |
| 2379 | srcs: [ |
| 2380 | "SYSCALLS.TXT", |
| 2381 | ":libseccomp_gen_syscall_nrs_arm", |
| 2382 | ":libseccomp_gen_syscall_nrs_arm64", |
Martijn Coenen | 0c6de75 | 2019-01-02 12:52:51 +0100 | [diff] [blame] | 2383 | ":libseccomp_gen_syscall_nrs_x86", |
| 2384 | ":libseccomp_gen_syscall_nrs_x86_64", |
| 2385 | ], |
| 2386 | |
| 2387 | out: [ |
| 2388 | "func_to_syscall_nrs.h", |
| 2389 | ], |
| 2390 | } |
| 2391 | |
Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2392 | // SECCOMP_BLOCKLIST_APP_ZYGOTE.TXT = SECCOMP_BLOCKLIST_APP.txt - setresgid* |
Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2393 | genrule { |
Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2394 | name: "generate_app_zygote_blocklist", |
| 2395 | out: ["SECCOMP_BLOCKLIST_APP_ZYGOTE.TXT"], |
| 2396 | srcs: ["SECCOMP_BLOCKLIST_APP.TXT"], |
Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2397 | cmd: "grep -v '^int[ \t]*setresgid' $(in) > $(out)", |
| 2398 | } |
| 2399 | |
| 2400 | cc_genrule { |
| 2401 | name: "libseccomp_policy_app_zygote_sources", |
| 2402 | recovery_available: true, |
| 2403 | cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)", |
| 2404 | |
| 2405 | tools: [ "genseccomp" ], |
| 2406 | |
| 2407 | srcs: [ |
| 2408 | "SYSCALLS.TXT", |
Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2409 | "SECCOMP_ALLOWLIST_COMMON.TXT", |
| 2410 | "SECCOMP_ALLOWLIST_APP.TXT", |
| 2411 | "SECCOMP_BLOCKLIST_COMMON.TXT", |
Bram Bonné | acadd09 | 2020-05-06 13:49:55 +0200 | [diff] [blame] | 2412 | "SECCOMP_PRIORITY.TXT", |
Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2413 | ":generate_app_zygote_blocklist", |
Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2414 | ":libseccomp_gen_syscall_nrs_arm", |
| 2415 | ":libseccomp_gen_syscall_nrs_arm64", |
Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2416 | ":libseccomp_gen_syscall_nrs_x86", |
| 2417 | ":libseccomp_gen_syscall_nrs_x86_64", |
| 2418 | ], |
| 2419 | |
| 2420 | out: [ |
| 2421 | "arm64_app_zygote_policy.cpp", |
| 2422 | "arm_app_zygote_policy.cpp", |
Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2423 | "x86_64_app_zygote_policy.cpp", |
| 2424 | "x86_app_zygote_policy.cpp", |
| 2425 | ], |
| 2426 | } |
| 2427 | |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2428 | cc_genrule { |
| 2429 | name: "libseccomp_policy_app_sources", |
| 2430 | recovery_available: true, |
| 2431 | cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)", |
| 2432 | |
| 2433 | tools: [ "genseccomp" ], |
| 2434 | |
| 2435 | srcs: [ |
| 2436 | "SYSCALLS.TXT", |
Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2437 | "SECCOMP_ALLOWLIST_COMMON.TXT", |
| 2438 | "SECCOMP_ALLOWLIST_APP.TXT", |
| 2439 | "SECCOMP_BLOCKLIST_COMMON.TXT", |
| 2440 | "SECCOMP_BLOCKLIST_APP.TXT", |
Bram Bonné | acadd09 | 2020-05-06 13:49:55 +0200 | [diff] [blame] | 2441 | "SECCOMP_PRIORITY.TXT", |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2442 | ":libseccomp_gen_syscall_nrs_arm", |
| 2443 | ":libseccomp_gen_syscall_nrs_arm64", |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2444 | ":libseccomp_gen_syscall_nrs_x86", |
| 2445 | ":libseccomp_gen_syscall_nrs_x86_64", |
| 2446 | ], |
| 2447 | |
| 2448 | out: [ |
| 2449 | "arm64_app_policy.cpp", |
| 2450 | "arm_app_policy.cpp", |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2451 | "x86_64_app_policy.cpp", |
| 2452 | "x86_app_policy.cpp", |
| 2453 | ], |
| 2454 | } |
| 2455 | |
| 2456 | cc_genrule { |
| 2457 | name: "libseccomp_policy_system_sources", |
| 2458 | recovery_available: true, |
| 2459 | cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)", |
| 2460 | |
| 2461 | tools: [ "genseccomp" ], |
| 2462 | |
| 2463 | srcs: [ |
| 2464 | "SYSCALLS.TXT", |
Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2465 | "SECCOMP_ALLOWLIST_COMMON.TXT", |
| 2466 | "SECCOMP_ALLOWLIST_SYSTEM.TXT", |
| 2467 | "SECCOMP_BLOCKLIST_COMMON.TXT", |
Bram Bonné | acadd09 | 2020-05-06 13:49:55 +0200 | [diff] [blame] | 2468 | "SECCOMP_PRIORITY.TXT", |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2469 | ":libseccomp_gen_syscall_nrs_arm", |
| 2470 | ":libseccomp_gen_syscall_nrs_arm64", |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2471 | ":libseccomp_gen_syscall_nrs_x86", |
| 2472 | ":libseccomp_gen_syscall_nrs_x86_64", |
| 2473 | ], |
| 2474 | |
| 2475 | out: [ |
| 2476 | "arm64_system_policy.cpp", |
| 2477 | "arm_system_policy.cpp", |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2478 | "x86_64_system_policy.cpp", |
| 2479 | "x86_system_policy.cpp", |
| 2480 | ], |
| 2481 | } |
| 2482 | |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2483 | cc_library { |
| 2484 | name: "libseccomp_policy", |
| 2485 | recovery_available: true, |
Martijn Coenen | d269d9b | 2018-11-08 16:41:42 +0100 | [diff] [blame] | 2486 | generated_headers: ["func_to_syscall_nrs"], |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2487 | generated_sources: [ |
| 2488 | "libseccomp_policy_app_sources", |
Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2489 | "libseccomp_policy_app_zygote_sources", |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2490 | "libseccomp_policy_system_sources", |
| 2491 | ], |
| 2492 | |
| 2493 | srcs: [ |
| 2494 | "seccomp/seccomp_policy.cpp", |
| 2495 | ], |
| 2496 | |
| 2497 | export_include_dirs: ["seccomp/include"], |
| 2498 | cflags: [ |
| 2499 | "-Wall", |
| 2500 | "-Werror", |
| 2501 | ], |
| 2502 | shared: { |
| 2503 | shared_libs: ["libbase"], |
| 2504 | }, |
| 2505 | static: { |
| 2506 | static_libs: ["libbase"], |
| 2507 | }, |
| 2508 | } |
Christopher Ferris | fc26d71 | 2019-02-27 18:07:55 -0800 | [diff] [blame] | 2509 | |
Christopher Ferris | fc26d71 | 2019-02-27 18:07:55 -0800 | [diff] [blame] | 2510 | subdirs = [ |
| 2511 | "bionic/scudo", |
| 2512 | ] |