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