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