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