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