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