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 = [ |
| 4 | "bionic/bindresvport.c", |
| 5 | "bionic/ether_aton.c", |
| 6 | "bionic/ether_ntoa.c", |
| 7 | "bionic/fts.c", |
| 8 | "bionic/getpriority.c", |
| 9 | "bionic/if_indextoname.c", |
| 10 | "bionic/if_nametoindex.c", |
| 11 | "bionic/initgroups.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 12 | "bionic/isatty.c", |
| 13 | "bionic/memmem.c", |
| 14 | "bionic/pututline.c", |
| 15 | "bionic/sched_cpualloc.c", |
| 16 | "bionic/sched_cpucount.c", |
| 17 | "bionic/sigblock.c", |
| 18 | "bionic/siginterrupt.c", |
| 19 | "bionic/sigsetmask.c", |
| 20 | "bionic/system_properties_compat.c", |
| 21 | "stdio/findfp.c", |
| 22 | "stdio/fread.c", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 23 | "stdio/refill.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 24 | "stdio/snprintf.c", |
| 25 | "stdio/sprintf.c", |
| 26 | "stdio/stdio.c", |
| 27 | "stdio/stdio_ext.cpp", |
| 28 | "stdlib/atexit.c", |
| 29 | "stdlib/exit.c", |
| 30 | |
| 31 | // Fortify implementations of libc functions. |
| 32 | "bionic/__FD_chk.cpp", |
| 33 | "bionic/__fgets_chk.cpp", |
| 34 | "bionic/__fread_chk.cpp", |
| 35 | "bionic/__fwrite_chk.cpp", |
| 36 | "bionic/__getcwd_chk.cpp", |
| 37 | "bionic/__memchr_chk.cpp", |
| 38 | "bionic/__memmove_chk.cpp", |
| 39 | "bionic/__memrchr_chk.cpp", |
| 40 | "bionic/__poll_chk.cpp", |
| 41 | "bionic/__pread64_chk.cpp", |
| 42 | "bionic/__pread_chk.cpp", |
| 43 | "bionic/__pwrite64_chk.cpp", |
| 44 | "bionic/__pwrite_chk.cpp", |
| 45 | "bionic/__read_chk.cpp", |
| 46 | "bionic/__readlink_chk.cpp", |
| 47 | "bionic/__readlinkat_chk.cpp", |
| 48 | "bionic/__recvfrom_chk.cpp", |
| 49 | "bionic/__stpcpy_chk.cpp", |
| 50 | "bionic/__stpncpy_chk.cpp", |
| 51 | "bionic/__strchr_chk.cpp", |
| 52 | "bionic/__strlcat_chk.cpp", |
| 53 | "bionic/__strlcpy_chk.cpp", |
| 54 | "bionic/__strlen_chk.cpp", |
| 55 | "bionic/__strncat_chk.cpp", |
| 56 | "bionic/__strncpy_chk.cpp", |
| 57 | "bionic/__strrchr_chk.cpp", |
| 58 | "bionic/__umask_chk.cpp", |
| 59 | "bionic/__vsnprintf_chk.cpp", |
| 60 | "bionic/__vsprintf_chk.cpp", |
| 61 | "bionic/__write_chk.cpp", |
| 62 | ] |
| 63 | |
| 64 | // Various kinds of cruft. |
| 65 | // ======================================================== |
| 66 | libc_common_src_files += [ |
| 67 | "bionic/ndk_cruft.cpp", |
| 68 | ] |
| 69 | |
| 70 | libc_common_src_files_32 = [ |
| 71 | "bionic/legacy_32_bit_support.cpp", |
| 72 | "bionic/time64.c", |
| 73 | ] |
| 74 | |
| 75 | // Define some common cflags |
| 76 | // ======================================================== |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 77 | cc_defaults { |
| 78 | name: "libc_defaults", |
| 79 | cflags: [ |
| 80 | "-D_LIBC=1", |
| 81 | "-Wall", |
| 82 | "-Wextra", |
| 83 | "-Wunused", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 84 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 85 | // Try to catch typical 32-bit assumptions that break with 64-bit pointers. |
| 86 | "-Werror=pointer-to-int-cast", |
| 87 | "-Werror=int-to-pointer-cast", |
| 88 | "-Werror=type-limits", |
| 89 | "-Werror", |
| 90 | ], |
| 91 | // TODO: split out the asflags. |
| 92 | asflags: [ |
| 93 | "-D_LIBC=1", |
| 94 | "-Wall", |
| 95 | "-Wextra", |
| 96 | "-Wunused", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 97 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 98 | // Try to catch typical 32-bit assumptions that break with 64-bit pointers. |
| 99 | "-Werror=pointer-to-int-cast", |
| 100 | "-Werror=int-to-pointer-cast", |
| 101 | "-Werror=type-limits", |
| 102 | "-Werror", |
| 103 | ], |
| 104 | conlyflags: ["-std=gnu99"], |
| 105 | cppflags: [], |
| 106 | |
| 107 | product_variables: { |
| 108 | device_uses_jemalloc: { |
| 109 | cflags: ["-DUSE_JEMALLOC"], |
| 110 | include_dirs: ["external/jemalloc/include"], |
| 111 | }, |
| 112 | device_uses_dlmalloc: { |
| 113 | cflags: ["-DUSE_DLMALLOC"], |
| 114 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 115 | }, |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 116 | arch: { |
Dan Willemsen | e4f486c | 2016-01-13 23:22:22 -0800 | [diff] [blame^] | 117 | // Clang/llvm has incompatible long double (fp128) for x86_64. |
| 118 | // https://llvm.org/bugs/show_bug.cgi?id=23897 |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 119 | x86_64: { |
| 120 | clang: false, |
| 121 | }, |
Dan Willemsen | e4f486c | 2016-01-13 23:22:22 -0800 | [diff] [blame^] | 122 | // b/25291096, Clang/llvm compiled libc.so for mips/mips64 failed to boot. |
| 123 | mips: { |
| 124 | clang: false, |
| 125 | }, |
| 126 | mips64: { |
| 127 | clang: false, |
| 128 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 129 | }, |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 130 | |
| 131 | stl: "none", |
| 132 | system_shared_libs: [], |
| 133 | sanitize: ["never"], |
| 134 | native_coverage: false, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 135 | } |
| 136 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 137 | // ANDROIDMK TRANSLATION ERROR: unsupported directive |
| 138 | // ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true) |
| 139 | //libc_common_cflags += ["-DDEBUG"] |
| 140 | // ANDROIDMK TRANSLATION ERROR: unsupported directive |
| 141 | // endif |
| 142 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 143 | // ======================================================== |
| 144 | // libc_stack_protector.a - stack protector code |
| 145 | // ======================================================== |
| 146 | // |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 147 | // Code that implements the stack protector (or that runs |
| 148 | // before TLS has been set up) needs to be compiled with |
| 149 | // -fno-stack-protector, since it accesses the stack canary |
| 150 | // TLS slot. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 151 | |
| 152 | cc_library_static { |
| 153 | |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 154 | srcs: [ |
| 155 | "bionic/__libc_init_main_thread.cpp", |
| 156 | "bionic/__stack_chk_fail.cpp", |
| 157 | ], |
| 158 | arch: { |
| 159 | arm64: { |
| 160 | srcs: ["arch-arm64/bionic/__set_tls.c"], |
| 161 | }, |
| 162 | x86: { |
Dan Willemsen | 4031cbe | 2016-01-13 13:36:11 -0800 | [diff] [blame] | 163 | srcs: ["arch-x86/bionic/__set_tls.c"], |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 164 | }, |
| 165 | x86_64: { |
| 166 | srcs: ["arch-x86_64/bionic/__set_tls.c"], |
| 167 | }, |
| 168 | }, |
| 169 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 170 | defaults: ["libc_defaults"], |
| 171 | cflags: ["-fno-stack-protector"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 172 | name: "libc_stack_protector", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 173 | } |
| 174 | |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 175 | // libc_init_static.cpp also needs to be built without stack protector, |
| 176 | // because it's responsible for setting up TLS for static executables. |
| 177 | // This isn't the case for dynamic executables because the dynamic linker |
| 178 | // has already set up the main thread's TLS. |
| 179 | |
| 180 | cc_library_static { |
| 181 | name: "libc_init_static", |
| 182 | defaults: ["libc_defaults"], |
| 183 | srcs: ["bionic/libc_init_static.cpp"], |
| 184 | cflags: ["-fno-stack-protector"], |
| 185 | } |
| 186 | |
| 187 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 188 | // ======================================================== |
| 189 | // libc_tzcode.a - upstream 'tzcode' code |
| 190 | // ======================================================== |
| 191 | |
| 192 | cc_library_static { |
| 193 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 194 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 195 | srcs: [ |
| 196 | "tzcode/asctime.c", |
| 197 | "tzcode/difftime.c", |
| 198 | "tzcode/localtime.c", |
| 199 | "tzcode/strftime.c", |
| 200 | "tzcode/strptime.c", |
| 201 | "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one. |
| 202 | ], |
| 203 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 204 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 205 | "-fvisibility=hidden", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 206 | "-Wno-unused-parameter", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 207 | // Don't use ridiculous amounts of stack. |
| 208 | "-DALL_STATE", |
| 209 | // Include tzsetwall, timelocal, timegm, time2posix, and posix2time. |
| 210 | "-DSTD_INSPIRED", |
Colin Cross | a35d23d | 2015-11-19 13:32:49 -0800 | [diff] [blame] | 211 | // Obviously, we want to be thread-safe. |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 212 | "-DTHREAD_SAFE", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 213 | // The name of the tm_gmtoff field in our struct tm. |
| 214 | "-DTM_GMTOFF=tm_gmtoff", |
| 215 | // Where we store our tzdata. |
| 216 | "-DTZDIR=\\\"/system/usr/share/zoneinfo\\\"", |
| 217 | // Include timezone and daylight globals. |
| 218 | "-DUSG_COMPAT=1", |
Colin Cross | a35d23d | 2015-11-19 13:32:49 -0800 | [diff] [blame] | 219 | // Use the empty string (instead of " ") as the timezone abbreviation |
| 220 | // fallback. |
| 221 | "-DWILDABBR=\\\"\\\"", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 222 | "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU", |
| 223 | "-Dlint", |
| 224 | ], |
| 225 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 226 | local_include_dirs: ["tzcode/"], |
| 227 | name: "libc_tzcode", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 228 | } |
| 229 | |
| 230 | // ======================================================== |
| 231 | // libc_dns.a - modified NetBSD DNS code |
| 232 | // ======================================================== |
| 233 | |
| 234 | cc_library_static { |
| 235 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 236 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 237 | srcs: [ |
| 238 | "dns/net/gethnamaddr.c", |
| 239 | "dns/net/getservbyname.c", |
| 240 | "dns/net/getservbyport.c", |
| 241 | "dns/net/getaddrinfo.c", |
| 242 | "dns/net/getnameinfo.c", |
| 243 | "dns/net/sethostent.c", |
| 244 | "dns/net/getservent.c", |
| 245 | "dns/net/nsdispatch.c", |
| 246 | "dns/net/base64.c", |
| 247 | "dns/resolv/res_state.c", |
| 248 | "dns/resolv/res_init.c", |
| 249 | "dns/resolv/res_mkquery.c", |
| 250 | "dns/resolv/res_data.c", |
| 251 | "dns/resolv/res_debug.c", |
| 252 | "dns/resolv/herror.c", |
| 253 | "dns/resolv/res_cache.c", |
| 254 | "dns/resolv/res_query.c", |
| 255 | "dns/resolv/res_comp.c", |
| 256 | "dns/resolv/res_send.c", |
| 257 | "dns/nameser/ns_name.c", |
| 258 | "dns/nameser/ns_print.c", |
| 259 | "dns/nameser/ns_parse.c", |
| 260 | "dns/nameser/ns_ttl.c", |
| 261 | "dns/nameser/ns_netint.c", |
| 262 | "dns/nameser/ns_samedomain.c", |
| 263 | |
| 264 | "upstream-netbsd/lib/libc/isc/ev_streams.c", |
| 265 | "upstream-netbsd/lib/libc/isc/ev_timers.c", |
| 266 | "upstream-netbsd/lib/libc/resolv/mtctxres.c", |
| 267 | // We use the OpenBSD res_random. |
| 268 | "upstream-openbsd/lib/libc/net/res_random.c", |
| 269 | ], |
| 270 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 271 | cflags: [ |
| 272 | "-Dres_randomid=__res_randomid", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 273 | "-DANDROID_CHANGES", |
| 274 | "-DINET6", |
| 275 | "-fvisibility=hidden", |
| 276 | "-Wno-unused-parameter", |
| 277 | "-include netbsd-compat.h", |
| 278 | ], |
| 279 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 280 | local_include_dirs: [ |
| 281 | "dns/include", |
| 282 | "private", |
| 283 | "upstream-netbsd/lib/libc/include", |
| 284 | "upstream-netbsd/android/include", |
| 285 | ], |
| 286 | |
| 287 | name: "libc_dns", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | // ======================================================== |
| 291 | // libc_freebsd.a - upstream FreeBSD C library code |
| 292 | // ======================================================== |
| 293 | // |
| 294 | // These files are built with the freebsd-compat.h header file |
| 295 | // automatically included. |
| 296 | |
| 297 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 298 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 299 | srcs: [ |
| 300 | "upstream-freebsd/lib/libc/gen/ldexp.c", |
| 301 | "upstream-freebsd/lib/libc/gen/sleep.c", |
| 302 | "upstream-freebsd/lib/libc/gen/usleep.c", |
| 303 | "upstream-freebsd/lib/libc/stdlib/getopt_long.c", |
| 304 | "upstream-freebsd/lib/libc/stdlib/qsort.c", |
| 305 | "upstream-freebsd/lib/libc/stdlib/quick_exit.c", |
| 306 | "upstream-freebsd/lib/libc/stdlib/realpath.c", |
| 307 | "upstream-freebsd/lib/libc/string/wcpcpy.c", |
| 308 | "upstream-freebsd/lib/libc/string/wcpncpy.c", |
| 309 | "upstream-freebsd/lib/libc/string/wcscasecmp.c", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 310 | "upstream-freebsd/lib/libc/string/wcscat.c", |
| 311 | "upstream-freebsd/lib/libc/string/wcschr.c", |
| 312 | "upstream-freebsd/lib/libc/string/wcscmp.c", |
| 313 | "upstream-freebsd/lib/libc/string/wcscpy.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 314 | "upstream-freebsd/lib/libc/string/wcscspn.c", |
| 315 | "upstream-freebsd/lib/libc/string/wcsdup.c", |
| 316 | "upstream-freebsd/lib/libc/string/wcslcat.c", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 317 | "upstream-freebsd/lib/libc/string/wcslen.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 318 | "upstream-freebsd/lib/libc/string/wcsncasecmp.c", |
| 319 | "upstream-freebsd/lib/libc/string/wcsncat.c", |
| 320 | "upstream-freebsd/lib/libc/string/wcsncmp.c", |
| 321 | "upstream-freebsd/lib/libc/string/wcsncpy.c", |
| 322 | "upstream-freebsd/lib/libc/string/wcsnlen.c", |
| 323 | "upstream-freebsd/lib/libc/string/wcspbrk.c", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 324 | "upstream-freebsd/lib/libc/string/wcsrchr.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 325 | "upstream-freebsd/lib/libc/string/wcsspn.c", |
| 326 | "upstream-freebsd/lib/libc/string/wcstok.c", |
| 327 | "upstream-freebsd/lib/libc/string/wmemchr.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 328 | "upstream-freebsd/lib/libc/string/wmemcmp.c", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 329 | "upstream-freebsd/lib/libc/string/wmemset.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 330 | "upstream-freebsd/lib/libc/string/wmemmove.c", |
| 331 | ], |
| 332 | arch: { |
| 333 | arm64: { |
| 334 | exclude_srcs: [ |
| 335 | "upstream-freebsd/lib/libc/string/wmemmove.c", |
| 336 | ], |
| 337 | }, |
| 338 | x86: { |
| 339 | exclude_srcs: [ |
| 340 | "upstream-freebsd/lib/libc/string/wcschr.c", |
| 341 | "upstream-freebsd/lib/libc/string/wcscmp.c", |
| 342 | "upstream-freebsd/lib/libc/string/wcslen.c", |
| 343 | "upstream-freebsd/lib/libc/string/wcsrchr.c", |
| 344 | ], |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 345 | atom: { |
| 346 | exclude_srcs: [ |
| 347 | "upstream-freebsd/lib/libc/string/wmemcmp.c", |
| 348 | ], |
| 349 | }, |
| 350 | ssse3: { |
| 351 | exclude_srcs: [ |
| 352 | "upstream-freebsd/lib/libc/string/wcscat.c", |
| 353 | "upstream-freebsd/lib/libc/string/wcscpy.c", |
| 354 | ], |
| 355 | }, |
| 356 | sse4: { |
| 357 | exclude_srcs: [ |
| 358 | "upstream-freebsd/lib/libc/string/wmemcmp.c", |
| 359 | ], |
| 360 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 361 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 362 | }, |
| 363 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 364 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 365 | "-Wno-sign-compare", |
| 366 | "-Wno-uninitialized", |
| 367 | "-include freebsd-compat.h", |
| 368 | ], |
| 369 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 370 | local_include_dirs: [ |
| 371 | "upstream-freebsd/android/include", |
| 372 | ], |
| 373 | |
| 374 | name: "libc_freebsd", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 375 | } |
| 376 | |
| 377 | // ======================================================== |
| 378 | // libc_netbsd.a - upstream NetBSD C library code |
| 379 | // ======================================================== |
| 380 | // |
| 381 | // These files are built with the netbsd-compat.h header file |
| 382 | // automatically included. |
| 383 | |
| 384 | cc_library_static { |
| 385 | |
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: [ |
| 388 | "upstream-netbsd/common/lib/libc/stdlib/random.c", |
| 389 | "upstream-netbsd/lib/libc/gen/ftw.c", |
| 390 | "upstream-netbsd/lib/libc/gen/nftw.c", |
| 391 | "upstream-netbsd/lib/libc/gen/nice.c", |
| 392 | "upstream-netbsd/lib/libc/gen/popen.c", |
| 393 | "upstream-netbsd/lib/libc/gen/psignal.c", |
| 394 | "upstream-netbsd/lib/libc/gen/utime.c", |
| 395 | "upstream-netbsd/lib/libc/gen/utmp.c", |
| 396 | "upstream-netbsd/lib/libc/inet/nsap_addr.c", |
| 397 | "upstream-netbsd/lib/libc/regex/regcomp.c", |
| 398 | "upstream-netbsd/lib/libc/regex/regerror.c", |
| 399 | "upstream-netbsd/lib/libc/regex/regexec.c", |
| 400 | "upstream-netbsd/lib/libc/regex/regfree.c", |
| 401 | "upstream-netbsd/lib/libc/stdlib/bsearch.c", |
| 402 | "upstream-netbsd/lib/libc/stdlib/div.c", |
| 403 | "upstream-netbsd/lib/libc/stdlib/drand48.c", |
| 404 | "upstream-netbsd/lib/libc/stdlib/erand48.c", |
| 405 | "upstream-netbsd/lib/libc/stdlib/jrand48.c", |
| 406 | "upstream-netbsd/lib/libc/stdlib/lcong48.c", |
| 407 | "upstream-netbsd/lib/libc/stdlib/ldiv.c", |
| 408 | "upstream-netbsd/lib/libc/stdlib/lldiv.c", |
| 409 | "upstream-netbsd/lib/libc/stdlib/lrand48.c", |
| 410 | "upstream-netbsd/lib/libc/stdlib/mrand48.c", |
| 411 | "upstream-netbsd/lib/libc/stdlib/nrand48.c", |
| 412 | "upstream-netbsd/lib/libc/stdlib/_rand48.c", |
| 413 | "upstream-netbsd/lib/libc/stdlib/rand_r.c", |
| 414 | "upstream-netbsd/lib/libc/stdlib/reallocarr.c", |
| 415 | "upstream-netbsd/lib/libc/stdlib/seed48.c", |
| 416 | "upstream-netbsd/lib/libc/stdlib/srand48.c", |
| 417 | "upstream-netbsd/lib/libc/string/memccpy.c", |
| 418 | "upstream-netbsd/lib/libc/string/strcasestr.c", |
| 419 | "upstream-netbsd/lib/libc/string/strcoll.c", |
| 420 | "upstream-netbsd/lib/libc/string/strxfrm.c", |
| 421 | ], |
| 422 | multilib: { |
| 423 | lib32: { |
| 424 | // LP32 cruft |
| 425 | srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"], |
| 426 | }, |
| 427 | }, |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 428 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 429 | "-Wno-sign-compare", |
| 430 | "-Wno-uninitialized", |
| 431 | "-DPOSIX_MISTAKE", |
| 432 | "-include netbsd-compat.h", |
| 433 | ], |
| 434 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 435 | local_include_dirs: [ |
| 436 | "upstream-netbsd/android/include", |
| 437 | "upstream-netbsd/lib/libc/include", |
| 438 | ], |
| 439 | |
| 440 | name: "libc_netbsd", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 441 | } |
| 442 | |
| 443 | // ======================================================== |
| 444 | // libc_openbsd_ndk.a - upstream OpenBSD C library code |
| 445 | // that can be safely included in the libc_ndk.a (doesn't |
| 446 | // contain any troublesome global data or constructors). |
| 447 | // ======================================================== |
| 448 | // |
| 449 | // These files are built with the openbsd-compat.h header file |
| 450 | // automatically included. |
| 451 | |
| 452 | cc_library_static { |
| 453 | name: "libc_openbsd_ndk", |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 454 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 455 | srcs: [ |
| 456 | "upstream-openbsd/lib/libc/compat-43/killpg.c", |
| 457 | "upstream-openbsd/lib/libc/gen/alarm.c", |
| 458 | "upstream-openbsd/lib/libc/gen/ctype_.c", |
| 459 | "upstream-openbsd/lib/libc/gen/daemon.c", |
| 460 | "upstream-openbsd/lib/libc/gen/err.c", |
| 461 | "upstream-openbsd/lib/libc/gen/errx.c", |
| 462 | "upstream-openbsd/lib/libc/gen/exec.c", |
| 463 | "upstream-openbsd/lib/libc/gen/fnmatch.c", |
| 464 | "upstream-openbsd/lib/libc/gen/ftok.c", |
| 465 | "upstream-openbsd/lib/libc/gen/getprogname.c", |
| 466 | "upstream-openbsd/lib/libc/gen/isctype.c", |
| 467 | "upstream-openbsd/lib/libc/gen/setprogname.c", |
| 468 | "upstream-openbsd/lib/libc/gen/time.c", |
| 469 | "upstream-openbsd/lib/libc/gen/tolower_.c", |
| 470 | "upstream-openbsd/lib/libc/gen/toupper_.c", |
| 471 | "upstream-openbsd/lib/libc/gen/verr.c", |
| 472 | "upstream-openbsd/lib/libc/gen/verrx.c", |
| 473 | "upstream-openbsd/lib/libc/gen/vwarn.c", |
| 474 | "upstream-openbsd/lib/libc/gen/vwarnx.c", |
| 475 | "upstream-openbsd/lib/libc/gen/warn.c", |
| 476 | "upstream-openbsd/lib/libc/gen/warnx.c", |
| 477 | "upstream-openbsd/lib/libc/locale/btowc.c", |
| 478 | "upstream-openbsd/lib/libc/locale/mbrlen.c", |
| 479 | "upstream-openbsd/lib/libc/locale/mbstowcs.c", |
| 480 | "upstream-openbsd/lib/libc/locale/mbtowc.c", |
| 481 | "upstream-openbsd/lib/libc/locale/wcscoll.c", |
| 482 | "upstream-openbsd/lib/libc/locale/wcstod.c", |
| 483 | "upstream-openbsd/lib/libc/locale/wcstof.c", |
| 484 | "upstream-openbsd/lib/libc/locale/wcstoimax.c", |
| 485 | "upstream-openbsd/lib/libc/locale/wcstol.c", |
| 486 | "upstream-openbsd/lib/libc/locale/wcstold.c", |
| 487 | "upstream-openbsd/lib/libc/locale/wcstoll.c", |
| 488 | "upstream-openbsd/lib/libc/locale/wcstombs.c", |
| 489 | "upstream-openbsd/lib/libc/locale/wcstoul.c", |
| 490 | "upstream-openbsd/lib/libc/locale/wcstoull.c", |
| 491 | "upstream-openbsd/lib/libc/locale/wcstoumax.c", |
| 492 | "upstream-openbsd/lib/libc/locale/wcsxfrm.c", |
| 493 | "upstream-openbsd/lib/libc/locale/wctob.c", |
| 494 | "upstream-openbsd/lib/libc/locale/wctomb.c", |
| 495 | "upstream-openbsd/lib/libc/net/htonl.c", |
| 496 | "upstream-openbsd/lib/libc/net/htons.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 497 | "upstream-openbsd/lib/libc/net/inet_lnaof.c", |
| 498 | "upstream-openbsd/lib/libc/net/inet_makeaddr.c", |
| 499 | "upstream-openbsd/lib/libc/net/inet_netof.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 500 | "upstream-openbsd/lib/libc/net/inet_ntoa.c", |
| 501 | "upstream-openbsd/lib/libc/net/inet_ntop.c", |
| 502 | "upstream-openbsd/lib/libc/net/inet_pton.c", |
| 503 | "upstream-openbsd/lib/libc/net/ntohl.c", |
| 504 | "upstream-openbsd/lib/libc/net/ntohs.c", |
| 505 | "upstream-openbsd/lib/libc/stdio/asprintf.c", |
| 506 | "upstream-openbsd/lib/libc/stdio/clrerr.c", |
| 507 | "upstream-openbsd/lib/libc/stdio/dprintf.c", |
| 508 | "upstream-openbsd/lib/libc/stdio/fclose.c", |
| 509 | "upstream-openbsd/lib/libc/stdio/fdopen.c", |
| 510 | "upstream-openbsd/lib/libc/stdio/feof.c", |
| 511 | "upstream-openbsd/lib/libc/stdio/ferror.c", |
| 512 | "upstream-openbsd/lib/libc/stdio/fflush.c", |
| 513 | "upstream-openbsd/lib/libc/stdio/fgetc.c", |
| 514 | "upstream-openbsd/lib/libc/stdio/fgetln.c", |
| 515 | "upstream-openbsd/lib/libc/stdio/fgetpos.c", |
| 516 | "upstream-openbsd/lib/libc/stdio/fgets.c", |
| 517 | "upstream-openbsd/lib/libc/stdio/fgetwc.c", |
| 518 | "upstream-openbsd/lib/libc/stdio/fgetws.c", |
| 519 | "upstream-openbsd/lib/libc/stdio/fileno.c", |
| 520 | "upstream-openbsd/lib/libc/stdio/flags.c", |
| 521 | "upstream-openbsd/lib/libc/stdio/fmemopen.c", |
| 522 | "upstream-openbsd/lib/libc/stdio/fopen.c", |
| 523 | "upstream-openbsd/lib/libc/stdio/fprintf.c", |
| 524 | "upstream-openbsd/lib/libc/stdio/fpurge.c", |
| 525 | "upstream-openbsd/lib/libc/stdio/fputc.c", |
| 526 | "upstream-openbsd/lib/libc/stdio/fputs.c", |
| 527 | "upstream-openbsd/lib/libc/stdio/fputwc.c", |
| 528 | "upstream-openbsd/lib/libc/stdio/fputws.c", |
| 529 | "upstream-openbsd/lib/libc/stdio/freopen.c", |
| 530 | "upstream-openbsd/lib/libc/stdio/fscanf.c", |
| 531 | "upstream-openbsd/lib/libc/stdio/fseek.c", |
| 532 | "upstream-openbsd/lib/libc/stdio/fsetpos.c", |
| 533 | "upstream-openbsd/lib/libc/stdio/ftell.c", |
| 534 | "upstream-openbsd/lib/libc/stdio/funopen.c", |
| 535 | "upstream-openbsd/lib/libc/stdio/fvwrite.c", |
| 536 | "upstream-openbsd/lib/libc/stdio/fwalk.c", |
| 537 | "upstream-openbsd/lib/libc/stdio/fwide.c", |
| 538 | "upstream-openbsd/lib/libc/stdio/fwprintf.c", |
| 539 | "upstream-openbsd/lib/libc/stdio/fwrite.c", |
| 540 | "upstream-openbsd/lib/libc/stdio/fwscanf.c", |
| 541 | "upstream-openbsd/lib/libc/stdio/getc.c", |
| 542 | "upstream-openbsd/lib/libc/stdio/getchar.c", |
| 543 | "upstream-openbsd/lib/libc/stdio/getdelim.c", |
| 544 | "upstream-openbsd/lib/libc/stdio/getline.c", |
| 545 | "upstream-openbsd/lib/libc/stdio/gets.c", |
| 546 | "upstream-openbsd/lib/libc/stdio/getwc.c", |
| 547 | "upstream-openbsd/lib/libc/stdio/getwchar.c", |
| 548 | "upstream-openbsd/lib/libc/stdio/makebuf.c", |
| 549 | "upstream-openbsd/lib/libc/stdio/mktemp.c", |
| 550 | "upstream-openbsd/lib/libc/stdio/open_memstream.c", |
| 551 | "upstream-openbsd/lib/libc/stdio/open_wmemstream.c", |
| 552 | "upstream-openbsd/lib/libc/stdio/perror.c", |
| 553 | "upstream-openbsd/lib/libc/stdio/printf.c", |
| 554 | "upstream-openbsd/lib/libc/stdio/putc.c", |
| 555 | "upstream-openbsd/lib/libc/stdio/putchar.c", |
| 556 | "upstream-openbsd/lib/libc/stdio/puts.c", |
| 557 | "upstream-openbsd/lib/libc/stdio/putwc.c", |
| 558 | "upstream-openbsd/lib/libc/stdio/putwchar.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 559 | "upstream-openbsd/lib/libc/stdio/remove.c", |
| 560 | "upstream-openbsd/lib/libc/stdio/rewind.c", |
| 561 | "upstream-openbsd/lib/libc/stdio/rget.c", |
| 562 | "upstream-openbsd/lib/libc/stdio/scanf.c", |
| 563 | "upstream-openbsd/lib/libc/stdio/setbuf.c", |
| 564 | "upstream-openbsd/lib/libc/stdio/setbuffer.c", |
| 565 | "upstream-openbsd/lib/libc/stdio/setvbuf.c", |
| 566 | "upstream-openbsd/lib/libc/stdio/sscanf.c", |
| 567 | "upstream-openbsd/lib/libc/stdio/swprintf.c", |
| 568 | "upstream-openbsd/lib/libc/stdio/swscanf.c", |
| 569 | "upstream-openbsd/lib/libc/stdio/tempnam.c", |
| 570 | "upstream-openbsd/lib/libc/stdio/tmpnam.c", |
| 571 | "upstream-openbsd/lib/libc/stdio/ungetc.c", |
| 572 | "upstream-openbsd/lib/libc/stdio/ungetwc.c", |
| 573 | "upstream-openbsd/lib/libc/stdio/vasprintf.c", |
| 574 | "upstream-openbsd/lib/libc/stdio/vdprintf.c", |
| 575 | "upstream-openbsd/lib/libc/stdio/vfprintf.c", |
| 576 | "upstream-openbsd/lib/libc/stdio/vfscanf.c", |
| 577 | "upstream-openbsd/lib/libc/stdio/vfwprintf.c", |
| 578 | "upstream-openbsd/lib/libc/stdio/vfwscanf.c", |
| 579 | "upstream-openbsd/lib/libc/stdio/vprintf.c", |
| 580 | "upstream-openbsd/lib/libc/stdio/vscanf.c", |
| 581 | "upstream-openbsd/lib/libc/stdio/vsnprintf.c", |
| 582 | "upstream-openbsd/lib/libc/stdio/vsprintf.c", |
| 583 | "upstream-openbsd/lib/libc/stdio/vsscanf.c", |
| 584 | "upstream-openbsd/lib/libc/stdio/vswprintf.c", |
| 585 | "upstream-openbsd/lib/libc/stdio/vswscanf.c", |
| 586 | "upstream-openbsd/lib/libc/stdio/vwprintf.c", |
| 587 | "upstream-openbsd/lib/libc/stdio/vwscanf.c", |
| 588 | "upstream-openbsd/lib/libc/stdio/wbuf.c", |
| 589 | "upstream-openbsd/lib/libc/stdio/wprintf.c", |
| 590 | "upstream-openbsd/lib/libc/stdio/wscanf.c", |
| 591 | "upstream-openbsd/lib/libc/stdio/wsetup.c", |
| 592 | "upstream-openbsd/lib/libc/stdlib/abs.c", |
| 593 | "upstream-openbsd/lib/libc/stdlib/atoi.c", |
| 594 | "upstream-openbsd/lib/libc/stdlib/atol.c", |
| 595 | "upstream-openbsd/lib/libc/stdlib/atoll.c", |
| 596 | "upstream-openbsd/lib/libc/stdlib/getenv.c", |
| 597 | "upstream-openbsd/lib/libc/stdlib/insque.c", |
| 598 | "upstream-openbsd/lib/libc/stdlib/imaxabs.c", |
| 599 | "upstream-openbsd/lib/libc/stdlib/imaxdiv.c", |
| 600 | "upstream-openbsd/lib/libc/stdlib/labs.c", |
| 601 | "upstream-openbsd/lib/libc/stdlib/llabs.c", |
| 602 | "upstream-openbsd/lib/libc/stdlib/lsearch.c", |
| 603 | "upstream-openbsd/lib/libc/stdlib/reallocarray.c", |
| 604 | "upstream-openbsd/lib/libc/stdlib/remque.c", |
| 605 | "upstream-openbsd/lib/libc/stdlib/setenv.c", |
| 606 | "upstream-openbsd/lib/libc/stdlib/strtoimax.c", |
| 607 | "upstream-openbsd/lib/libc/stdlib/strtol.c", |
| 608 | "upstream-openbsd/lib/libc/stdlib/strtoll.c", |
| 609 | "upstream-openbsd/lib/libc/stdlib/strtoul.c", |
| 610 | "upstream-openbsd/lib/libc/stdlib/strtoull.c", |
| 611 | "upstream-openbsd/lib/libc/stdlib/strtoumax.c", |
| 612 | "upstream-openbsd/lib/libc/stdlib/system.c", |
| 613 | "upstream-openbsd/lib/libc/stdlib/tfind.c", |
| 614 | "upstream-openbsd/lib/libc/stdlib/tsearch.c", |
| 615 | "upstream-openbsd/lib/libc/string/strcasecmp.c", |
| 616 | "upstream-openbsd/lib/libc/string/strcspn.c", |
| 617 | "upstream-openbsd/lib/libc/string/strdup.c", |
| 618 | "upstream-openbsd/lib/libc/string/strndup.c", |
| 619 | "upstream-openbsd/lib/libc/string/strpbrk.c", |
| 620 | "upstream-openbsd/lib/libc/string/strsep.c", |
| 621 | "upstream-openbsd/lib/libc/string/strspn.c", |
| 622 | "upstream-openbsd/lib/libc/string/strstr.c", |
| 623 | "upstream-openbsd/lib/libc/string/strtok.c", |
| 624 | "upstream-openbsd/lib/libc/string/wmemcpy.c", |
| 625 | "upstream-openbsd/lib/libc/string/wcslcpy.c", |
| 626 | "upstream-openbsd/lib/libc/string/wcsstr.c", |
| 627 | "upstream-openbsd/lib/libc/string/wcswidth.c", |
| 628 | ], |
| 629 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 630 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 631 | "-Wno-sign-compare", |
| 632 | "-Wno-uninitialized", |
| 633 | "-Wno-unused-parameter", |
| 634 | "-include openbsd-compat.h", |
| 635 | ], |
| 636 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 637 | local_include_dirs: [ |
| 638 | "private", |
| 639 | "stdio", |
| 640 | "upstream-openbsd/android/include", |
| 641 | "upstream-openbsd/lib/libc/include", |
| 642 | "upstream-openbsd/lib/libc/gdtoa/", |
| 643 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 644 | } |
| 645 | |
| 646 | // ======================================================== |
| 647 | // libc_openbsd.a - upstream OpenBSD C library code |
| 648 | // ======================================================== |
| 649 | // |
| 650 | // These files are built with the openbsd-compat.h header file |
| 651 | // automatically included. |
| 652 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 653 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 654 | srcs: [ |
Dan Willemsen | 35e91a1 | 2015-09-17 15:28:45 -0700 | [diff] [blame] | 655 | // These two depend on getentropy_linux.c, which isn't in libc_ndk.a. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 656 | "upstream-openbsd/lib/libc/crypt/arc4random.c", |
| 657 | "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c", |
| 658 | |
| 659 | // May be overriden by per-arch optimized versions |
| 660 | "upstream-openbsd/lib/libc/string/memchr.c", |
| 661 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 662 | "upstream-openbsd/lib/libc/string/memrchr.c", |
| 663 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 664 | "upstream-openbsd/lib/libc/string/stpncpy.c", |
| 665 | "upstream-openbsd/lib/libc/string/strcat.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 666 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 667 | "upstream-openbsd/lib/libc/string/strlcat.c", |
| 668 | "upstream-openbsd/lib/libc/string/strlcpy.c", |
| 669 | "upstream-openbsd/lib/libc/string/strncat.c", |
| 670 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 671 | "upstream-openbsd/lib/libc/string/strncpy.c", |
| 672 | ], |
| 673 | multilib: { |
| 674 | lib32: { |
| 675 | // LP32 cruft |
| 676 | srcs: ["upstream-openbsd/lib/libc/stdio/putw.c"], |
| 677 | }, |
| 678 | }, |
| 679 | |
| 680 | arch: { |
| 681 | arm: { |
| 682 | exclude_srcs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 683 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 684 | ], |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 685 | cortex_a7: { |
| 686 | exclude_srcs: [ |
| 687 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 688 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 689 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 690 | ], |
| 691 | }, |
| 692 | cortex_a53: { |
| 693 | exclude_srcs: [ |
| 694 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 695 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 696 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 697 | ], |
| 698 | }, |
| 699 | cortex_a53_a57: { |
| 700 | exclude_srcs: [ |
| 701 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 702 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 703 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 704 | ], |
| 705 | }, |
| 706 | cortex_a8: { |
| 707 | exclude_srcs: [ |
| 708 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 709 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 710 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 711 | ], |
| 712 | }, |
| 713 | cortex_a9: { |
| 714 | exclude_srcs: [ |
| 715 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 716 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 717 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 718 | ], |
| 719 | }, |
| 720 | cortex_a15: { |
| 721 | exclude_srcs: [ |
| 722 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 723 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 724 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 725 | ], |
| 726 | }, |
| 727 | denver: { |
| 728 | exclude_srcs: [ |
| 729 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 730 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 731 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 732 | ], |
| 733 | }, |
| 734 | krait: { |
| 735 | exclude_srcs: [ |
| 736 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 737 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 738 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 739 | ], |
| 740 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 741 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 742 | arm64: { |
| 743 | exclude_srcs: [ |
| 744 | "upstream-openbsd/lib/libc/string/memchr.c", |
| 745 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 746 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 747 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 748 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 749 | ], |
| 750 | }, |
| 751 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 752 | x86: { |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 753 | exclude_srcs: [ |
| 754 | "upstream-openbsd/lib/libc/string/memchr.c", |
| 755 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 756 | "upstream-openbsd/lib/libc/string/memrchr.c", |
| 757 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 758 | "upstream-openbsd/lib/libc/string/stpncpy.c", |
| 759 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 760 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 761 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 762 | "upstream-openbsd/lib/libc/string/strncpy.c", |
| 763 | ], |
| 764 | ssse3: { |
| 765 | exclude_srcs: [ |
| 766 | "upstream-openbsd/lib/libc/string/strlcat.c", |
| 767 | "upstream-openbsd/lib/libc/string/strlcpy.c", |
| 768 | "upstream-openbsd/lib/libc/string/strncat.c", |
| 769 | ], |
| 770 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 771 | }, |
| 772 | |
| 773 | x86_64: { |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 774 | exclude_srcs: [ |
| 775 | "upstream-openbsd/lib/libc/string/memmove.c", |
| 776 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 777 | "upstream-openbsd/lib/libc/string/stpncpy.c", |
| 778 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 779 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 780 | "upstream-openbsd/lib/libc/string/strlcat.c", |
| 781 | "upstream-openbsd/lib/libc/string/strlcpy.c", |
| 782 | "upstream-openbsd/lib/libc/string/strncat.c", |
| 783 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 784 | "upstream-openbsd/lib/libc/string/strncpy.c", |
| 785 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 786 | }, |
| 787 | }, |
| 788 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 789 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 790 | "-Wno-sign-compare", |
| 791 | "-Wno-uninitialized", |
| 792 | "-Wno-unused-parameter", |
| 793 | "-include openbsd-compat.h", |
| 794 | ], |
| 795 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 796 | local_include_dirs: [ |
| 797 | "private", |
| 798 | "stdio", |
| 799 | "upstream-openbsd/android/include", |
| 800 | "upstream-openbsd/lib/libc/include", |
| 801 | "upstream-openbsd/lib/libc/gdtoa/", |
| 802 | ], |
| 803 | |
| 804 | name: "libc_openbsd", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 805 | } |
| 806 | |
| 807 | // ======================================================== |
| 808 | // libc_gdtoa.a - upstream OpenBSD C library gdtoa code |
| 809 | // ======================================================== |
| 810 | // |
| 811 | // These files are built with the openbsd-compat.h header file |
| 812 | // automatically included. |
| 813 | |
| 814 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 815 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 816 | srcs: [ |
| 817 | "upstream-openbsd/android/gdtoa_support.cpp", |
| 818 | "upstream-openbsd/lib/libc/gdtoa/dmisc.c", |
| 819 | "upstream-openbsd/lib/libc/gdtoa/dtoa.c", |
| 820 | "upstream-openbsd/lib/libc/gdtoa/gdtoa.c", |
| 821 | "upstream-openbsd/lib/libc/gdtoa/gethex.c", |
| 822 | "upstream-openbsd/lib/libc/gdtoa/gmisc.c", |
| 823 | "upstream-openbsd/lib/libc/gdtoa/hd_init.c", |
| 824 | "upstream-openbsd/lib/libc/gdtoa/hdtoa.c", |
| 825 | "upstream-openbsd/lib/libc/gdtoa/hexnan.c", |
| 826 | "upstream-openbsd/lib/libc/gdtoa/ldtoa.c", |
| 827 | "upstream-openbsd/lib/libc/gdtoa/misc.c", |
| 828 | "upstream-openbsd/lib/libc/gdtoa/smisc.c", |
| 829 | "upstream-openbsd/lib/libc/gdtoa/strtod.c", |
| 830 | "upstream-openbsd/lib/libc/gdtoa/strtodg.c", |
| 831 | "upstream-openbsd/lib/libc/gdtoa/strtof.c", |
| 832 | "upstream-openbsd/lib/libc/gdtoa/strtord.c", |
| 833 | "upstream-openbsd/lib/libc/gdtoa/sum.c", |
| 834 | "upstream-openbsd/lib/libc/gdtoa/ulp.c", |
| 835 | ], |
| 836 | multilib: { |
| 837 | lib64: { |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 838 | srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 839 | }, |
| 840 | }, |
| 841 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 842 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 843 | "-Wno-sign-compare", |
| 844 | "-Wno-uninitialized", |
| 845 | "-fvisibility=hidden", |
| 846 | "-include openbsd-compat.h", |
| 847 | ], |
| 848 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 849 | local_include_dirs: [ |
| 850 | "private", |
| 851 | "upstream-openbsd/android/include", |
| 852 | "upstream-openbsd/lib/libc/include", |
| 853 | ], |
| 854 | |
| 855 | name: "libc_gdtoa", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 856 | } |
| 857 | |
| 858 | // ======================================================== |
| 859 | // libc_bionic.a - home-grown C library code |
| 860 | // ======================================================== |
| 861 | |
| 862 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 863 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 864 | srcs: [ |
Yabin Cui | 9b687dc | 2015-11-30 14:07:58 -0800 | [diff] [blame] | 865 | // The following implementations depend on pthread data, so we can't |
| 866 | // include them in libc_ndk.a. |
| 867 | "bionic/__cxa_thread_atexit_impl.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 868 | "bionic/fork.cpp", |
| 869 | |
| 870 | // The data that backs getauxval is initialized in the libc init |
| 871 | // functions which are invoked by the linker. If this file is included |
| 872 | // in libc_ndk.a, only one of the copies of the global data will be |
| 873 | // initialized, resulting in nullptr dereferences. |
| 874 | "bionic/getauxval.cpp", |
| 875 | |
Dan Willemsen | 35e91a1 | 2015-09-17 15:28:45 -0700 | [diff] [blame] | 876 | // These four require getauxval, which isn't available on older |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 877 | // platforms. |
| 878 | "bionic/getentropy_linux.c", |
| 879 | "bionic/sysconf.cpp", |
| 880 | "bionic/vdso.cpp", |
Dan Willemsen | 35e91a1 | 2015-09-17 15:28:45 -0700 | [diff] [blame] | 881 | "bionic/setjmp_cookie.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 882 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 883 | "bionic/__memcpy_chk.cpp", |
| 884 | "bionic/__memset_chk.cpp", |
| 885 | "bionic/__strcat_chk.cpp", |
| 886 | "bionic/__strcpy_chk.cpp", |
| 887 | "bionic/strchr.cpp", |
| 888 | "bionic/strnlen.c", |
| 889 | "bionic/strrchr.cpp", |
| 890 | ], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 891 | cflags: ["-Wframe-larger-than=2048"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 892 | |
| 893 | arch: { |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 894 | arm: { |
| 895 | srcs: [ |
| 896 | "arch-arm/bionic/abort_arm.S", |
| 897 | "arch-arm/bionic/atomics_arm.c", |
| 898 | "arch-arm/bionic/__bionic_clone.S", |
| 899 | "arch-arm/bionic/_exit_with_stack_teardown.S", |
| 900 | "arch-arm/bionic/libgcc_compat.c", |
| 901 | "arch-arm/bionic/popcount_tab.c", |
| 902 | "arch-arm/bionic/__restore.S", |
| 903 | "arch-arm/bionic/setjmp.S", |
| 904 | "arch-arm/bionic/syscall.S", |
| 905 | "arch-arm/bionic/vfork.S", |
| 906 | |
| 907 | "arch-arm/generic/bionic/memcmp.S", |
| 908 | "arch-arm/generic/bionic/memcpy.S", |
| 909 | "arch-arm/generic/bionic/memset.S", |
| 910 | "arch-arm/generic/bionic/strcmp.S", |
| 911 | "arch-arm/generic/bionic/strcpy.S", |
| 912 | "arch-arm/generic/bionic/strlen.c", |
| 913 | ], |
| 914 | exclude_srcs: [ |
| 915 | "bionic/__memcpy_chk.cpp", |
| 916 | "bionic/__memset_chk.cpp", |
| 917 | ], |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 918 | cortex_a7: { |
| 919 | srcs: [ |
| 920 | "arch-arm/cortex-a7/bionic/memset.S", |
| 921 | |
| 922 | "arch-arm/cortex-a15/bionic/memcpy.S", |
| 923 | "arch-arm/cortex-a15/bionic/stpcpy.S", |
| 924 | "arch-arm/cortex-a15/bionic/strcat.S", |
| 925 | "arch-arm/cortex-a15/bionic/__strcat_chk.S", |
| 926 | "arch-arm/cortex-a15/bionic/strcmp.S", |
| 927 | "arch-arm/cortex-a15/bionic/strcpy.S", |
| 928 | "arch-arm/cortex-a15/bionic/__strcpy_chk.S", |
| 929 | "arch-arm/cortex-a15/bionic/strlen.S", |
| 930 | |
| 931 | "arch-arm/denver/bionic/memmove.S", |
| 932 | ], |
| 933 | exclude_srcs: [ |
| 934 | "arch-arm/generic/bionic/memcpy.S", |
| 935 | "arch-arm/generic/bionic/memset.S", |
| 936 | "arch-arm/generic/bionic/strcmp.S", |
| 937 | "arch-arm/generic/bionic/strcpy.S", |
| 938 | "arch-arm/generic/bionic/strlen.c", |
| 939 | "bionic/__strcat_chk.cpp", |
| 940 | "bionic/__strcpy_chk.cpp", |
| 941 | ], |
| 942 | }, |
| 943 | cortex_a53: { |
| 944 | srcs: [ |
| 945 | "arch-arm/cortex-a53/bionic/memcpy.S", |
| 946 | "arch-arm/cortex-a53/bionic/__strcat_chk.S", |
| 947 | "arch-arm/cortex-a53/bionic/__strcpy_chk.S", |
| 948 | |
| 949 | "arch-arm/cortex-a7/bionic/memset.S", |
| 950 | |
| 951 | "arch-arm/cortex-a15/bionic/stpcpy.S", |
| 952 | "arch-arm/cortex-a15/bionic/strcat.S", |
| 953 | "arch-arm/cortex-a15/bionic/strcmp.S", |
| 954 | "arch-arm/cortex-a15/bionic/strcpy.S", |
| 955 | "arch-arm/cortex-a15/bionic/strlen.S", |
| 956 | |
| 957 | "arch-arm/denver/bionic/memmove.S", |
| 958 | ], |
| 959 | exclude_srcs: [ |
| 960 | "arch-arm/generic/bionic/memcpy.S", |
| 961 | "arch-arm/generic/bionic/memset.S", |
| 962 | "arch-arm/generic/bionic/strcmp.S", |
| 963 | "arch-arm/generic/bionic/strcpy.S", |
| 964 | "arch-arm/generic/bionic/strlen.c", |
| 965 | "bionic/__strcat_chk.cpp", |
| 966 | "bionic/__strcpy_chk.cpp", |
| 967 | ], |
| 968 | }, |
| 969 | cortex_a53_a57: { |
| 970 | srcs: [ |
| 971 | "arch-arm/cortex-a15/bionic/memcpy.S", |
| 972 | "arch-arm/cortex-a15/bionic/memset.S", |
| 973 | "arch-arm/cortex-a15/bionic/stpcpy.S", |
| 974 | "arch-arm/cortex-a15/bionic/strcat.S", |
| 975 | "arch-arm/cortex-a15/bionic/__strcat_chk.S", |
| 976 | "arch-arm/cortex-a15/bionic/strcmp.S", |
| 977 | "arch-arm/cortex-a15/bionic/strcpy.S", |
| 978 | "arch-arm/cortex-a15/bionic/__strcpy_chk.S", |
| 979 | "arch-arm/cortex-a15/bionic/strlen.S", |
| 980 | |
| 981 | "arch-arm/denver/bionic/memmove.S", |
| 982 | ], |
| 983 | exclude_srcs: [ |
| 984 | "arch-arm/generic/bionic/memcpy.S", |
| 985 | "arch-arm/generic/bionic/memset.S", |
| 986 | "arch-arm/generic/bionic/strcmp.S", |
| 987 | "arch-arm/generic/bionic/strcpy.S", |
| 988 | "arch-arm/generic/bionic/strlen.c", |
| 989 | "bionic/__strcat_chk.cpp", |
| 990 | "bionic/__strcpy_chk.cpp", |
| 991 | ], |
| 992 | }, |
| 993 | cortex_a8: { |
| 994 | srcs: [ |
| 995 | "arch-arm/cortex-a15/bionic/memcpy.S", |
| 996 | "arch-arm/cortex-a15/bionic/memset.S", |
| 997 | "arch-arm/cortex-a15/bionic/stpcpy.S", |
| 998 | "arch-arm/cortex-a15/bionic/strcat.S", |
| 999 | "arch-arm/cortex-a15/bionic/__strcat_chk.S", |
| 1000 | "arch-arm/cortex-a15/bionic/strcmp.S", |
| 1001 | "arch-arm/cortex-a15/bionic/strcpy.S", |
| 1002 | "arch-arm/cortex-a15/bionic/__strcpy_chk.S", |
| 1003 | "arch-arm/cortex-a15/bionic/strlen.S", |
| 1004 | |
| 1005 | "arch-arm/denver/bionic/memmove.S", |
| 1006 | ], |
| 1007 | exclude_srcs: [ |
| 1008 | "arch-arm/generic/bionic/memcpy.S", |
| 1009 | "arch-arm/generic/bionic/memset.S", |
| 1010 | "arch-arm/generic/bionic/strcmp.S", |
| 1011 | "arch-arm/generic/bionic/strcpy.S", |
| 1012 | "arch-arm/generic/bionic/strlen.c", |
| 1013 | "bionic/__strcat_chk.cpp", |
| 1014 | "bionic/__strcpy_chk.cpp", |
| 1015 | ], |
| 1016 | }, |
| 1017 | cortex_a9: { |
| 1018 | srcs: [ |
| 1019 | "arch-arm/cortex-a9/bionic/memcpy.S", |
| 1020 | "arch-arm/cortex-a9/bionic/memset.S", |
| 1021 | "arch-arm/cortex-a9/bionic/stpcpy.S", |
| 1022 | "arch-arm/cortex-a9/bionic/strcat.S", |
| 1023 | "arch-arm/cortex-a9/bionic/__strcat_chk.S", |
| 1024 | "arch-arm/cortex-a9/bionic/strcmp.S", |
| 1025 | "arch-arm/cortex-a9/bionic/strcpy.S", |
| 1026 | "arch-arm/cortex-a9/bionic/__strcpy_chk.S", |
| 1027 | "arch-arm/cortex-a9/bionic/strlen.S", |
| 1028 | |
| 1029 | "arch-arm/denver/bionic/memmove.S", |
| 1030 | ], |
| 1031 | exclude_srcs: [ |
| 1032 | "arch-arm/generic/bionic/memcpy.S", |
| 1033 | "arch-arm/generic/bionic/memset.S", |
| 1034 | "arch-arm/generic/bionic/strcmp.S", |
| 1035 | "arch-arm/generic/bionic/strcpy.S", |
| 1036 | "arch-arm/generic/bionic/strlen.c", |
| 1037 | "bionic/__strcat_chk.cpp", |
| 1038 | "bionic/__strcpy_chk.cpp", |
| 1039 | ], |
| 1040 | }, |
| 1041 | cortex_a15: { |
| 1042 | srcs: [ |
| 1043 | "arch-arm/cortex-a15/bionic/memcpy.S", |
| 1044 | "arch-arm/cortex-a15/bionic/memset.S", |
| 1045 | "arch-arm/cortex-a15/bionic/stpcpy.S", |
| 1046 | "arch-arm/cortex-a15/bionic/strcat.S", |
| 1047 | "arch-arm/cortex-a15/bionic/__strcat_chk.S", |
| 1048 | "arch-arm/cortex-a15/bionic/strcmp.S", |
| 1049 | "arch-arm/cortex-a15/bionic/strcpy.S", |
| 1050 | "arch-arm/cortex-a15/bionic/__strcpy_chk.S", |
| 1051 | "arch-arm/cortex-a15/bionic/strlen.S", |
| 1052 | |
| 1053 | "arch-arm/denver/bionic/memmove.S", |
| 1054 | ], |
| 1055 | exclude_srcs: [ |
| 1056 | "arch-arm/generic/bionic/memcpy.S", |
| 1057 | "arch-arm/generic/bionic/memset.S", |
| 1058 | "arch-arm/generic/bionic/strcmp.S", |
| 1059 | "arch-arm/generic/bionic/strcpy.S", |
| 1060 | "arch-arm/generic/bionic/strlen.c", |
| 1061 | "bionic/__strcat_chk.cpp", |
| 1062 | "bionic/__strcpy_chk.cpp", |
| 1063 | ], |
| 1064 | }, |
| 1065 | denver: { |
| 1066 | srcs: [ |
| 1067 | "arch-arm/denver/bionic/memcpy.S", |
| 1068 | "arch-arm/denver/bionic/memmove.S", |
| 1069 | "arch-arm/denver/bionic/memset.S", |
| 1070 | "arch-arm/denver/bionic/__strcat_chk.S", |
| 1071 | "arch-arm/denver/bionic/__strcpy_chk.S", |
| 1072 | |
| 1073 | // Use cortex-a15 versions of strcat/strcpy/strlen. |
| 1074 | "arch-arm/cortex-a15/bionic/stpcpy.S", |
| 1075 | "arch-arm/cortex-a15/bionic/strcat.S", |
| 1076 | "arch-arm/cortex-a15/bionic/strcmp.S", |
| 1077 | "arch-arm/cortex-a15/bionic/strcpy.S", |
| 1078 | "arch-arm/cortex-a15/bionic/strlen.S", |
| 1079 | ], |
| 1080 | exclude_srcs: [ |
| 1081 | "arch-arm/generic/bionic/memcpy.S", |
| 1082 | "arch-arm/generic/bionic/memset.S", |
| 1083 | "arch-arm/generic/bionic/strcmp.S", |
| 1084 | "arch-arm/generic/bionic/strcpy.S", |
| 1085 | "arch-arm/generic/bionic/strlen.c", |
| 1086 | "bionic/__strcat_chk.cpp", |
| 1087 | "bionic/__strcpy_chk.cpp", |
| 1088 | ], |
| 1089 | }, |
| 1090 | krait: { |
| 1091 | srcs: [ |
| 1092 | "arch-arm/krait/bionic/memcpy.S", |
| 1093 | "arch-arm/krait/bionic/memset.S", |
| 1094 | "arch-arm/krait/bionic/strcmp.S", |
| 1095 | "arch-arm/krait/bionic/__strcat_chk.S", |
| 1096 | "arch-arm/krait/bionic/__strcpy_chk.S", |
| 1097 | |
| 1098 | // Use cortex-a15 versions of strcat/strcpy/strlen. |
| 1099 | "arch-arm/cortex-a15/bionic/stpcpy.S", |
| 1100 | "arch-arm/cortex-a15/bionic/strcat.S", |
| 1101 | "arch-arm/cortex-a15/bionic/strcpy.S", |
| 1102 | "arch-arm/cortex-a15/bionic/strlen.S", |
| 1103 | |
| 1104 | "arch-arm/denver/bionic/memmove.S", |
| 1105 | ], |
| 1106 | exclude_srcs: [ |
| 1107 | "arch-arm/generic/bionic/memcpy.S", |
| 1108 | "arch-arm/generic/bionic/memset.S", |
| 1109 | "arch-arm/generic/bionic/strcmp.S", |
| 1110 | "arch-arm/generic/bionic/strcpy.S", |
| 1111 | "arch-arm/generic/bionic/strlen.c", |
| 1112 | "bionic/__strcat_chk.cpp", |
| 1113 | "bionic/__strcpy_chk.cpp", |
| 1114 | ], |
| 1115 | }, |
| 1116 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1117 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1118 | arm64: { |
| 1119 | srcs: [ |
| 1120 | "arch-arm64/bionic/__bionic_clone.S", |
| 1121 | "arch-arm64/bionic/_exit_with_stack_teardown.S", |
| 1122 | "arch-arm64/bionic/setjmp.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1123 | "arch-arm64/bionic/syscall.S", |
| 1124 | "arch-arm64/bionic/vfork.S", |
| 1125 | |
| 1126 | "arch-arm64/generic/bionic/memchr.S", |
| 1127 | "arch-arm64/generic/bionic/memcmp.S", |
| 1128 | "arch-arm64/generic/bionic/memcpy.S", |
| 1129 | "arch-arm64/generic/bionic/memmove.S", |
| 1130 | "arch-arm64/generic/bionic/memset.S", |
| 1131 | "arch-arm64/generic/bionic/stpcpy.S", |
| 1132 | "arch-arm64/generic/bionic/strchr.S", |
| 1133 | "arch-arm64/generic/bionic/strcmp.S", |
| 1134 | "arch-arm64/generic/bionic/strcpy.S", |
| 1135 | "arch-arm64/generic/bionic/strlen.S", |
| 1136 | "arch-arm64/generic/bionic/strncmp.S", |
| 1137 | "arch-arm64/generic/bionic/strnlen.S", |
| 1138 | "arch-arm64/generic/bionic/wmemmove.S", |
| 1139 | ], |
| 1140 | exclude_srcs: [ |
| 1141 | "bionic/__memcpy_chk.cpp", |
| 1142 | "bionic/strchr.cpp", |
| 1143 | "bionic/strnlen.c", |
| 1144 | ], |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 1145 | denver64: { |
| 1146 | srcs: [ |
| 1147 | "arch-arm64/denver64/bionic/memcpy.S", |
| 1148 | "arch-arm64/denver64/bionic/memset.S", |
| 1149 | ], |
| 1150 | exclude_srcs: [ |
| 1151 | "arch-arm64/generic/bionic/memcpy.S", |
| 1152 | "arch-arm64/generic/bionic/memset.S", |
| 1153 | ], |
| 1154 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1155 | }, |
| 1156 | |
| 1157 | mips: { |
| 1158 | srcs: [ |
| 1159 | "arch-mips/bionic/__bionic_clone.S", |
| 1160 | "arch-mips/bionic/bzero.S", |
| 1161 | "arch-mips/bionic/cacheflush.cpp", |
| 1162 | "arch-mips/bionic/_exit_with_stack_teardown.S", |
| 1163 | "arch-mips/bionic/setjmp.S", |
| 1164 | "arch-mips/bionic/syscall.S", |
| 1165 | "arch-mips/bionic/vfork.S", |
| 1166 | |
| 1167 | "arch-mips/string/memcmp.c", |
| 1168 | "arch-mips/string/memcpy.S", |
| 1169 | "arch-mips/string/memset.S", |
| 1170 | "arch-mips/string/strcmp.S", |
| 1171 | "arch-mips/string/strlen.c", |
| 1172 | ], |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 1173 | rev6: { |
| 1174 | srcs: [ |
| 1175 | "arch-mips/string/mips_strlen.c", |
| 1176 | ], |
| 1177 | exclude_srcs: [ |
| 1178 | "arch-mips/string/strlen.c", |
| 1179 | ], |
| 1180 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1181 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1182 | mips64: { |
| 1183 | srcs: [ |
| 1184 | "arch-mips64/bionic/__bionic_clone.S", |
| 1185 | "arch-mips64/bionic/_exit_with_stack_teardown.S", |
| 1186 | "arch-mips64/bionic/setjmp.S", |
| 1187 | "arch-mips64/bionic/syscall.S", |
| 1188 | "arch-mips64/bionic/vfork.S", |
| 1189 | "arch-mips64/bionic/stat.cpp", |
| 1190 | |
| 1191 | "arch-mips/string/memcmp.c", |
| 1192 | "arch-mips/string/memcpy.S", |
| 1193 | "arch-mips/string/memset.S", |
| 1194 | "arch-mips/string/strcmp.S", |
| 1195 | "arch-mips/string/strlen.c", |
| 1196 | ], |
| 1197 | }, |
| 1198 | |
| 1199 | x86: { |
| 1200 | srcs: [ |
| 1201 | "arch-x86/bionic/__bionic_clone.S", |
| 1202 | "arch-x86/bionic/_exit_with_stack_teardown.S", |
| 1203 | "arch-x86/bionic/libgcc_compat.c", |
| 1204 | "arch-x86/bionic/__restore.S", |
| 1205 | "arch-x86/bionic/setjmp.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1206 | "arch-x86/bionic/syscall.S", |
| 1207 | "arch-x86/bionic/vfork.S", |
| 1208 | |
| 1209 | "arch-x86/generic/string/memcmp.S", |
| 1210 | "arch-x86/generic/string/strcmp.S", |
| 1211 | "arch-x86/generic/string/strncmp.S", |
| 1212 | "arch-x86/generic/string/strcat.S", |
| 1213 | "arch-x86/atom/string/sse2-memchr-atom.S", |
| 1214 | "arch-x86/atom/string/sse2-memrchr-atom.S", |
| 1215 | "arch-x86/atom/string/sse2-strchr-atom.S", |
| 1216 | "arch-x86/atom/string/sse2-strnlen-atom.S", |
| 1217 | "arch-x86/atom/string/sse2-strrchr-atom.S", |
| 1218 | "arch-x86/atom/string/sse2-wcschr-atom.S", |
| 1219 | "arch-x86/atom/string/sse2-wcsrchr-atom.S", |
| 1220 | "arch-x86/atom/string/sse2-wcslen-atom.S", |
| 1221 | "arch-x86/atom/string/sse2-wcscmp-atom.S", |
| 1222 | "arch-x86/silvermont/string/sse2-bcopy-slm.S", |
| 1223 | "arch-x86/silvermont/string/sse2-bzero-slm.S", |
| 1224 | "arch-x86/silvermont/string/sse2-memcpy-slm.S", |
| 1225 | "arch-x86/silvermont/string/sse2-memmove-slm.S", |
| 1226 | "arch-x86/silvermont/string/sse2-memset-slm.S", |
| 1227 | "arch-x86/silvermont/string/sse2-stpcpy-slm.S", |
| 1228 | "arch-x86/silvermont/string/sse2-stpncpy-slm.S", |
| 1229 | "arch-x86/silvermont/string/sse2-strcpy-slm.S", |
| 1230 | "arch-x86/silvermont/string/sse2-strlen-slm.S", |
| 1231 | "arch-x86/silvermont/string/sse2-strncpy-slm.S", |
| 1232 | ], |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1233 | |
| 1234 | exclude_srcs: [ |
| 1235 | "bionic/strchr.cpp", |
| 1236 | "bionic/strnlen.c", |
| 1237 | "bionic/strrchr.cpp", |
| 1238 | ], |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 1239 | atom: { |
| 1240 | srcs: [ |
| 1241 | "arch-x86/atom/string/sse2-bzero-atom.S", |
| 1242 | "arch-x86/atom/string/sse2-memset-atom.S", |
| 1243 | "arch-x86/atom/string/sse2-strlen-atom.S", |
| 1244 | "arch-x86/atom/string/ssse3-bcopy-atom.S", |
| 1245 | "arch-x86/atom/string/ssse3-memcmp-atom.S", |
Dan Willemsen | 701b545 | 2016-01-12 19:35:40 -0800 | [diff] [blame] | 1246 | "arch-x86/atom/string/ssse3-memcpy-atom.S", |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 1247 | "arch-x86/atom/string/ssse3-memmove-atom.S", |
Dan Willemsen | 701b545 | 2016-01-12 19:35:40 -0800 | [diff] [blame] | 1248 | "arch-x86/atom/string/ssse3-strcpy-atom.S", |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 1249 | "arch-x86/atom/string/ssse3-strncpy-atom.S", |
| 1250 | "arch-x86/atom/string/ssse3-wmemcmp-atom.S", |
| 1251 | ], |
| 1252 | exclude_srcs: [ |
| 1253 | "arch-x86/generic/string/memcmp.S", |
| 1254 | "arch-x86/silvermont/string/sse2-bcopy-slm.S", |
| 1255 | "arch-x86/silvermont/string/sse2-bzero-slm.S", |
| 1256 | "arch-x86/silvermont/string/sse2-memcpy-slm.S", |
| 1257 | "arch-x86/silvermont/string/sse2-memmove-slm.S", |
| 1258 | "arch-x86/silvermont/string/sse2-memset-slm.S", |
| 1259 | "arch-x86/silvermont/string/sse2-strcpy-slm.S", |
| 1260 | "arch-x86/silvermont/string/sse2-strlen-slm.S", |
| 1261 | "arch-x86/silvermont/string/sse2-strncpy-slm.S", |
| 1262 | ], |
| 1263 | }, |
| 1264 | ssse3: { |
| 1265 | srcs: [ |
| 1266 | "arch-x86/atom/string/ssse3-strncat-atom.S", |
| 1267 | "arch-x86/atom/string/ssse3-strlcat-atom.S", |
| 1268 | "arch-x86/atom/string/ssse3-strlcpy-atom.S", |
| 1269 | "arch-x86/atom/string/ssse3-strcat-atom.S", |
| 1270 | "arch-x86/atom/string/ssse3-strcmp-atom.S", |
| 1271 | "arch-x86/atom/string/ssse3-strncmp-atom.S", |
| 1272 | "arch-x86/atom/string/ssse3-wcscat-atom.S", |
| 1273 | "arch-x86/atom/string/ssse3-wcscpy-atom.S", |
| 1274 | ], |
| 1275 | exclude_srcs: [ |
| 1276 | "arch-x86/generic/string/strcmp.S", |
| 1277 | "arch-x86/generic/string/strncmp.S", |
| 1278 | "arch-x86/generic/string/strcat.S", |
| 1279 | ], |
| 1280 | }, |
| 1281 | sse4: { |
| 1282 | srcs: [ |
| 1283 | "arch-x86/silvermont/string/sse4-memcmp-slm.S", |
| 1284 | "arch-x86/silvermont/string/sse4-wmemcmp-slm.S", |
| 1285 | ], |
| 1286 | exclude_srcs: [ |
| 1287 | "arch-x86/generic/string/memcmp.S", |
| 1288 | ], |
| 1289 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1290 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1291 | x86_64: { |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1292 | srcs: [ |
| 1293 | "arch-x86_64/bionic/__bionic_clone.S", |
| 1294 | "arch-x86_64/bionic/_exit_with_stack_teardown.S", |
| 1295 | "arch-x86_64/bionic/__restore_rt.S", |
| 1296 | "arch-x86_64/bionic/setjmp.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1297 | "arch-x86_64/bionic/syscall.S", |
| 1298 | "arch-x86_64/bionic/vfork.S", |
| 1299 | |
| 1300 | "arch-x86_64/string/sse2-memcpy-slm.S", |
| 1301 | "arch-x86_64/string/sse2-memmove-slm.S", |
| 1302 | "arch-x86_64/string/sse2-memset-slm.S", |
| 1303 | "arch-x86_64/string/sse2-stpcpy-slm.S", |
| 1304 | "arch-x86_64/string/sse2-stpncpy-slm.S", |
| 1305 | "arch-x86_64/string/sse2-strcat-slm.S", |
| 1306 | "arch-x86_64/string/sse2-strcpy-slm.S", |
| 1307 | "arch-x86_64/string/sse2-strlcat-slm.S", |
| 1308 | "arch-x86_64/string/sse2-strlcpy-slm.S", |
| 1309 | "arch-x86_64/string/sse2-strlen-slm.S", |
| 1310 | "arch-x86_64/string/sse2-strncat-slm.S", |
| 1311 | "arch-x86_64/string/sse2-strncpy-slm.S", |
| 1312 | "arch-x86_64/string/sse4-memcmp-slm.S", |
| 1313 | "arch-x86_64/string/ssse3-strcmp-slm.S", |
| 1314 | "arch-x86_64/string/ssse3-strncmp-slm.S", |
| 1315 | ], |
| 1316 | }, |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1317 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1318 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1319 | cppflags: ["-Wold-style-cast"], |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1320 | include_dirs: ["bionic/libstdc++/include"], |
| 1321 | name: "libc_bionic", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1322 | } |
| 1323 | |
| 1324 | // ======================================================== |
| 1325 | // libc_bionic_ndk.a- The portions of libc_bionic that can |
| 1326 | // be safely used in libc_ndk.a (no troublesome global data |
| 1327 | // or constructors). |
| 1328 | // ======================================================== |
| 1329 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1330 | defaults: ["libc_defaults"], |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1331 | srcs: [ |
| 1332 | "bionic/abort.cpp", |
| 1333 | "bionic/accept.cpp", |
| 1334 | "bionic/accept4.cpp", |
| 1335 | "bionic/access.cpp", |
| 1336 | "bionic/arpa_inet.cpp", |
| 1337 | "bionic/assert.cpp", |
| 1338 | "bionic/atof.cpp", |
| 1339 | "bionic/bionic_systrace.cpp", |
| 1340 | "bionic/bionic_time_conversions.cpp", |
| 1341 | "bionic/brk.cpp", |
| 1342 | "bionic/c16rtomb.cpp", |
| 1343 | "bionic/c32rtomb.cpp", |
| 1344 | "bionic/chmod.cpp", |
| 1345 | "bionic/chown.cpp", |
| 1346 | "bionic/clearenv.cpp", |
| 1347 | "bionic/clock.cpp", |
| 1348 | "bionic/clock_getcpuclockid.cpp", |
| 1349 | "bionic/clock_nanosleep.cpp", |
| 1350 | "bionic/clone.cpp", |
| 1351 | "bionic/close.cpp", |
| 1352 | "bionic/__cmsg_nxthdr.cpp", |
| 1353 | "bionic/connect.cpp", |
| 1354 | "bionic/ctype.cpp", |
| 1355 | "bionic/dirent.cpp", |
| 1356 | "bionic/dup2.cpp", |
| 1357 | "bionic/epoll_create.cpp", |
| 1358 | "bionic/epoll_pwait.cpp", |
| 1359 | "bionic/epoll_wait.cpp", |
| 1360 | "bionic/__errno.cpp", |
| 1361 | "bionic/error.cpp", |
| 1362 | "bionic/eventfd_read.cpp", |
| 1363 | "bionic/eventfd_write.cpp", |
| 1364 | "bionic/faccessat.cpp", |
| 1365 | "bionic/fchmod.cpp", |
| 1366 | "bionic/fchmodat.cpp", |
| 1367 | "bionic/ffs.cpp", |
| 1368 | "bionic/fgetxattr.cpp", |
| 1369 | "bionic/flistxattr.cpp", |
| 1370 | "bionic/flockfile.cpp", |
| 1371 | "bionic/fpclassify.cpp", |
| 1372 | "bionic/fsetxattr.cpp", |
| 1373 | "bionic/ftruncate.cpp", |
| 1374 | "bionic/futimens.cpp", |
| 1375 | "bionic/getcwd.cpp", |
| 1376 | "bionic/gethostname.cpp", |
| 1377 | "bionic/getpgrp.cpp", |
| 1378 | "bionic/getpid.cpp", |
| 1379 | "bionic/gettid.cpp", |
| 1380 | "bionic/__gnu_basename.cpp", |
Dan Willemsen | 9b59acc | 2016-01-05 14:32:06 -0800 | [diff] [blame] | 1381 | "bionic/ifaddrs.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1382 | "bionic/inotify_init.cpp", |
Dan Willemsen | dc6b0a7 | 2015-11-09 14:03:46 -0800 | [diff] [blame] | 1383 | "bionic/ioctl.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1384 | "bionic/lchown.cpp", |
| 1385 | "bionic/lfs64_support.cpp", |
| 1386 | "bionic/__libc_current_sigrtmax.cpp", |
| 1387 | "bionic/__libc_current_sigrtmin.cpp", |
| 1388 | "bionic/libc_init_common.cpp", |
| 1389 | "bionic/libc_logging.cpp", |
| 1390 | "bionic/libgen.cpp", |
| 1391 | "bionic/link.cpp", |
| 1392 | "bionic/locale.cpp", |
| 1393 | "bionic/lstat.cpp", |
| 1394 | "bionic/malloc_info.cpp", |
| 1395 | "bionic/mbrtoc16.cpp", |
| 1396 | "bionic/mbrtoc32.cpp", |
| 1397 | "bionic/mbstate.cpp", |
| 1398 | "bionic/mempcpy.cpp", |
| 1399 | "bionic/mkdir.cpp", |
| 1400 | "bionic/mkfifo.cpp", |
| 1401 | "bionic/mknod.cpp", |
| 1402 | "bionic/mntent.cpp", |
Dan Willemsen | dc6b0a7 | 2015-11-09 14:03:46 -0800 | [diff] [blame] | 1403 | "bionic/mremap.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1404 | "bionic/NetdClientDispatch.cpp", |
| 1405 | "bionic/open.cpp", |
| 1406 | "bionic/pathconf.cpp", |
| 1407 | "bionic/pause.cpp", |
| 1408 | "bionic/pipe.cpp", |
| 1409 | "bionic/poll.cpp", |
| 1410 | "bionic/posix_fadvise.cpp", |
| 1411 | "bionic/posix_fallocate.cpp", |
| 1412 | "bionic/posix_madvise.cpp", |
| 1413 | "bionic/posix_timers.cpp", |
| 1414 | "bionic/ptrace.cpp", |
| 1415 | "bionic/pty.cpp", |
| 1416 | "bionic/raise.cpp", |
| 1417 | "bionic/rand.cpp", |
| 1418 | "bionic/readlink.cpp", |
| 1419 | "bionic/reboot.cpp", |
| 1420 | "bionic/recv.cpp", |
| 1421 | "bionic/rename.cpp", |
| 1422 | "bionic/rmdir.cpp", |
| 1423 | "bionic/scandir.cpp", |
| 1424 | "bionic/sched_getaffinity.cpp", |
| 1425 | "bionic/sched_getcpu.cpp", |
| 1426 | "bionic/semaphore.cpp", |
| 1427 | "bionic/send.cpp", |
| 1428 | "bionic/setegid.cpp", |
| 1429 | "bionic/__set_errno.cpp", |
| 1430 | "bionic/seteuid.cpp", |
| 1431 | "bionic/setpgrp.cpp", |
| 1432 | "bionic/sigaction.cpp", |
| 1433 | "bionic/sigaddset.cpp", |
| 1434 | "bionic/sigdelset.cpp", |
| 1435 | "bionic/sigemptyset.cpp", |
| 1436 | "bionic/sigfillset.cpp", |
| 1437 | "bionic/sigismember.cpp", |
| 1438 | "bionic/signal.cpp", |
| 1439 | "bionic/signalfd.cpp", |
| 1440 | "bionic/sigpending.cpp", |
| 1441 | "bionic/sigprocmask.cpp", |
| 1442 | "bionic/sigqueue.cpp", |
| 1443 | "bionic/sigsuspend.cpp", |
| 1444 | "bionic/sigtimedwait.cpp", |
| 1445 | "bionic/sigwait.cpp", |
| 1446 | "bionic/sigwaitinfo.cpp", |
| 1447 | "bionic/socket.cpp", |
| 1448 | "bionic/stat.cpp", |
| 1449 | "bionic/statvfs.cpp", |
| 1450 | "bionic/strchrnul.cpp", |
| 1451 | "bionic/strerror.cpp", |
| 1452 | "bionic/strerror_r.cpp", |
| 1453 | "bionic/strsignal.cpp", |
| 1454 | "bionic/strtold.cpp", |
| 1455 | "bionic/stubs.cpp", |
| 1456 | "bionic/symlink.cpp", |
| 1457 | "bionic/sysinfo.cpp", |
| 1458 | "bionic/syslog.cpp", |
| 1459 | "bionic/sys_siglist.c", |
| 1460 | "bionic/sys_signame.c", |
| 1461 | "bionic/system_properties.cpp", |
| 1462 | "bionic/tdestroy.cpp", |
| 1463 | "bionic/termios.cpp", |
| 1464 | "bionic/thread_private.cpp", |
| 1465 | "bionic/tmpfile.cpp", |
| 1466 | "bionic/umount.cpp", |
| 1467 | "bionic/unlink.cpp", |
| 1468 | "bionic/utimes.cpp", |
| 1469 | "bionic/wait.cpp", |
| 1470 | "bionic/wchar.cpp", |
| 1471 | "bionic/wctype.cpp", |
| 1472 | "bionic/wmempcpy.cpp", |
| 1473 | ], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1474 | cflags: ["-Wframe-larger-than=2048"], |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1475 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1476 | multilib: { |
| 1477 | lib32: { |
| 1478 | // LP32 cruft |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 1479 | srcs: ["bionic/mmap.cpp"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1480 | }, |
| 1481 | }, |
| 1482 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1483 | cppflags: ["-Wold-style-cast"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1484 | local_include_dirs: ["stdio"], |
| 1485 | include_dirs: ["bionic/libstdc++/include"], |
| 1486 | name: "libc_bionic_ndk", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1487 | } |
| 1488 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1489 | // ======================================================== |
| 1490 | // libc_pthread.a - pthreads parts that previously lived in |
| 1491 | // libc_bionic.a. Relocated to their own library because |
| 1492 | // they can't be included in libc_ndk.a (as they layout of |
| 1493 | // pthread_t has changed over the years and has ABI |
| 1494 | // compatibility issues). |
| 1495 | // ======================================================== |
| 1496 | |
| 1497 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1498 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1499 | srcs: [ |
| 1500 | "bionic/pthread_atfork.cpp", |
| 1501 | "bionic/pthread_attr.cpp", |
Colin Cross | a35d23d | 2015-11-19 13:32:49 -0800 | [diff] [blame] | 1502 | "bionic/pthread_barrier.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1503 | "bionic/pthread_cond.cpp", |
| 1504 | "bionic/pthread_create.cpp", |
| 1505 | "bionic/pthread_detach.cpp", |
| 1506 | "bionic/pthread_equal.cpp", |
| 1507 | "bionic/pthread_exit.cpp", |
| 1508 | "bionic/pthread_getcpuclockid.cpp", |
| 1509 | "bionic/pthread_getschedparam.cpp", |
| 1510 | "bionic/pthread_gettid_np.cpp", |
| 1511 | "bionic/pthread_internal.cpp", |
| 1512 | "bionic/pthread_join.cpp", |
| 1513 | "bionic/pthread_key.cpp", |
| 1514 | "bionic/pthread_kill.cpp", |
| 1515 | "bionic/pthread_mutex.cpp", |
| 1516 | "bionic/pthread_once.cpp", |
| 1517 | "bionic/pthread_rwlock.cpp", |
| 1518 | "bionic/pthread_self.cpp", |
| 1519 | "bionic/pthread_setname_np.cpp", |
| 1520 | "bionic/pthread_setschedparam.cpp", |
| 1521 | "bionic/pthread_sigmask.cpp", |
Colin Cross | a35d23d | 2015-11-19 13:32:49 -0800 | [diff] [blame] | 1522 | "bionic/pthread_spinlock.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1523 | ], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1524 | cflags: ["-Wframe-larger-than=2048"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1525 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1526 | cppflags: ["-Wold-style-cast"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1527 | include_dirs: ["bionic/libstdc++/include"], |
| 1528 | name: "libc_pthread", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1529 | } |
| 1530 | |
| 1531 | // ======================================================== |
| 1532 | // libc_cxa.a - Things traditionally in libstdc++ |
| 1533 | // ======================================================== |
| 1534 | |
| 1535 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1536 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1537 | srcs: [ |
| 1538 | "bionic/__cxa_guard.cpp", |
| 1539 | "bionic/__cxa_pure_virtual.cpp", |
| 1540 | "bionic/new.cpp", |
| 1541 | ], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1542 | cflags: ["-fvisibility=hidden"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1543 | include_dirs: ["bionic/libstdc++/include"], |
| 1544 | name: "libc_cxa", |
| 1545 | clang: true, // GCC refuses to hide new/delete |
| 1546 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1547 | // b/17574078: Need to disable coverage until we have a prebuilt libprofile_rt. |
| 1548 | // Since this is a static library built with clang, it needs to link |
| 1549 | // libprofile_rt when it is linked into the final binary. Since the final binary |
| 1550 | // is built with GCC, it won't link libprofile_rt. We can't very easily just add |
| 1551 | // libprofile_rt to all link lines the way we've done for libgcov because |
| 1552 | // libprofile_rt isn't prebuilt, and it would be tricky to write a rule that |
| 1553 | // would make sure libprofile_rt is built. |
| 1554 | native_coverage: false, |
| 1555 | } |
| 1556 | |
| 1557 | // ======================================================== |
| 1558 | // libc_syscalls.a |
| 1559 | // ======================================================== |
| 1560 | |
| 1561 | cc_library_static { |
| 1562 | arch: { |
| 1563 | arm: { |
| 1564 | srcs: ["arch-arm/syscalls/**/*.S"], |
| 1565 | }, |
| 1566 | arm64: { |
| 1567 | srcs: ["arch-arm64/syscalls/**/*.S"], |
| 1568 | }, |
| 1569 | mips: { |
| 1570 | srcs: ["arch-mips/syscalls/**/*.S"], |
| 1571 | }, |
| 1572 | mips64: { |
| 1573 | srcs: ["arch-mips64/syscalls/**/*.S"], |
| 1574 | }, |
| 1575 | x86: { |
| 1576 | srcs: ["arch-x86/syscalls/**/*.S"], |
| 1577 | }, |
| 1578 | x86_64: { |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1579 | srcs: ["arch-x86_64/syscalls/**/*.S"], |
| 1580 | }, |
| 1581 | }, |
| 1582 | name: "libc_syscalls", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1583 | } |
| 1584 | |
| 1585 | // ======================================================== |
| 1586 | // libc_aeabi.a |
| 1587 | // This is an LP32 ARM-only library that needs to be built with -fno-builtin |
| 1588 | // to avoid infinite recursion. For the other architectures we just build an |
| 1589 | // empty library to keep this makefile simple. |
| 1590 | // ======================================================== |
| 1591 | |
| 1592 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1593 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1594 | arch: { |
| 1595 | arm: { |
| 1596 | srcs: ["arch-arm/bionic/__aeabi.c"], |
| 1597 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1598 | }, |
| 1599 | name: "libc_aeabi", |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1600 | cflags: ["-fno-builtin"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1601 | } |
| 1602 | |
| 1603 | // ======================================================== |
| 1604 | // libc_ndk.a |
| 1605 | // Compatibility library for the NDK. This library contains |
| 1606 | // all the parts of libc that are safe to statically link. |
| 1607 | // We can't safely statically link things that can only run |
| 1608 | // on a certain version of the OS. Examples include |
| 1609 | // anything that talks to netd (a large portion of the DNS |
| 1610 | // code) and anything that is dependent on the layout of a |
| 1611 | // data structure that has changed across releases (such as |
| 1612 | // pthread_t). |
| 1613 | // ======================================================== |
| 1614 | |
| 1615 | cc_library_static { |
| 1616 | name: "libc_ndk", |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1617 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1618 | srcs: libc_common_src_files + ["bionic/malloc_debug_common.cpp"], |
| 1619 | multilib: { |
| 1620 | lib32: { |
| 1621 | srcs: libc_common_src_files_32, |
| 1622 | }, |
| 1623 | }, |
| 1624 | arch: { |
| 1625 | arm: { |
| 1626 | srcs: [ |
| 1627 | "arch-arm/bionic/exidx_dynamic.c", |
| 1628 | "arch-common/bionic/crtbegin_so.c", |
| 1629 | "arch-arm/bionic/atexit_legacy.c", |
| 1630 | "arch-common/bionic/crtend_so.S", |
| 1631 | ], |
| 1632 | whole_static_libs: ["libc_aeabi"], |
| 1633 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1634 | }, |
| 1635 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1636 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1637 | "-fvisibility=hidden", |
| 1638 | "-DLIBC_STATIC", |
| 1639 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1640 | |
| 1641 | whole_static_libs: [ |
| 1642 | "libc_bionic_ndk", |
| 1643 | "libc_cxa", |
| 1644 | "libc_freebsd", |
| 1645 | "libc_gdtoa", |
| 1646 | "libc_malloc", |
| 1647 | "libc_netbsd", |
| 1648 | "libc_openbsd_ndk", |
| 1649 | "libc_stack_protector", |
| 1650 | "libc_syscalls", |
| 1651 | "libc_tzcode", |
| 1652 | "libm", |
| 1653 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1654 | } |
| 1655 | |
| 1656 | // ======================================================== |
| 1657 | // libc_common.a |
| 1658 | // ======================================================== |
| 1659 | |
| 1660 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1661 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1662 | srcs: libc_common_src_files, |
| 1663 | multilib: { |
| 1664 | lib32: { |
| 1665 | srcs: libc_common_src_files_32, |
| 1666 | }, |
| 1667 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1668 | name: "libc_common", |
| 1669 | |
| 1670 | whole_static_libs: [ |
| 1671 | "libc_bionic", |
| 1672 | "libc_bionic_ndk", |
| 1673 | "libc_cxa", |
| 1674 | "libc_dns", |
| 1675 | "libc_freebsd", |
| 1676 | "libc_gdtoa", |
| 1677 | "libc_malloc", |
| 1678 | "libc_netbsd", |
| 1679 | "libc_openbsd", |
| 1680 | "libc_openbsd_ndk", |
| 1681 | "libc_pthread", |
| 1682 | "libc_stack_protector", |
| 1683 | "libc_syscalls", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1684 | "libc_tzcode", |
| 1685 | ], |
| 1686 | |
| 1687 | arch: { |
| 1688 | arm: { |
| 1689 | whole_static_libs: ["libc_aeabi"], |
| 1690 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1691 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1692 | } |
| 1693 | |
| 1694 | // ======================================================== |
| 1695 | // libc_nomalloc.a |
| 1696 | // ======================================================== |
| 1697 | // |
| 1698 | // This is a version of the static C library that does not |
| 1699 | // include malloc. It's useful in situations when the user wants |
| 1700 | // to provide their own malloc implementation, or wants to |
| 1701 | // explicitly disallow the use of malloc, such as in the |
| 1702 | // dynamic linker. |
| 1703 | |
| 1704 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1705 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1706 | srcs: [ |
| 1707 | "bionic/dl_iterate_phdr_static.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1708 | ], |
| 1709 | |
| 1710 | arch: { |
| 1711 | arm: { |
| 1712 | srcs: ["arch-arm/bionic/exidx_static.c"], |
| 1713 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1714 | }, |
| 1715 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1716 | cflags: ["-DLIBC_STATIC"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1717 | |
| 1718 | name: "libc_nomalloc", |
| 1719 | |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 1720 | whole_static_libs: [ |
| 1721 | "libc_common", |
| 1722 | "libc_init_static", |
| 1723 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1724 | } |
| 1725 | |
| 1726 | // ======================================================== |
| 1727 | // libc_malloc.a: the _prefixed_ malloc functions (like dlcalloc). |
| 1728 | // ======================================================== |
| 1729 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1730 | defaults: ["libc_defaults"], |
| 1731 | product_variables: { |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1732 | device_uses_jemalloc: { |
| 1733 | srcs: ["bionic/jemalloc_wrapper.cpp"], |
| 1734 | whole_static_libs: ["libjemalloc"], |
| 1735 | }, |
| 1736 | device_uses_dlmalloc: { |
| 1737 | srcs: ["bionic/dlmalloc.c"], |
| 1738 | }, |
| 1739 | }, |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1740 | cflags: ["-fvisibility=hidden"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1741 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1742 | name: "libc_malloc", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1743 | } |
| 1744 | |
| 1745 | // ======================================================== |
| 1746 | // libc.a + libc.so |
| 1747 | // ======================================================== |
| 1748 | cc_library { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1749 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1750 | name: "libc", |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1751 | product_variables: { |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1752 | platform_sdk_version: { |
| 1753 | asflags: ["-DPLATFORM_SDK_VERSION=%d"], |
| 1754 | }, |
| 1755 | }, |
| 1756 | srcs: ["bionic/malloc_debug_common.cpp"], |
| 1757 | static: { |
| 1758 | srcs: [ |
| 1759 | "bionic/dl_iterate_phdr_static.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1760 | ], |
| 1761 | cflags: ["-DLIBC_STATIC"], |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 1762 | whole_static_libs: ["libc_init_static"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1763 | }, |
| 1764 | shared: { |
| 1765 | srcs: [ |
| 1766 | "arch-common/bionic/crtbegin_so.c", |
| 1767 | "arch-common/bionic/crtbrand.S", |
| 1768 | "bionic/libc_init_dynamic.cpp", |
| 1769 | "bionic/NetdClient.cpp", |
| 1770 | "arch-common/bionic/crtend_so.S", |
| 1771 | ], |
| 1772 | }, |
| 1773 | |
| 1774 | required: ["tzdata"], |
| 1775 | |
| 1776 | // Leave the symbols in the shared library so that stack unwinders can produce |
| 1777 | // meaningful name resolution. |
| 1778 | strip: "keep_symbols", |
| 1779 | |
| 1780 | // WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries, |
| 1781 | // make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This |
| 1782 | // ensures that symbols that are pulled into those new libraries from libgcc.a are not declared |
| 1783 | // external; if that were the case, then libc would not pull those symbols from libgcc.a as it |
| 1784 | // should, instead relying on the external symbols from the dependent libraries. That would |
| 1785 | // create a "cloaked" dependency on libgcc.a in libc though the libraries, which is not what |
| 1786 | // you wanted! |
| 1787 | |
| 1788 | shared_libs: ["libdl"], |
| 1789 | whole_static_libs: ["libc_common"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1790 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1791 | // We'd really like to do this for all architectures, but since this wasn't done |
| 1792 | // before, these symbols must continue to be exported on LP32 for binary |
| 1793 | // compatibility. |
| 1794 | multilib: { |
| 1795 | lib64: { |
| 1796 | ldflags: ["-Wl,--exclude-libs,libgcc.a"], |
| 1797 | }, |
| 1798 | }, |
| 1799 | |
| 1800 | nocrt: true, |
| 1801 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1802 | arch: { |
| 1803 | arm: { |
Dmitriy Ivanov | 280d546 | 2015-09-28 10:14:17 -0700 | [diff] [blame] | 1804 | //TODO: 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] | 1805 | ldflags: ["-Wl,--hash-style=both"], |
| 1806 | |
Dan Willemsen | 9e6f98f | 2015-11-03 14:30:57 -0800 | [diff] [blame] | 1807 | // Don't re-export new/delete and friends, even if the compiler really wants to. |
| 1808 | version_script: "libc.arm.map", |
Dan Willemsen | 9b59acc | 2016-01-05 14:32:06 -0800 | [diff] [blame] | 1809 | product_variables: { |
| 1810 | brillo: { |
| 1811 | version_script: "libc.arm.brillo.map", |
| 1812 | }, |
| 1813 | }, |
Dan Willemsen | 9e6f98f | 2015-11-03 14:30:57 -0800 | [diff] [blame] | 1814 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1815 | shared: { |
| 1816 | srcs: ["arch-arm/bionic/exidx_dynamic.c"], |
| 1817 | }, |
| 1818 | static: { |
| 1819 | srcs: ["arch-arm/bionic/exidx_static.c"], |
| 1820 | }, |
Dan Willemsen | 9b59acc | 2016-01-05 14:32:06 -0800 | [diff] [blame] | 1821 | |
| 1822 | // special for arm |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1823 | cflags: ["-DCRT_LEGACY_WORKAROUND"], |
| 1824 | srcs: [ |
| 1825 | "arch-arm/bionic/atexit_legacy.c", |
| 1826 | ], |
| 1827 | }, |
Dan Willemsen | 9e6f98f | 2015-11-03 14:30:57 -0800 | [diff] [blame] | 1828 | arm64: { |
| 1829 | // Don't re-export new/delete and friends, even if the compiler really wants to. |
| 1830 | version_script: "libc.arm64.map", |
| 1831 | }, |
| 1832 | mips: { |
| 1833 | // Don't re-export new/delete and friends, even if the compiler really wants to. |
| 1834 | version_script: "libc.mips.map", |
Dan Willemsen | 9b59acc | 2016-01-05 14:32:06 -0800 | [diff] [blame] | 1835 | product_variables: { |
| 1836 | brillo: { |
| 1837 | version_script: "libc.mips.brillo.map", |
| 1838 | }, |
| 1839 | }, |
Dan Willemsen | 9e6f98f | 2015-11-03 14:30:57 -0800 | [diff] [blame] | 1840 | }, |
| 1841 | mips64: { |
| 1842 | // Don't re-export new/delete and friends, even if the compiler really wants to. |
| 1843 | version_script: "libc.mips64.map", |
| 1844 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1845 | x86: { |
Dmitriy Ivanov | 280d546 | 2015-09-28 10:14:17 -0700 | [diff] [blame] | 1846 | //TODO: 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] | 1847 | ldflags: ["-Wl,--hash-style=both"], |
Dan Willemsen | 9e6f98f | 2015-11-03 14:30:57 -0800 | [diff] [blame] | 1848 | |
| 1849 | // Don't re-export new/delete and friends, even if the compiler really wants to. |
| 1850 | version_script: "libc.x86.map", |
Dan Willemsen | 9b59acc | 2016-01-05 14:32:06 -0800 | [diff] [blame] | 1851 | product_variables: { |
| 1852 | brillo: { |
| 1853 | version_script: "libc.x86.brillo.map", |
| 1854 | }, |
| 1855 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1856 | }, |
| 1857 | x86_64: { |
Dan Willemsen | 9e6f98f | 2015-11-03 14:30:57 -0800 | [diff] [blame] | 1858 | // Don't re-export new/delete and friends, even if the compiler really wants to. |
| 1859 | version_script: "libc.x86_64.map", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1860 | }, |
| 1861 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1862 | } |
| 1863 | |
| 1864 | // For all builds, except for the -user build we will enable memory |
| 1865 | // allocation checking (including memory leaks, buffer overwrites, etc.) |
| 1866 | // Note that all these checks are also controlled by env. settings |
| 1867 | // that can enable, or disable specific checks. Note also that some of |
| 1868 | // the checks are available only in emulator and are implemeted in |
| 1869 | // libc_malloc_qemu_instrumented.so. |
| 1870 | // ANDROIDMK TRANSLATION ERROR: unsupported directive |
| 1871 | // ifneq ($(TARGET_BUILD_VARIANT),user) |
| 1872 | // ======================================================== |
| 1873 | // libc_malloc_debug_leak.so |
| 1874 | // ======================================================== |
| 1875 | cc_library_shared { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1876 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1877 | |
| 1878 | srcs: [ |
| 1879 | "bionic/debug_backtrace.cpp", |
| 1880 | "bionic/debug_mapinfo.cpp", |
| 1881 | "bionic/libc_logging.cpp", |
| 1882 | "bionic/malloc_debug_leak.cpp", |
| 1883 | "bionic/malloc_debug_check.cpp", |
| 1884 | ], |
| 1885 | |
| 1886 | name: "libc_malloc_debug_leak", |
| 1887 | |
| 1888 | shared_libs: [ |
| 1889 | "libc", |
| 1890 | "libdl", |
| 1891 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1892 | // Only need this for arm since libc++ uses its own unwind code that |
| 1893 | // doesn't mix with the other default unwind code. |
| 1894 | arch: { |
| 1895 | arm: { |
| 1896 | static_libs: [ |
| 1897 | "libunwind_llvm", |
| 1898 | "libc++abi", |
| 1899 | ], |
| 1900 | ldflags: ["-Wl,--exclude-libs,libunwind_llvm.a"], |
| 1901 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1902 | }, |
| 1903 | allow_undefined_symbols: true, |
| 1904 | |
| 1905 | // Don't re-export new/delete and friends, even if the compiler really wants to. |
| 1906 | version_script: "version_script.txt", |
| 1907 | |
| 1908 | // Don't install on release build |
| 1909 | tags: [ |
| 1910 | "eng", |
| 1911 | "debug", |
| 1912 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1913 | } |
| 1914 | |
| 1915 | // ======================================================== |
| 1916 | // libc_malloc_debug_qemu.so |
| 1917 | // ======================================================== |
| 1918 | cc_library_shared { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1919 | defaults: ["libc_defaults"], |
| 1920 | cflags: ["-DMALLOC_QEMU_INSTRUMENT"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1921 | |
| 1922 | srcs: [ |
| 1923 | "bionic/libc_logging.cpp", |
| 1924 | "bionic/malloc_debug_qemu.cpp", |
| 1925 | ], |
| 1926 | |
| 1927 | name: "libc_malloc_debug_qemu", |
| 1928 | |
| 1929 | shared_libs: [ |
| 1930 | "libc", |
| 1931 | "libdl", |
| 1932 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1933 | |
| 1934 | // Don't re-export new/delete and friends, even if the compiler really wants to. |
| 1935 | version_script: "version_script.txt", |
| 1936 | |
| 1937 | // Don't install on release build |
| 1938 | tags: [ |
| 1939 | "eng", |
| 1940 | "debug", |
| 1941 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1942 | } |
| 1943 | |
| 1944 | // ANDROIDMK TRANSLATION ERROR: unsupported directive |
| 1945 | // endif |
| 1946 | //!user |
| 1947 | |
| 1948 | // ======================================================== |
| 1949 | // libstdc++.so + libstdc++.a |
| 1950 | // ======================================================== |
| 1951 | cc_library { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1952 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1953 | include_dirs: ["bionic/libstdc++/include"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1954 | srcs: [ |
| 1955 | "bionic/__cxa_guard.cpp", |
| 1956 | "bionic/__cxa_pure_virtual.cpp", |
| 1957 | "bionic/new.cpp", |
| 1958 | "bionic/libc_logging.cpp", |
| 1959 | ], |
| 1960 | name: "libstdc++", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1961 | system_shared_libs: ["libc"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1962 | |
Dmitriy Ivanov | 280d546 | 2015-09-28 10:14:17 -0700 | [diff] [blame] | 1963 | //TODO: 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] | 1964 | arch: { |
| 1965 | arm: { |
| 1966 | ldflags: ["-Wl,--hash-style=both"], |
| 1967 | }, |
| 1968 | x86: { |
| 1969 | ldflags: ["-Wl,--hash-style=both"], |
| 1970 | }, |
| 1971 | }, |
| 1972 | } |
| 1973 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1974 | cc_defaults { |
| 1975 | name: "crt_defaults", |
| 1976 | |
| 1977 | no_default_compiler_flags: true, |
| 1978 | |
| 1979 | arch: { |
| 1980 | arm: { |
| 1981 | local_include_dirs: ["arch-arm/include"], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1982 | }, |
| 1983 | arm64: { |
| 1984 | local_include_dirs: ["arch-arm64/include"], |
| 1985 | }, |
| 1986 | mips: { |
| 1987 | local_include_dirs: ["arch-mips/include"], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1988 | }, |
| 1989 | mips64: { |
| 1990 | local_include_dirs: ["arch-mips64/include"], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1991 | }, |
| 1992 | x86: { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1993 | local_include_dirs: ["arch-x86/include"], |
| 1994 | }, |
| 1995 | x86_64: { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1996 | local_include_dirs: ["arch-x86_64/include"], |
| 1997 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1998 | }, |
Colin Cross | bff87d1 | 2015-11-23 14:12:19 -0800 | [diff] [blame] | 1999 | clang: false, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2000 | } |
| 2001 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2002 | cc_defaults { |
| 2003 | name: "crt_so_defaults", |
| 2004 | |
| 2005 | arch: { |
| 2006 | mips: { |
| 2007 | cflags: ["-fPIC"], |
| 2008 | }, |
| 2009 | mips64: { |
| 2010 | cflags: ["-fPIC"], |
| 2011 | }, |
| 2012 | x86: { |
| 2013 | cflags: ["-fPIC"], |
| 2014 | }, |
| 2015 | x86_64: { |
| 2016 | cflags: ["-fPIC"], |
| 2017 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2018 | }, |
| 2019 | } |
| 2020 | |
| 2021 | // Android.mk:start |
| 2022 | // # crt obj files |
| 2023 | // # ======================================================== |
| 2024 | // # crtbrand.c needs <stdint.h> and a #define for the platform SDK version. |
| 2025 | // libc_crt_target_cflags := \ |
| 2026 | // -I$(LOCAL_PATH)/include \ |
| 2027 | // -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) \ |
| 2028 | // |
| 2029 | // my_2nd_arch_prefix := |
| 2030 | // include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/$(TARGET_ARCH).mk |
| 2031 | // include $(LOCAL_PATH)/crt.mk |
| 2032 | // ifdef TARGET_2ND_ARCH |
| 2033 | // my_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX) |
| 2034 | // include $(LOCAL_PATH)/arch-$(TARGET_2ND_ARCH)/$(TARGET_2ND_ARCH).mk |
| 2035 | // include $(LOCAL_PATH)/crt.mk |
| 2036 | // my_2nd_arch_prefix := |
| 2037 | // endif |
| 2038 | // |
| 2039 | // include $(call all-makefiles-under,$(LOCAL_PATH)) |
| 2040 | // Android.mk:end |
| 2041 | cc_object { |
| 2042 | name: "crtbrand", |
| 2043 | local_include_dirs: ["include"], |
| 2044 | product_variables: { |
| 2045 | platform_sdk_version: { |
| 2046 | asflags: ["-DPLATFORM_SDK_VERSION=%d"], |
| 2047 | }, |
| 2048 | }, |
| 2049 | srcs: ["arch-common/bionic/crtbrand.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2050 | |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 2051 | defaults: [ |
| 2052 | "crt_defaults", |
| 2053 | "crt_so_defaults", |
| 2054 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2055 | } |
| 2056 | |
| 2057 | // Android.mk:ignore |
| 2058 | cc_object { |
| 2059 | name: "crtbegin_so1", |
| 2060 | local_include_dirs: ["include"], |
| 2061 | srcs: ["arch-common/bionic/crtbegin_so.c"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2062 | |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 2063 | defaults: [ |
| 2064 | "crt_defaults", |
| 2065 | "crt_so_defaults", |
| 2066 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2067 | } |
| 2068 | |
| 2069 | // Android.mk:ignore |
| 2070 | cc_object { |
| 2071 | name: "crtbegin_so", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2072 | |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 2073 | defaults: [ |
| 2074 | "crt_defaults", |
| 2075 | "crt_so_defaults", |
| 2076 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2077 | deps: [ |
| 2078 | "crtbegin_so1", |
| 2079 | "crtbrand", |
| 2080 | ], |
| 2081 | } |
| 2082 | |
| 2083 | // Android.mk:ignore |
| 2084 | cc_object { |
| 2085 | name: "crtend_so", |
| 2086 | local_include_dirs: ["include"], |
| 2087 | srcs: ["arch-common/bionic/crtend_so.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2088 | |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 2089 | defaults: [ |
| 2090 | "crt_defaults", |
| 2091 | "crt_so_defaults", |
| 2092 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2093 | } |
| 2094 | |
| 2095 | // Android.mk:ignore |
| 2096 | cc_object { |
| 2097 | name: "crtbegin_static1", |
| 2098 | local_include_dirs: ["include"], |
| 2099 | srcs: ["arch-common/bionic/crtbegin.c"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2100 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2101 | arch: { |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2102 | arm64: { |
| 2103 | srcs: [ |
| 2104 | "arch-arm64/bionic/crtbegin.c", |
| 2105 | ], |
| 2106 | exclude_srcs: [ |
| 2107 | "arch-common/bionic/crtbegin.c", |
| 2108 | ], |
| 2109 | }, |
| 2110 | mips: { |
| 2111 | srcs: [ |
| 2112 | "arch-mips/bionic/crtbegin.c", |
| 2113 | ], |
| 2114 | exclude_srcs: [ |
| 2115 | "arch-common/bionic/crtbegin.c", |
| 2116 | ], |
| 2117 | }, |
| 2118 | mips64: { |
| 2119 | srcs: [ |
| 2120 | "arch-mips64/bionic/crtbegin.c", |
| 2121 | ], |
| 2122 | exclude_srcs: [ |
| 2123 | "arch-common/bionic/crtbegin.c", |
| 2124 | ], |
| 2125 | }, |
| 2126 | }, |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2127 | |
| 2128 | defaults: ["crt_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2129 | } |
| 2130 | |
| 2131 | // Android.mk:ignore |
| 2132 | cc_object { |
| 2133 | name: "crtbegin_static", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2134 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2135 | deps: [ |
| 2136 | "crtbegin_static1", |
| 2137 | "crtbrand", |
| 2138 | ], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2139 | defaults: ["crt_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2140 | } |
| 2141 | |
| 2142 | // Android.mk:ignore |
| 2143 | cc_object { |
| 2144 | name: "crtbegin_dynamic1", |
| 2145 | local_include_dirs: ["include"], |
| 2146 | srcs: ["arch-common/bionic/crtbegin.c"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2147 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2148 | arch: { |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2149 | arm64: { |
| 2150 | srcs: [ |
| 2151 | "arch-arm64/bionic/crtbegin.c", |
| 2152 | ], |
| 2153 | exclude_srcs: [ |
| 2154 | "arch-common/bionic/crtbegin.c", |
| 2155 | ], |
| 2156 | }, |
| 2157 | mips: { |
| 2158 | srcs: [ |
| 2159 | "arch-mips/bionic/crtbegin.c", |
| 2160 | ], |
| 2161 | exclude_srcs: [ |
| 2162 | "arch-common/bionic/crtbegin.c", |
| 2163 | ], |
| 2164 | }, |
| 2165 | mips64: { |
| 2166 | srcs: [ |
| 2167 | "arch-mips64/bionic/crtbegin.c", |
| 2168 | ], |
| 2169 | exclude_srcs: [ |
| 2170 | "arch-common/bionic/crtbegin.c", |
| 2171 | ], |
| 2172 | }, |
| 2173 | }, |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2174 | defaults: ["crt_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2175 | } |
| 2176 | |
| 2177 | // Android.mk:ignore |
| 2178 | cc_object { |
| 2179 | name: "crtbegin_dynamic", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2180 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2181 | deps: [ |
| 2182 | "crtbegin_dynamic1", |
| 2183 | "crtbrand", |
| 2184 | ], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2185 | defaults: ["crt_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2186 | } |
| 2187 | |
| 2188 | // Android.mk:ignore |
| 2189 | cc_object { |
| 2190 | // We rename crtend.o to crtend_android.o to avoid a |
| 2191 | // name clash between gcc and bionic. |
| 2192 | name: "crtend_android", |
| 2193 | local_include_dirs: ["include"], |
| 2194 | srcs: ["arch-common/bionic/crtend.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2195 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2196 | defaults: ["crt_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2197 | } |