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