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