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