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