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