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