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