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