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