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