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 = [ |
Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 4 | "async_safe/async_safe_log.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 5 | "bionic/ether_aton.c", |
| 6 | "bionic/ether_ntoa.c", |
Victor Khimenko | 8e0707d | 2020-06-09 21:57:05 +0200 | [diff] [blame] | 7 | "bionic/exit.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 8 | "bionic/fts.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 9 | "bionic/initgroups.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 10 | "bionic/isatty.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 11 | "bionic/sched_cpualloc.c", |
| 12 | "bionic/sched_cpucount.c", |
Elliott Hughes | 3a4c454 | 2017-07-19 17:20:24 -0700 | [diff] [blame] | 13 | "stdio/fmemopen.cpp", |
Elliott Hughes | 7f0849f | 2016-08-26 16:17:17 -0700 | [diff] [blame] | 14 | "stdio/parsefloat.c", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 15 | "stdio/refill.c", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 16 | "stdio/stdio.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 17 | "stdio/stdio_ext.cpp", |
Elliott Hughes | 38e4aef | 2018-01-18 10:21:29 -0800 | [diff] [blame] | 18 | "stdio/vfscanf.cpp", |
Elliott Hughes | 7f0849f | 2016-08-26 16:17:17 -0700 | [diff] [blame] | 19 | "stdio/vfwscanf.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 20 | ] |
| 21 | |
Peter Collingbourne | 570de33 | 2019-12-11 10:00:58 -0800 | [diff] [blame] | 22 | // off64_t/time64_t support on LP32. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 23 | // ======================================================== |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 24 | libc_common_src_files_32 = [ |
| 25 | "bionic/legacy_32_bit_support.cpp", |
| 26 | "bionic/time64.c", |
| 27 | ] |
| 28 | |
Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 29 | libc_common_flags = [ |
| 30 | "-D_LIBC=1", |
Elliott Hughes | 25f17e4 | 2018-02-12 15:48:01 -0800 | [diff] [blame] | 31 | "-D__BIONIC_LP32_USE_STAT64", |
Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 32 | "-Wall", |
| 33 | "-Wextra", |
| 34 | "-Wunused", |
Elliott Hughes | 3048a36 | 2018-01-19 17:58:07 -0800 | [diff] [blame] | 35 | "-Wno-char-subscripts", |
Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 36 | "-Wno-deprecated-declarations", |
Elliott Hughes | b348d5c | 2017-07-24 16:53:11 -0700 | [diff] [blame] | 37 | "-Wno-gcc-compat", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 38 | "-Wframe-larger-than=2048", |
Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 39 | |
| 40 | // Try to catch typical 32-bit assumptions that break with 64-bit pointers. |
| 41 | "-Werror=pointer-to-int-cast", |
| 42 | "-Werror=int-to-pointer-cast", |
| 43 | "-Werror=type-limits", |
| 44 | "-Werror", |
Ryan Prichard | 8f41957 | 2018-02-20 17:09:05 -0800 | [diff] [blame] | 45 | |
| 46 | // Clang's exit-time destructor registration hides __dso_handle, but |
| 47 | // __dso_handle needs to have default visibility on ARM32. See b/73485611. |
| 48 | "-Wexit-time-destructors", |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 49 | |
| 50 | // GWP-ASan requires platform TLS. |
| 51 | "-fno-emulated-tls", |
Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 52 | ] |
| 53 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 54 | // Define some common cflags |
| 55 | // ======================================================== |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 56 | cc_defaults { |
| 57 | name: "libc_defaults", |
Dan Willemsen | 7ec52b1 | 2016-11-28 17:02:25 -0800 | [diff] [blame] | 58 | defaults: ["linux_bionic_supported"], |
Elliott Hughes | 53cf348 | 2016-08-09 13:06:41 -0700 | [diff] [blame] | 59 | cflags: libc_common_flags, |
| 60 | asflags: libc_common_flags, |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 61 | conlyflags: ["-std=gnu99"], |
| 62 | cppflags: [], |
Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 63 | include_dirs: [ |
| 64 | "bionic/libc/async_safe/include", |
Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 65 | ], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 66 | |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 67 | header_libs: [ |
| 68 | "libc_headers", |
| 69 | "gwp_asan_headers", |
| 70 | ], |
| 71 | export_header_lib_headers: [ |
| 72 | "libc_headers", |
| 73 | ], |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 74 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 75 | stl: "none", |
| 76 | system_shared_libs: [], |
Colin Cross | 27c43c5 | 2016-04-07 13:27:24 -0700 | [diff] [blame] | 77 | sanitize: { |
Evgenii Stepanov | be551f5 | 2018-08-13 16:46:15 -0700 | [diff] [blame] | 78 | address: false, |
| 79 | integer_overflow: false, |
Mitch Phillips | dfde0ee | 2019-05-01 14:26:13 -0700 | [diff] [blame] | 80 | // TODO(b/132640749): Fix broken fuzzer support. |
| 81 | fuzzer: false, |
Colin Cross | 27c43c5 | 2016-04-07 13:27:24 -0700 | [diff] [blame] | 82 | }, |
Yifan Hong | 5a39cee | 2020-01-21 16:43:56 -0800 | [diff] [blame] | 83 | ramdisk_available: true, |
Jiyong Park | 5603c6e | 2018-04-27 21:53:11 +0900 | [diff] [blame] | 84 | recovery_available: true, |
dimitry | 7f04880 | 2019-05-03 15:57:34 +0200 | [diff] [blame] | 85 | native_bridge_supported: true, |
Ivan Lozano | f17fd1d | 2018-11-27 07:56:17 -0800 | [diff] [blame] | 86 | |
Yi Kong | e3d90de | 2019-02-20 14:28:56 -0800 | [diff] [blame] | 87 | // lld complains about duplicate symbols in libcrt and libgcc. Suppress the |
| 88 | // warning since this is intended right now. |
| 89 | ldflags: ["-Wl,-z,muldefs"], |
Peter Collingbourne | e99912f | 2019-11-01 15:37:00 -0700 | [diff] [blame] | 90 | |
| 91 | product_variables: { |
| 92 | experimental_mte: { |
| 93 | cflags: ["-DANDROID_EXPERIMENTAL_MTE"], |
| 94 | }, |
Evgenii Stepanov | 5a73e03 | 2020-04-29 14:59:44 -0700 | [diff] [blame] | 95 | malloc_zero_contents: { |
| 96 | cflags: ["-DSCUDO_ZERO_CONTENTS"], |
| 97 | }, |
| 98 | malloc_pattern_fill_contents: { |
| 99 | cflags: ["-DSCUDO_PATTERN_FILL_CONTENTS"], |
| 100 | }, |
Steven Moreland | fb65ee4 | 2020-07-31 00:18:38 +0000 | [diff] [blame] | 101 | malloc_not_svelte: { |
| 102 | cflags: ["-DUSE_SCUDO"], |
| 103 | }, |
Peter Collingbourne | e99912f | 2019-11-01 15:37:00 -0700 | [diff] [blame] | 104 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 105 | } |
| 106 | |
Christopher Ferris | 4df29ed | 2020-01-24 18:06:42 -0800 | [diff] [blame] | 107 | libc_scudo_product_variables = { |
| 108 | malloc_not_svelte: { |
| 109 | cflags: ["-DUSE_SCUDO"], |
| 110 | whole_static_libs: ["libscudo"], |
| 111 | exclude_static_libs: [ |
| 112 | "libjemalloc5", |
| 113 | "libc_jemalloc_wrapper", |
| 114 | ], |
| 115 | }, |
| 116 | } |
| 117 | |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 118 | // Defaults for native allocator libs/includes to make it |
| 119 | // easier to change. |
Christopher Ferris | 062eba2 | 2020-01-31 22:40:45 -0800 | [diff] [blame] | 120 | // To disable scudo for the non-svelte config remove the line: |
Christopher Ferris | 4df29ed | 2020-01-24 18:06:42 -0800 | [diff] [blame] | 121 | // product_variables: libc_scudo_product_variables, |
Christopher Ferris | 062eba2 | 2020-01-31 22:40:45 -0800 | [diff] [blame] | 122 | // in the cc_defaults below. |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 123 | // ======================================================== |
| 124 | cc_defaults { |
| 125 | name: "libc_native_allocator_defaults", |
| 126 | |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 127 | whole_static_libs: [ |
| 128 | "libjemalloc5", |
| 129 | "libc_jemalloc_wrapper", |
| 130 | ], |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 131 | header_libs: ["gwp_asan_headers"], |
Christopher Ferris | 062eba2 | 2020-01-31 22:40:45 -0800 | [diff] [blame] | 132 | product_variables: libc_scudo_product_variables, |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | // Functions not implemented by jemalloc directly, or that need to |
| 136 | // be modified for Android. |
| 137 | cc_library_static { |
| 138 | name: "libc_jemalloc_wrapper", |
| 139 | defaults: ["libc_defaults"], |
| 140 | srcs: ["bionic/jemalloc_wrapper.cpp"], |
| 141 | cflags: ["-fvisibility=hidden"], |
| 142 | |
Christopher Ferris | 4df29ed | 2020-01-24 18:06:42 -0800 | [diff] [blame] | 143 | // Used to pull in the jemalloc include directory so that if the |
| 144 | // library is removed, the include directory is also removed. |
| 145 | static_libs: ["libjemalloc5"], |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 146 | } |
| 147 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 148 | // ======================================================== |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 149 | // libc_bootstrap.a - -fno-stack-protector and -ffreestanding |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 150 | // ======================================================== |
| 151 | // |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 152 | // Code that implements the stack protector (or that runs before TLS has been set up) needs to be |
| 153 | // compiled with -fno-stack-protector, since it accesses the stack canary TLS slot. In the linker, |
| 154 | // some of this code runs before ifunc resolvers have made string.h functions work, so compile with |
| 155 | // -ffreestanding. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 156 | |
| 157 | cc_library_static { |
| 158 | |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 159 | srcs: [ |
| 160 | "bionic/__libc_init_main_thread.cpp", |
| 161 | "bionic/__stack_chk_fail.cpp", |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 162 | "bionic/bionic_call_ifunc_resolver.cpp", |
| 163 | "bionic/getauxval.cpp", |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 164 | ], |
| 165 | arch: { |
| 166 | arm64: { |
| 167 | srcs: ["arch-arm64/bionic/__set_tls.c"], |
| 168 | }, |
| 169 | x86: { |
Ryan Prichard | 27475b5 | 2018-05-17 17:14:18 -0700 | [diff] [blame] | 170 | srcs: [ |
| 171 | "arch-x86/bionic/__libc_init_sysinfo.cpp", |
| 172 | "arch-x86/bionic/__set_tls.cpp", |
| 173 | ], |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 174 | }, |
| 175 | x86_64: { |
| 176 | srcs: ["arch-x86_64/bionic/__set_tls.c"], |
| 177 | }, |
| 178 | }, |
| 179 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 180 | defaults: ["libc_defaults"], |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 181 | cflags: ["-fno-stack-protector", "-ffreestanding"], |
| 182 | name: "libc_bootstrap", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 183 | } |
| 184 | |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 185 | // libc_init_static.cpp and libc_init_dynamic.cpp need to be built without stack protector. |
| 186 | // libc_init_static.cpp sets up TLS for static executables, and libc_init_dynamic.cpp initializes |
| 187 | // the stack protector global variable. |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 188 | |
| 189 | cc_library_static { |
| 190 | name: "libc_init_static", |
| 191 | defaults: ["libc_defaults"], |
| 192 | srcs: ["bionic/libc_init_static.cpp"], |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 193 | cflags: [ |
| 194 | "-fno-stack-protector", |
| 195 | |
| 196 | // Compile libc_init_static.cpp with -ffreestanding, because some of its code is called |
| 197 | // from the linker before ifunc resolvers have made string.h functions available. |
| 198 | "-ffreestanding", |
| 199 | ], |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 200 | } |
| 201 | |
Stephen Crane | f4b1cbd | 2017-05-09 14:27:43 -0700 | [diff] [blame] | 202 | cc_library_static { |
| 203 | name: "libc_init_dynamic", |
| 204 | defaults: ["libc_defaults"], |
| 205 | srcs: ["bionic/libc_init_dynamic.cpp"], |
| 206 | cflags: ["-fno-stack-protector"], |
| 207 | } |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 208 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 209 | // ======================================================== |
| 210 | // libc_tzcode.a - upstream 'tzcode' code |
| 211 | // ======================================================== |
| 212 | |
| 213 | cc_library_static { |
| 214 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 215 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 216 | srcs: [ |
Dan Willemsen | 9c9aa74 | 2016-01-15 16:00:57 -0800 | [diff] [blame] | 217 | "tzcode/**/*.c", |
Elliott Hughes | 0e8616a | 2017-04-11 14:44:51 -0700 | [diff] [blame] | 218 | "tzcode/bionic.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 219 | "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one. |
| 220 | ], |
| 221 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 222 | cflags: [ |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 223 | "-Wno-unused-parameter", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 224 | // Don't use ridiculous amounts of stack. |
| 225 | "-DALL_STATE", |
| 226 | // Include tzsetwall, timelocal, timegm, time2posix, and posix2time. |
| 227 | "-DSTD_INSPIRED", |
Colin Cross | a35d23d | 2015-11-19 13:32:49 -0800 | [diff] [blame] | 228 | // Obviously, we want to be thread-safe. |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 229 | "-DTHREAD_SAFE", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 230 | // The name of the tm_gmtoff field in our struct tm. |
| 231 | "-DTM_GMTOFF=tm_gmtoff", |
| 232 | // Where we store our tzdata. |
Colin Cross | 7b29495 | 2016-09-29 14:08:13 -0700 | [diff] [blame] | 233 | "-DTZDIR=\"/system/usr/share/zoneinfo\"", |
Elliott Hughes | 0a610d0 | 2016-07-29 14:04:17 -0700 | [diff] [blame] | 234 | // Include `tzname`, `timezone`, and `daylight` globals. |
| 235 | "-DHAVE_POSIX_DECLS=0", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 236 | "-DUSG_COMPAT=1", |
Colin Cross | a35d23d | 2015-11-19 13:32:49 -0800 | [diff] [blame] | 237 | // Use the empty string (instead of " ") as the timezone abbreviation |
| 238 | // fallback. |
Colin Cross | 7b29495 | 2016-09-29 14:08:13 -0700 | [diff] [blame] | 239 | "-DWILDABBR=\"\"", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 240 | "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU", |
| 241 | "-Dlint", |
| 242 | ], |
| 243 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 244 | local_include_dirs: ["tzcode/"], |
| 245 | name: "libc_tzcode", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 246 | } |
| 247 | |
| 248 | // ======================================================== |
| 249 | // libc_dns.a - modified NetBSD DNS code |
| 250 | // ======================================================== |
| 251 | |
| 252 | cc_library_static { |
| 253 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 254 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 255 | srcs: [ |
Dan Willemsen | 9c9aa74 | 2016-01-15 16:00:57 -0800 | [diff] [blame] | 256 | "dns/**/*.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 257 | |
| 258 | "upstream-netbsd/lib/libc/isc/ev_streams.c", |
| 259 | "upstream-netbsd/lib/libc/isc/ev_timers.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 260 | ], |
| 261 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 262 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 263 | "-DANDROID_CHANGES", |
| 264 | "-DINET6", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 265 | "-Wno-unused-parameter", |
| 266 | "-include netbsd-compat.h", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 267 | "-Wframe-larger-than=66000", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 268 | ], |
| 269 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 270 | local_include_dirs: [ |
| 271 | "dns/include", |
| 272 | "private", |
| 273 | "upstream-netbsd/lib/libc/include", |
| 274 | "upstream-netbsd/android/include", |
| 275 | ], |
| 276 | |
| 277 | name: "libc_dns", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 278 | } |
| 279 | |
| 280 | // ======================================================== |
| 281 | // libc_freebsd.a - upstream FreeBSD C library code |
| 282 | // ======================================================== |
| 283 | // |
| 284 | // These files are built with the freebsd-compat.h header file |
| 285 | // automatically included. |
| 286 | |
| 287 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 288 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 289 | srcs: [ |
| 290 | "upstream-freebsd/lib/libc/gen/ldexp.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 291 | "upstream-freebsd/lib/libc/stdlib/getopt_long.c", |
Elliott Hughes | 5702c6f | 2017-08-31 17:27:05 -0700 | [diff] [blame] | 292 | "upstream-freebsd/lib/libc/stdlib/hcreate.c", |
| 293 | "upstream-freebsd/lib/libc/stdlib/hcreate_r.c", |
| 294 | "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c", |
| 295 | "upstream-freebsd/lib/libc/stdlib/hsearch_r.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 296 | "upstream-freebsd/lib/libc/stdlib/qsort.c", |
| 297 | "upstream-freebsd/lib/libc/stdlib/quick_exit.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 298 | "upstream-freebsd/lib/libc/string/wcpcpy.c", |
| 299 | "upstream-freebsd/lib/libc/string/wcpncpy.c", |
| 300 | "upstream-freebsd/lib/libc/string/wcscasecmp.c", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 301 | "upstream-freebsd/lib/libc/string/wcscat.c", |
| 302 | "upstream-freebsd/lib/libc/string/wcschr.c", |
| 303 | "upstream-freebsd/lib/libc/string/wcscmp.c", |
| 304 | "upstream-freebsd/lib/libc/string/wcscpy.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 305 | "upstream-freebsd/lib/libc/string/wcscspn.c", |
| 306 | "upstream-freebsd/lib/libc/string/wcsdup.c", |
| 307 | "upstream-freebsd/lib/libc/string/wcslcat.c", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 308 | "upstream-freebsd/lib/libc/string/wcslen.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 309 | "upstream-freebsd/lib/libc/string/wcsncasecmp.c", |
| 310 | "upstream-freebsd/lib/libc/string/wcsncat.c", |
| 311 | "upstream-freebsd/lib/libc/string/wcsncmp.c", |
| 312 | "upstream-freebsd/lib/libc/string/wcsncpy.c", |
| 313 | "upstream-freebsd/lib/libc/string/wcsnlen.c", |
| 314 | "upstream-freebsd/lib/libc/string/wcspbrk.c", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 315 | "upstream-freebsd/lib/libc/string/wcsrchr.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 316 | "upstream-freebsd/lib/libc/string/wcsspn.c", |
Elliott Hughes | 20f3399 | 2017-07-13 09:45:00 -0700 | [diff] [blame] | 317 | "upstream-freebsd/lib/libc/string/wcsstr.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 318 | "upstream-freebsd/lib/libc/string/wcstok.c", |
| 319 | "upstream-freebsd/lib/libc/string/wmemchr.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 320 | "upstream-freebsd/lib/libc/string/wmemcmp.c", |
Elliott Hughes | 20f3399 | 2017-07-13 09:45:00 -0700 | [diff] [blame] | 321 | "upstream-freebsd/lib/libc/string/wmemcpy.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 322 | "upstream-freebsd/lib/libc/string/wmemmove.c", |
Dan Willemsen | 9c9aa74 | 2016-01-15 16:00:57 -0800 | [diff] [blame] | 323 | "upstream-freebsd/lib/libc/string/wmemset.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 324 | ], |
| 325 | arch: { |
| 326 | arm64: { |
| 327 | exclude_srcs: [ |
| 328 | "upstream-freebsd/lib/libc/string/wmemmove.c", |
| 329 | ], |
| 330 | }, |
| 331 | x86: { |
| 332 | exclude_srcs: [ |
| 333 | "upstream-freebsd/lib/libc/string/wcschr.c", |
| 334 | "upstream-freebsd/lib/libc/string/wcscmp.c", |
| 335 | "upstream-freebsd/lib/libc/string/wcslen.c", |
| 336 | "upstream-freebsd/lib/libc/string/wcsrchr.c", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 337 | "upstream-freebsd/lib/libc/string/wmemcmp.c", |
| 338 | "upstream-freebsd/lib/libc/string/wcscat.c", |
| 339 | "upstream-freebsd/lib/libc/string/wcscpy.c", |
| 340 | "upstream-freebsd/lib/libc/string/wmemcmp.c", |
Shalini Salomi Bodapati | 4ed2f47 | 2019-06-13 09:54:08 +0530 | [diff] [blame] | 341 | "upstream-freebsd/lib/libc/string/wmemset.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 342 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 343 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 344 | }, |
| 345 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 346 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 347 | "-Wno-sign-compare", |
Elliott Hughes | 5702c6f | 2017-08-31 17:27:05 -0700 | [diff] [blame] | 348 | "-Wno-unused-parameter", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 349 | "-include freebsd-compat.h", |
| 350 | ], |
| 351 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 352 | local_include_dirs: [ |
| 353 | "upstream-freebsd/android/include", |
| 354 | ], |
| 355 | |
| 356 | name: "libc_freebsd", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 357 | } |
| 358 | |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 359 | cc_library_static { |
| 360 | defaults: ["libc_defaults"], |
| 361 | srcs: [ |
Elliott Hughes | f1c568d | 2017-09-26 17:09:07 -0700 | [diff] [blame] | 362 | "upstream-freebsd/lib/libc/gen/glob.c", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 363 | ], |
| 364 | |
| 365 | cflags: [ |
| 366 | "-Wno-sign-compare", |
| 367 | "-include freebsd-compat.h", |
Elliott Hughes | f1c568d | 2017-09-26 17:09:07 -0700 | [diff] [blame] | 368 | "-Wframe-larger-than=66000", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 369 | ], |
| 370 | |
| 371 | local_include_dirs: [ |
| 372 | "upstream-freebsd/android/include", |
| 373 | ], |
| 374 | |
| 375 | name: "libc_freebsd_large_stack", |
| 376 | } |
| 377 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 378 | // ======================================================== |
| 379 | // libc_netbsd.a - upstream NetBSD C library code |
| 380 | // ======================================================== |
| 381 | // |
| 382 | // These files are built with the netbsd-compat.h header file |
| 383 | // automatically included. |
| 384 | |
| 385 | cc_library_static { |
| 386 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 387 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 388 | srcs: [ |
| 389 | "upstream-netbsd/common/lib/libc/stdlib/random.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 390 | "upstream-netbsd/lib/libc/gen/nice.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 391 | "upstream-netbsd/lib/libc/gen/psignal.c", |
| 392 | "upstream-netbsd/lib/libc/gen/utime.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 393 | "upstream-netbsd/lib/libc/inet/nsap_addr.c", |
| 394 | "upstream-netbsd/lib/libc/regex/regcomp.c", |
| 395 | "upstream-netbsd/lib/libc/regex/regerror.c", |
| 396 | "upstream-netbsd/lib/libc/regex/regexec.c", |
| 397 | "upstream-netbsd/lib/libc/regex/regfree.c", |
| 398 | "upstream-netbsd/lib/libc/stdlib/bsearch.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 399 | "upstream-netbsd/lib/libc/stdlib/drand48.c", |
| 400 | "upstream-netbsd/lib/libc/stdlib/erand48.c", |
| 401 | "upstream-netbsd/lib/libc/stdlib/jrand48.c", |
| 402 | "upstream-netbsd/lib/libc/stdlib/lcong48.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 403 | "upstream-netbsd/lib/libc/stdlib/lrand48.c", |
| 404 | "upstream-netbsd/lib/libc/stdlib/mrand48.c", |
| 405 | "upstream-netbsd/lib/libc/stdlib/nrand48.c", |
| 406 | "upstream-netbsd/lib/libc/stdlib/_rand48.c", |
| 407 | "upstream-netbsd/lib/libc/stdlib/rand_r.c", |
| 408 | "upstream-netbsd/lib/libc/stdlib/reallocarr.c", |
| 409 | "upstream-netbsd/lib/libc/stdlib/seed48.c", |
| 410 | "upstream-netbsd/lib/libc/stdlib/srand48.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 411 | ], |
| 412 | multilib: { |
| 413 | lib32: { |
| 414 | // LP32 cruft |
| 415 | srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"], |
| 416 | }, |
| 417 | }, |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 418 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 419 | "-Wno-sign-compare", |
Dan Willemsen | 879cec2 | 2016-02-29 10:37:56 -0800 | [diff] [blame] | 420 | "-Wno-unused-parameter", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 421 | "-DPOSIX_MISTAKE", |
| 422 | "-include netbsd-compat.h", |
| 423 | ], |
| 424 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 425 | local_include_dirs: [ |
| 426 | "upstream-netbsd/android/include", |
| 427 | "upstream-netbsd/lib/libc/include", |
| 428 | ], |
| 429 | |
| 430 | name: "libc_netbsd", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 431 | } |
| 432 | |
| 433 | // ======================================================== |
| 434 | // libc_openbsd_ndk.a - upstream OpenBSD C library code |
| 435 | // that can be safely included in the libc_ndk.a (doesn't |
| 436 | // contain any troublesome global data or constructors). |
| 437 | // ======================================================== |
| 438 | // |
| 439 | // These files are built with the openbsd-compat.h header file |
| 440 | // automatically included. |
| 441 | |
| 442 | cc_library_static { |
| 443 | name: "libc_openbsd_ndk", |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 444 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 445 | srcs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 446 | "upstream-openbsd/lib/libc/gen/alarm.c", |
| 447 | "upstream-openbsd/lib/libc/gen/ctype_.c", |
| 448 | "upstream-openbsd/lib/libc/gen/daemon.c", |
| 449 | "upstream-openbsd/lib/libc/gen/err.c", |
| 450 | "upstream-openbsd/lib/libc/gen/errx.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 451 | "upstream-openbsd/lib/libc/gen/fnmatch.c", |
| 452 | "upstream-openbsd/lib/libc/gen/ftok.c", |
| 453 | "upstream-openbsd/lib/libc/gen/getprogname.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 454 | "upstream-openbsd/lib/libc/gen/setprogname.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 455 | "upstream-openbsd/lib/libc/gen/verr.c", |
| 456 | "upstream-openbsd/lib/libc/gen/verrx.c", |
| 457 | "upstream-openbsd/lib/libc/gen/vwarn.c", |
| 458 | "upstream-openbsd/lib/libc/gen/vwarnx.c", |
| 459 | "upstream-openbsd/lib/libc/gen/warn.c", |
| 460 | "upstream-openbsd/lib/libc/gen/warnx.c", |
| 461 | "upstream-openbsd/lib/libc/locale/btowc.c", |
| 462 | "upstream-openbsd/lib/libc/locale/mbrlen.c", |
| 463 | "upstream-openbsd/lib/libc/locale/mbstowcs.c", |
| 464 | "upstream-openbsd/lib/libc/locale/mbtowc.c", |
| 465 | "upstream-openbsd/lib/libc/locale/wcscoll.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 466 | "upstream-openbsd/lib/libc/locale/wcstoimax.c", |
| 467 | "upstream-openbsd/lib/libc/locale/wcstol.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 468 | "upstream-openbsd/lib/libc/locale/wcstoll.c", |
| 469 | "upstream-openbsd/lib/libc/locale/wcstombs.c", |
| 470 | "upstream-openbsd/lib/libc/locale/wcstoul.c", |
| 471 | "upstream-openbsd/lib/libc/locale/wcstoull.c", |
| 472 | "upstream-openbsd/lib/libc/locale/wcstoumax.c", |
| 473 | "upstream-openbsd/lib/libc/locale/wcsxfrm.c", |
| 474 | "upstream-openbsd/lib/libc/locale/wctob.c", |
| 475 | "upstream-openbsd/lib/libc/locale/wctomb.c", |
Elliott Hughes | 26fda77 | 2016-04-06 11:56:41 -0700 | [diff] [blame] | 476 | "upstream-openbsd/lib/libc/net/base64.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 477 | "upstream-openbsd/lib/libc/net/htonl.c", |
| 478 | "upstream-openbsd/lib/libc/net/htons.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 479 | "upstream-openbsd/lib/libc/net/inet_lnaof.c", |
| 480 | "upstream-openbsd/lib/libc/net/inet_makeaddr.c", |
| 481 | "upstream-openbsd/lib/libc/net/inet_netof.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 482 | "upstream-openbsd/lib/libc/net/inet_ntoa.c", |
| 483 | "upstream-openbsd/lib/libc/net/inet_ntop.c", |
| 484 | "upstream-openbsd/lib/libc/net/inet_pton.c", |
| 485 | "upstream-openbsd/lib/libc/net/ntohl.c", |
| 486 | "upstream-openbsd/lib/libc/net/ntohs.c", |
Colin Cross | 8ce38af | 2016-01-19 12:50:20 -0800 | [diff] [blame] | 487 | "upstream-openbsd/lib/libc/net/res_random.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 488 | "upstream-openbsd/lib/libc/stdio/fgetln.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 489 | "upstream-openbsd/lib/libc/stdio/fgetwc.c", |
| 490 | "upstream-openbsd/lib/libc/stdio/fgetws.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 491 | "upstream-openbsd/lib/libc/stdio/flags.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 492 | "upstream-openbsd/lib/libc/stdio/fpurge.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 493 | "upstream-openbsd/lib/libc/stdio/fputwc.c", |
| 494 | "upstream-openbsd/lib/libc/stdio/fputws.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 495 | "upstream-openbsd/lib/libc/stdio/fvwrite.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 496 | "upstream-openbsd/lib/libc/stdio/fwide.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 497 | "upstream-openbsd/lib/libc/stdio/getdelim.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 498 | "upstream-openbsd/lib/libc/stdio/gets.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 499 | "upstream-openbsd/lib/libc/stdio/makebuf.c", |
| 500 | "upstream-openbsd/lib/libc/stdio/mktemp.c", |
| 501 | "upstream-openbsd/lib/libc/stdio/open_memstream.c", |
| 502 | "upstream-openbsd/lib/libc/stdio/open_wmemstream.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 503 | "upstream-openbsd/lib/libc/stdio/rget.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 504 | "upstream-openbsd/lib/libc/stdio/setvbuf.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 505 | "upstream-openbsd/lib/libc/stdio/tempnam.c", |
| 506 | "upstream-openbsd/lib/libc/stdio/tmpnam.c", |
| 507 | "upstream-openbsd/lib/libc/stdio/ungetc.c", |
| 508 | "upstream-openbsd/lib/libc/stdio/ungetwc.c", |
| 509 | "upstream-openbsd/lib/libc/stdio/vasprintf.c", |
| 510 | "upstream-openbsd/lib/libc/stdio/vdprintf.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 511 | "upstream-openbsd/lib/libc/stdio/vsscanf.c", |
| 512 | "upstream-openbsd/lib/libc/stdio/vswprintf.c", |
| 513 | "upstream-openbsd/lib/libc/stdio/vswscanf.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 514 | "upstream-openbsd/lib/libc/stdio/wbuf.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 515 | "upstream-openbsd/lib/libc/stdio/wsetup.c", |
| 516 | "upstream-openbsd/lib/libc/stdlib/abs.c", |
Elliott Hughes | 01809e1 | 2019-02-05 16:48:22 -0800 | [diff] [blame] | 517 | "upstream-openbsd/lib/libc/stdlib/div.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 518 | "upstream-openbsd/lib/libc/stdlib/getenv.c", |
Colin Cross | b839610 | 2016-04-07 13:24:50 -0700 | [diff] [blame] | 519 | "upstream-openbsd/lib/libc/stdlib/getsubopt.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 520 | "upstream-openbsd/lib/libc/stdlib/insque.c", |
| 521 | "upstream-openbsd/lib/libc/stdlib/imaxabs.c", |
| 522 | "upstream-openbsd/lib/libc/stdlib/imaxdiv.c", |
| 523 | "upstream-openbsd/lib/libc/stdlib/labs.c", |
Elliott Hughes | 01809e1 | 2019-02-05 16:48:22 -0800 | [diff] [blame] | 524 | "upstream-openbsd/lib/libc/stdlib/ldiv.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 525 | "upstream-openbsd/lib/libc/stdlib/llabs.c", |
Elliott Hughes | 01809e1 | 2019-02-05 16:48:22 -0800 | [diff] [blame] | 526 | "upstream-openbsd/lib/libc/stdlib/lldiv.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 527 | "upstream-openbsd/lib/libc/stdlib/lsearch.c", |
Elliott Hughes | 26b0607 | 2020-07-31 11:00:10 -0700 | [diff] [blame] | 528 | "upstream-openbsd/lib/libc/stdlib/recallocarray.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 529 | "upstream-openbsd/lib/libc/stdlib/remque.c", |
| 530 | "upstream-openbsd/lib/libc/stdlib/setenv.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 531 | "upstream-openbsd/lib/libc/stdlib/tfind.c", |
| 532 | "upstream-openbsd/lib/libc/stdlib/tsearch.c", |
Elliott Hughes | fbac97a | 2019-02-04 16:46:24 -0800 | [diff] [blame] | 533 | "upstream-openbsd/lib/libc/string/memccpy.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 534 | "upstream-openbsd/lib/libc/string/strcasecmp.c", |
Elliott Hughes | fbac97a | 2019-02-04 16:46:24 -0800 | [diff] [blame] | 535 | "upstream-openbsd/lib/libc/string/strcasestr.c", |
| 536 | "upstream-openbsd/lib/libc/string/strcoll.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 537 | "upstream-openbsd/lib/libc/string/strcspn.c", |
| 538 | "upstream-openbsd/lib/libc/string/strdup.c", |
| 539 | "upstream-openbsd/lib/libc/string/strndup.c", |
| 540 | "upstream-openbsd/lib/libc/string/strpbrk.c", |
| 541 | "upstream-openbsd/lib/libc/string/strsep.c", |
| 542 | "upstream-openbsd/lib/libc/string/strspn.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 543 | "upstream-openbsd/lib/libc/string/strtok.c", |
Elliott Hughes | fbac97a | 2019-02-04 16:46:24 -0800 | [diff] [blame] | 544 | "upstream-openbsd/lib/libc/string/strxfrm.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 545 | "upstream-openbsd/lib/libc/string/wcslcpy.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 546 | "upstream-openbsd/lib/libc/string/wcswidth.c", |
| 547 | ], |
| 548 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 549 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 550 | "-Wno-sign-compare", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 551 | "-Wno-unused-parameter", |
| 552 | "-include openbsd-compat.h", |
| 553 | ], |
| 554 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 555 | local_include_dirs: [ |
| 556 | "private", |
| 557 | "stdio", |
| 558 | "upstream-openbsd/android/include", |
| 559 | "upstream-openbsd/lib/libc/include", |
| 560 | "upstream-openbsd/lib/libc/gdtoa/", |
| 561 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 562 | } |
| 563 | |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 564 | cc_library_static { |
| 565 | name: "libc_openbsd_large_stack", |
| 566 | defaults: ["libc_defaults"], |
| 567 | srcs: [ |
Elliott Hughes | 2f9c8ce | 2017-11-01 13:54:47 -0700 | [diff] [blame] | 568 | "stdio/vfprintf.cpp", |
| 569 | "stdio/vfwprintf.cpp", |
Elliott Hughes | 5633caa | 2020-08-06 14:32:43 -0700 | [diff] [blame] | 570 | "upstream-openbsd/lib/libc/string/memmem.c", |
Elliott Hughes | c6b38ae | 2019-11-22 11:15:42 -0800 | [diff] [blame] | 571 | "upstream-openbsd/lib/libc/string/strstr.c", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 572 | ], |
| 573 | cflags: [ |
| 574 | "-include openbsd-compat.h", |
| 575 | "-Wno-sign-compare", |
| 576 | "-Wframe-larger-than=5000", |
| 577 | ], |
| 578 | |
| 579 | local_include_dirs: [ |
Elliott Hughes | 3a589c2 | 2017-10-30 11:43:58 -0700 | [diff] [blame] | 580 | "upstream-openbsd/android/include/", |
| 581 | "upstream-openbsd/lib/libc/include/", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 582 | "upstream-openbsd/lib/libc/gdtoa/", |
Elliott Hughes | 3a589c2 | 2017-10-30 11:43:58 -0700 | [diff] [blame] | 583 | "upstream-openbsd/lib/libc/stdio/", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 584 | ], |
| 585 | } |
| 586 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 587 | // ======================================================== |
| 588 | // libc_openbsd.a - upstream OpenBSD C library code |
| 589 | // ======================================================== |
| 590 | // |
| 591 | // These files are built with the openbsd-compat.h header file |
| 592 | // automatically included. |
| 593 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 594 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 595 | srcs: [ |
Elliott Hughes | 211c4d3 | 2018-02-02 15:10:32 -0800 | [diff] [blame] | 596 | // These two depend on getentropy, which isn't in libc_ndk.a. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 597 | "upstream-openbsd/lib/libc/crypt/arc4random.c", |
| 598 | "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c", |
| 599 | |
| 600 | // May be overriden by per-arch optimized versions |
| 601 | "upstream-openbsd/lib/libc/string/memchr.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 602 | "upstream-openbsd/lib/libc/string/memrchr.c", |
| 603 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 604 | "upstream-openbsd/lib/libc/string/stpncpy.c", |
| 605 | "upstream-openbsd/lib/libc/string/strcat.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 606 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 607 | "upstream-openbsd/lib/libc/string/strlcat.c", |
| 608 | "upstream-openbsd/lib/libc/string/strlcpy.c", |
| 609 | "upstream-openbsd/lib/libc/string/strncat.c", |
| 610 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 611 | "upstream-openbsd/lib/libc/string/strncpy.c", |
| 612 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 613 | |
| 614 | arch: { |
| 615 | arm: { |
| 616 | exclude_srcs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 617 | "upstream-openbsd/lib/libc/string/strcpy.c", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 618 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 619 | "upstream-openbsd/lib/libc/string/strcat.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 620 | ], |
| 621 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 622 | arm64: { |
| 623 | exclude_srcs: [ |
| 624 | "upstream-openbsd/lib/libc/string/memchr.c", |
Peter Collingbourne | 2361d4e | 2020-06-03 16:55:37 -0700 | [diff] [blame] | 625 | "upstream-openbsd/lib/libc/string/memrchr.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 626 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 627 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 628 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 629 | ], |
| 630 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 631 | x86: { |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 632 | exclude_srcs: [ |
| 633 | "upstream-openbsd/lib/libc/string/memchr.c", |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 634 | "upstream-openbsd/lib/libc/string/memrchr.c", |
| 635 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 636 | "upstream-openbsd/lib/libc/string/stpncpy.c", |
| 637 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 638 | "upstream-openbsd/lib/libc/string/strcpy.c", |
| 639 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 640 | "upstream-openbsd/lib/libc/string/strncpy.c", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 641 | "upstream-openbsd/lib/libc/string/strlcat.c", |
| 642 | "upstream-openbsd/lib/libc/string/strlcpy.c", |
| 643 | "upstream-openbsd/lib/libc/string/strncat.c", |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 644 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 645 | }, |
| 646 | |
| 647 | x86_64: { |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 648 | exclude_srcs: [ |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 649 | "upstream-openbsd/lib/libc/string/stpcpy.c", |
| 650 | "upstream-openbsd/lib/libc/string/stpncpy.c", |
| 651 | "upstream-openbsd/lib/libc/string/strcat.c", |
| 652 | "upstream-openbsd/lib/libc/string/strcpy.c", |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 653 | "upstream-openbsd/lib/libc/string/strncat.c", |
| 654 | "upstream-openbsd/lib/libc/string/strncmp.c", |
| 655 | "upstream-openbsd/lib/libc/string/strncpy.c", |
| 656 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 657 | }, |
| 658 | }, |
| 659 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 660 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 661 | "-Wno-sign-compare", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 662 | "-Wno-unused-parameter", |
| 663 | "-include openbsd-compat.h", |
| 664 | ], |
| 665 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 666 | local_include_dirs: [ |
| 667 | "private", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 668 | "upstream-openbsd/android/include", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 669 | ], |
| 670 | |
| 671 | name: "libc_openbsd", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 672 | } |
| 673 | |
| 674 | // ======================================================== |
| 675 | // libc_gdtoa.a - upstream OpenBSD C library gdtoa code |
| 676 | // ======================================================== |
| 677 | // |
| 678 | // These files are built with the openbsd-compat.h header file |
| 679 | // automatically included. |
| 680 | |
| 681 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 682 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 683 | srcs: [ |
| 684 | "upstream-openbsd/android/gdtoa_support.cpp", |
| 685 | "upstream-openbsd/lib/libc/gdtoa/dmisc.c", |
| 686 | "upstream-openbsd/lib/libc/gdtoa/dtoa.c", |
| 687 | "upstream-openbsd/lib/libc/gdtoa/gdtoa.c", |
| 688 | "upstream-openbsd/lib/libc/gdtoa/gethex.c", |
| 689 | "upstream-openbsd/lib/libc/gdtoa/gmisc.c", |
| 690 | "upstream-openbsd/lib/libc/gdtoa/hd_init.c", |
| 691 | "upstream-openbsd/lib/libc/gdtoa/hdtoa.c", |
| 692 | "upstream-openbsd/lib/libc/gdtoa/hexnan.c", |
| 693 | "upstream-openbsd/lib/libc/gdtoa/ldtoa.c", |
| 694 | "upstream-openbsd/lib/libc/gdtoa/misc.c", |
| 695 | "upstream-openbsd/lib/libc/gdtoa/smisc.c", |
| 696 | "upstream-openbsd/lib/libc/gdtoa/strtod.c", |
| 697 | "upstream-openbsd/lib/libc/gdtoa/strtodg.c", |
| 698 | "upstream-openbsd/lib/libc/gdtoa/strtof.c", |
| 699 | "upstream-openbsd/lib/libc/gdtoa/strtord.c", |
| 700 | "upstream-openbsd/lib/libc/gdtoa/sum.c", |
| 701 | "upstream-openbsd/lib/libc/gdtoa/ulp.c", |
| 702 | ], |
| 703 | multilib: { |
| 704 | lib64: { |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 705 | srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 706 | }, |
| 707 | }, |
| 708 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 709 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 710 | "-Wno-sign-compare", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 711 | "-include openbsd-compat.h", |
| 712 | ], |
| 713 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 714 | local_include_dirs: [ |
| 715 | "private", |
| 716 | "upstream-openbsd/android/include", |
| 717 | "upstream-openbsd/lib/libc/include", |
| 718 | ], |
| 719 | |
| 720 | name: "libc_gdtoa", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 721 | } |
| 722 | |
| 723 | // ======================================================== |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 724 | // libc_fortify.a - container for our FORITFY |
| 725 | // implementation details |
| 726 | // ======================================================== |
| 727 | cc_library_static { |
| 728 | defaults: ["libc_defaults"], |
George Burgess IV | d34b0a9 | 2017-07-25 11:43:39 -0700 | [diff] [blame] | 729 | srcs: ["bionic/fortify.cpp"], |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 730 | |
| 731 | name: "libc_fortify", |
| 732 | |
| 733 | // Disable FORTIFY for the compilation of these, so we don't end up having |
| 734 | // FORTIFY silently call itself. |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 735 | cflags: [ |
| 736 | "-U_FORTIFY_SOURCE", |
| 737 | "-D__BIONIC_DECLARE_FORTIFY_HELPERS", |
| 738 | ], |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 739 | |
| 740 | arch: { |
| 741 | arm: { |
Haibo Huang | f1c8d1a | 2018-11-27 15:38:47 -0800 | [diff] [blame] | 742 | cflags: [ |
| 743 | "-DNO___MEMCPY_CHK", |
| 744 | "-DRENAME___STRCAT_CHK", |
| 745 | "-DRENAME___STRCPY_CHK", |
| 746 | ], |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 747 | srcs: [ |
| 748 | "arch-arm/generic/bionic/__memcpy_chk.S", |
Haibo Huang | f1c8d1a | 2018-11-27 15:38:47 -0800 | [diff] [blame] | 749 | |
| 750 | "arch-arm/cortex-a15/bionic/__strcat_chk.S", |
| 751 | "arch-arm/cortex-a15/bionic/__strcpy_chk.S", |
| 752 | |
| 753 | "arch-arm/cortex-a7/bionic/__strcat_chk.S", |
| 754 | "arch-arm/cortex-a7/bionic/__strcpy_chk.S", |
| 755 | |
| 756 | "arch-arm/cortex-a9/bionic/__strcat_chk.S", |
| 757 | "arch-arm/cortex-a9/bionic/__strcpy_chk.S", |
| 758 | |
| 759 | "arch-arm/krait/bionic/__strcat_chk.S", |
| 760 | "arch-arm/krait/bionic/__strcpy_chk.S", |
| 761 | |
| 762 | "arch-arm/cortex-a53/bionic/__strcat_chk.S", |
| 763 | "arch-arm/cortex-a53/bionic/__strcpy_chk.S", |
| 764 | |
Haibo Huang | 01bfd89 | 2018-12-03 15:05:16 -0800 | [diff] [blame] | 765 | "arch-arm/cortex-a55/bionic/__strcat_chk.S", |
| 766 | "arch-arm/cortex-a55/bionic/__strcpy_chk.S", |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 767 | ], |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 768 | }, |
| 769 | arm64: { |
George Burgess IV | d34b0a9 | 2017-07-25 11:43:39 -0700 | [diff] [blame] | 770 | cflags: ["-DNO___MEMCPY_CHK"], |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 771 | srcs: [ |
| 772 | "arch-arm64/generic/bionic/__memcpy_chk.S", |
| 773 | ], |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 774 | }, |
| 775 | }, |
| 776 | } |
| 777 | |
| 778 | // ======================================================== |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 779 | // libc_bionic.a - home-grown C library code |
| 780 | // ======================================================== |
| 781 | |
| 782 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 783 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 784 | srcs: [ |
Elliott Hughes | 211c4d3 | 2018-02-02 15:10:32 -0800 | [diff] [blame] | 785 | // These require getauxval, which isn't available on older platforms. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 786 | "bionic/sysconf.cpp", |
| 787 | "bionic/vdso.cpp", |
Dan Willemsen | 35e91a1 | 2015-09-17 15:28:45 -0700 | [diff] [blame] | 788 | "bionic/setjmp_cookie.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 789 | |
Josh Gao | 10ec928 | 2017-04-03 15:13:29 -0700 | [diff] [blame] | 790 | // The following must not be statically linked into libc_ndk.a, because |
| 791 | // debuggerd will look for the abort message in libc.so's copy. |
| 792 | "bionic/android_set_abort_message.cpp", |
| 793 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 794 | "bionic/strchr.cpp", |
Peter Collingbourne | 337a5b3 | 2020-02-21 12:11:02 -0800 | [diff] [blame] | 795 | "bionic/strchrnul.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 796 | "bionic/strnlen.c", |
| 797 | "bionic/strrchr.cpp", |
| 798 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 799 | |
| 800 | arch: { |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 801 | arm: { |
Elliott Hughes | 1b61d78 | 2019-06-04 10:38:34 -0700 | [diff] [blame] | 802 | asflags: libc_common_flags + ["-mno-restrict-it"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 803 | srcs: [ |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 804 | "arch-arm/generic/bionic/memcmp.S", |
Elliott Hughes | da46cae | 2018-05-24 14:40:32 -0700 | [diff] [blame] | 805 | "arch-arm/generic/bionic/memmove.S", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 806 | "arch-arm/generic/bionic/memset.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 807 | "arch-arm/generic/bionic/stpcpy.c", |
| 808 | "arch-arm/generic/bionic/strcat.c", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 809 | "arch-arm/generic/bionic/strcmp.S", |
| 810 | "arch-arm/generic/bionic/strcpy.S", |
| 811 | "arch-arm/generic/bionic/strlen.c", |
| 812 | |
Ryan Prichard | 45024fe | 2018-12-30 21:10:26 -0800 | [diff] [blame] | 813 | "arch-arm/bionic/__aeabi_read_tp.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 814 | "arch-arm/bionic/__bionic_clone.S", |
Yi Kong | b410d0e | 2019-04-22 16:00:46 -0700 | [diff] [blame] | 815 | "arch-arm/bionic/__restore.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 816 | "arch-arm/bionic/_exit_with_stack_teardown.S", |
Yi Kong | b410d0e | 2019-04-22 16:00:46 -0700 | [diff] [blame] | 817 | "arch-arm/bionic/atomics_arm.c", |
| 818 | "arch-arm/bionic/bpabi.c", |
Yi Kong | 165b1cf | 2019-02-13 14:10:10 -0800 | [diff] [blame] | 819 | "arch-arm/bionic/libcrt_compat.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 820 | "arch-arm/bionic/popcount_tab.c", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 821 | "arch-arm/bionic/setjmp.S", |
| 822 | "arch-arm/bionic/syscall.S", |
| 823 | "arch-arm/bionic/vfork.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 824 | |
| 825 | "arch-arm/cortex-a15/bionic/memcpy.S", |
| 826 | "arch-arm/cortex-a15/bionic/memmove.S", |
| 827 | "arch-arm/cortex-a15/bionic/memset.S", |
| 828 | "arch-arm/cortex-a15/bionic/stpcpy.S", |
| 829 | "arch-arm/cortex-a15/bionic/strcat.S", |
| 830 | "arch-arm/cortex-a15/bionic/strcmp.S", |
| 831 | "arch-arm/cortex-a15/bionic/strcpy.S", |
| 832 | "arch-arm/cortex-a15/bionic/strlen.S", |
| 833 | |
| 834 | "arch-arm/cortex-a7/bionic/memcpy.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 835 | "arch-arm/cortex-a7/bionic/memset.S", |
| 836 | |
| 837 | "arch-arm/cortex-a9/bionic/memcpy.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 838 | "arch-arm/cortex-a9/bionic/memset.S", |
| 839 | "arch-arm/cortex-a9/bionic/stpcpy.S", |
| 840 | "arch-arm/cortex-a9/bionic/strcat.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 841 | "arch-arm/cortex-a9/bionic/strcpy.S", |
| 842 | "arch-arm/cortex-a9/bionic/strlen.S", |
| 843 | |
| 844 | "arch-arm/krait/bionic/memcpy.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 845 | "arch-arm/krait/bionic/memset.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 846 | |
| 847 | "arch-arm/cortex-a53/bionic/memcpy.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 848 | |
Haibo Huang | 01bfd89 | 2018-12-03 15:05:16 -0800 | [diff] [blame] | 849 | "arch-arm/cortex-a55/bionic/memcpy.S", |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 850 | |
| 851 | "arch-arm/kryo/bionic/memcpy.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 852 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 853 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 854 | arm64: { |
| 855 | srcs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 856 | "arch-arm64/generic/bionic/memcpy.S", |
| 857 | "arch-arm64/generic/bionic/memmove.S", |
| 858 | "arch-arm64/generic/bionic/memset.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 859 | "arch-arm64/generic/bionic/wmemmove.S", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 860 | |
| 861 | "arch-arm64/bionic/__bionic_clone.S", |
| 862 | "arch-arm64/bionic/_exit_with_stack_teardown.S", |
| 863 | "arch-arm64/bionic/setjmp.S", |
| 864 | "arch-arm64/bionic/syscall.S", |
| 865 | "arch-arm64/bionic/vfork.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 866 | ], |
| 867 | exclude_srcs: [ |
| 868 | "bionic/__memcpy_chk.cpp", |
| 869 | "bionic/strchr.cpp", |
Peter Collingbourne | 337a5b3 | 2020-02-21 12:11:02 -0800 | [diff] [blame] | 870 | "bionic/strchrnul.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 871 | "bionic/strnlen.c", |
Peter Collingbourne | 337a5b3 | 2020-02-21 12:11:02 -0800 | [diff] [blame] | 872 | "bionic/strrchr.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 873 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 874 | }, |
| 875 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 876 | x86: { |
| 877 | srcs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 878 | "arch-x86/generic/string/memcmp.S", |
| 879 | "arch-x86/generic/string/strcmp.S", |
| 880 | "arch-x86/generic/string/strncmp.S", |
| 881 | "arch-x86/generic/string/strcat.S", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 882 | |
| 883 | "arch-x86/generic/string/strlcat.c", |
| 884 | "arch-x86/generic/string/strlcpy.c", |
| 885 | "arch-x86/generic/string/strncat.c", |
| 886 | "arch-x86/generic/string/wcscat.c", |
| 887 | "arch-x86/generic/string/wcscpy.c", |
| 888 | "arch-x86/generic/string/wmemcmp.c", |
Shalini Salomi Bodapati | 4ed2f47 | 2019-06-13 09:54:08 +0530 | [diff] [blame] | 889 | "arch-x86/generic/string/wmemset.c", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 890 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 891 | "arch-x86/atom/string/sse2-memchr-atom.S", |
| 892 | "arch-x86/atom/string/sse2-memrchr-atom.S", |
| 893 | "arch-x86/atom/string/sse2-strchr-atom.S", |
| 894 | "arch-x86/atom/string/sse2-strnlen-atom.S", |
| 895 | "arch-x86/atom/string/sse2-strrchr-atom.S", |
| 896 | "arch-x86/atom/string/sse2-wcschr-atom.S", |
| 897 | "arch-x86/atom/string/sse2-wcsrchr-atom.S", |
| 898 | "arch-x86/atom/string/sse2-wcslen-atom.S", |
| 899 | "arch-x86/atom/string/sse2-wcscmp-atom.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 900 | "arch-x86/silvermont/string/sse2-memmove-slm.S", |
| 901 | "arch-x86/silvermont/string/sse2-memset-slm.S", |
| 902 | "arch-x86/silvermont/string/sse2-stpcpy-slm.S", |
| 903 | "arch-x86/silvermont/string/sse2-stpncpy-slm.S", |
| 904 | "arch-x86/silvermont/string/sse2-strcpy-slm.S", |
| 905 | "arch-x86/silvermont/string/sse2-strlen-slm.S", |
| 906 | "arch-x86/silvermont/string/sse2-strncpy-slm.S", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 907 | |
| 908 | "arch-x86/bionic/__bionic_clone.S", |
| 909 | "arch-x86/bionic/_exit_with_stack_teardown.S", |
Yi Kong | 165b1cf | 2019-02-13 14:10:10 -0800 | [diff] [blame] | 910 | "arch-x86/bionic/libcrt_compat.c", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 911 | "arch-x86/bionic/__restore.S", |
| 912 | "arch-x86/bionic/setjmp.S", |
| 913 | "arch-x86/bionic/syscall.S", |
| 914 | "arch-x86/bionic/vfork.S", |
Ryan Prichard | a992a06 | 2020-04-18 02:59:24 -0700 | [diff] [blame] | 915 | "arch-x86/bionic/__x86.get_pc_thunk.S", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 916 | |
| 917 | // ssse3 functions |
| 918 | "arch-x86/atom/string/ssse3-strcat-atom.S", |
| 919 | "arch-x86/atom/string/ssse3-strcmp-atom.S", |
| 920 | "arch-x86/atom/string/ssse3-strlcat-atom.S", |
| 921 | "arch-x86/atom/string/ssse3-strlcpy-atom.S", |
| 922 | "arch-x86/atom/string/ssse3-strncat-atom.S", |
| 923 | "arch-x86/atom/string/ssse3-strncmp-atom.S", |
| 924 | "arch-x86/atom/string/ssse3-wcscat-atom.S", |
| 925 | "arch-x86/atom/string/ssse3-wcscpy-atom.S", |
| 926 | |
| 927 | // sse4 functions |
| 928 | "arch-x86/silvermont/string/sse4-memcmp-slm.S", |
| 929 | "arch-x86/silvermont/string/sse4-wmemcmp-slm.S", |
| 930 | |
| 931 | // atom functions |
| 932 | "arch-x86/atom/string/sse2-memset-atom.S", |
| 933 | "arch-x86/atom/string/sse2-strlen-atom.S", |
| 934 | "arch-x86/atom/string/ssse3-memcmp-atom.S", |
Haibo Huang | e141362 | 2018-11-13 14:20:43 -0800 | [diff] [blame] | 935 | "arch-x86/atom/string/ssse3-memmove-atom.S", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 936 | "arch-x86/atom/string/ssse3-strcpy-atom.S", |
| 937 | "arch-x86/atom/string/ssse3-strncpy-atom.S", |
| 938 | "arch-x86/atom/string/ssse3-wmemcmp-atom.S", |
Shalini Salomi Bodapati | 4ed2f47 | 2019-06-13 09:54:08 +0530 | [diff] [blame] | 939 | |
| 940 | // avx2 functions |
| 941 | "arch-x86/kabylake/string/avx2-wmemset-kbl.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 942 | ], |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 943 | |
| 944 | exclude_srcs: [ |
| 945 | "bionic/strchr.cpp", |
| 946 | "bionic/strnlen.c", |
| 947 | "bionic/strrchr.cpp", |
| 948 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 949 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 950 | x86_64: { |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 951 | srcs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 952 | "arch-x86_64/string/sse2-memmove-slm.S", |
| 953 | "arch-x86_64/string/sse2-memset-slm.S", |
| 954 | "arch-x86_64/string/sse2-stpcpy-slm.S", |
| 955 | "arch-x86_64/string/sse2-stpncpy-slm.S", |
| 956 | "arch-x86_64/string/sse2-strcat-slm.S", |
| 957 | "arch-x86_64/string/sse2-strcpy-slm.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 958 | "arch-x86_64/string/sse2-strlen-slm.S", |
| 959 | "arch-x86_64/string/sse2-strncat-slm.S", |
| 960 | "arch-x86_64/string/sse2-strncpy-slm.S", |
| 961 | "arch-x86_64/string/sse4-memcmp-slm.S", |
| 962 | "arch-x86_64/string/ssse3-strcmp-slm.S", |
| 963 | "arch-x86_64/string/ssse3-strncmp-slm.S", |
Shalini Salomi Bodapati | 4ed2f47 | 2019-06-13 09:54:08 +0530 | [diff] [blame] | 964 | "arch-x86_64/string/avx2-wmemset-kbl.S", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 965 | |
| 966 | "arch-x86_64/bionic/__bionic_clone.S", |
| 967 | "arch-x86_64/bionic/_exit_with_stack_teardown.S", |
| 968 | "arch-x86_64/bionic/__restore_rt.S", |
| 969 | "arch-x86_64/bionic/setjmp.S", |
| 970 | "arch-x86_64/bionic/syscall.S", |
| 971 | "arch-x86_64/bionic/vfork.S", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 972 | ], |
| 973 | }, |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 974 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 975 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 976 | cppflags: ["-Wold-style-cast"], |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 977 | include_dirs: ["bionic/libstdc++/include"], |
| 978 | name: "libc_bionic", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 979 | } |
| 980 | |
Elliott Hughes | 3f6eee9 | 2016-12-13 23:47:25 +0000 | [diff] [blame] | 981 | genrule { |
| 982 | name: "generated_android_ids", |
Colin Cross | 35bbed8 | 2017-01-17 18:16:07 -0800 | [diff] [blame] | 983 | out: ["generated_android_ids.h"], |
| 984 | srcs: [":android_filesystem_config_header"], |
| 985 | tool_files: ["fs_config_generator.py"], |
| 986 | cmd: "$(location fs_config_generator.py) aidarray $(in) > $(out)", |
Elliott Hughes | 3f6eee9 | 2016-12-13 23:47:25 +0000 | [diff] [blame] | 987 | } |
| 988 | |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 989 | // ======================================================== |
| 990 | // libc_bionic_ndk.a- The portions of libc_bionic that can |
| 991 | // be safely used in libc_ndk.a (no troublesome global data |
| 992 | // or constructors). |
| 993 | // ======================================================== |
| 994 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 995 | defaults: ["libc_defaults"], |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 996 | srcs: [ |
Dan Albert | e2fd010 | 2017-07-11 14:27:07 -0700 | [diff] [blame] | 997 | "bionic/NetdClientDispatch.cpp", |
Sandeep Patil | 9b1ca56 | 2017-08-21 12:17:19 -0700 | [diff] [blame] | 998 | "bionic/__bionic_get_shell_path.cpp", |
Dan Albert | e2fd010 | 2017-07-11 14:27:07 -0700 | [diff] [blame] | 999 | "bionic/__cmsg_nxthdr.cpp", |
| 1000 | "bionic/__errno.cpp", |
| 1001 | "bionic/__gnu_basename.cpp", |
| 1002 | "bionic/__libc_current_sigrtmax.cpp", |
| 1003 | "bionic/__libc_current_sigrtmin.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1004 | "bionic/abort.cpp", |
| 1005 | "bionic/accept.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1006 | "bionic/access.cpp", |
| 1007 | "bionic/arpa_inet.cpp", |
| 1008 | "bionic/assert.cpp", |
| 1009 | "bionic/atof.cpp", |
Ryan Prichard | 083d850 | 2019-01-24 13:47:13 -0800 | [diff] [blame] | 1010 | "bionic/bionic_allocator.cpp", |
Josh Gao | a170d9b | 2016-11-10 16:08:29 -0800 | [diff] [blame] | 1011 | "bionic/bionic_arc4random.cpp", |
Tom Cherry | ac49ced | 2017-08-17 13:18:52 -0700 | [diff] [blame] | 1012 | "bionic/bionic_futex.cpp", |
Colin Cross | 8ce38af | 2016-01-19 12:50:20 -0800 | [diff] [blame] | 1013 | "bionic/bionic_netlink.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1014 | "bionic/bionic_time_conversions.cpp", |
| 1015 | "bionic/brk.cpp", |
| 1016 | "bionic/c16rtomb.cpp", |
| 1017 | "bionic/c32rtomb.cpp", |
| 1018 | "bionic/chmod.cpp", |
| 1019 | "bionic/chown.cpp", |
| 1020 | "bionic/clearenv.cpp", |
| 1021 | "bionic/clock.cpp", |
| 1022 | "bionic/clock_getcpuclockid.cpp", |
| 1023 | "bionic/clock_nanosleep.cpp", |
| 1024 | "bionic/clone.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1025 | "bionic/ctype.cpp", |
| 1026 | "bionic/dirent.cpp", |
Josh Gao | 9727192 | 2019-11-06 13:15:00 -0800 | [diff] [blame] | 1027 | "bionic/dup.cpp", |
Victor Khimenko | 0a0743f | 2017-07-10 21:15:37 +0200 | [diff] [blame] | 1028 | "bionic/environ.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1029 | "bionic/error.cpp", |
Josh Gao | 7de4124 | 2020-04-29 17:08:46 -0700 | [diff] [blame] | 1030 | "bionic/eventfd.cpp", |
Elliott Hughes | e19c672 | 2016-08-26 16:15:57 +0000 | [diff] [blame] | 1031 | "bionic/exec.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1032 | "bionic/faccessat.cpp", |
| 1033 | "bionic/fchmod.cpp", |
| 1034 | "bionic/fchmodat.cpp", |
Josh Gao | 9727192 | 2019-11-06 13:15:00 -0800 | [diff] [blame] | 1035 | "bionic/fcntl.cpp", |
Josh Gao | f6e5b58 | 2018-06-01 15:30:54 -0700 | [diff] [blame] | 1036 | "bionic/fdsan.cpp", |
Josh Gao | 9727192 | 2019-11-06 13:15:00 -0800 | [diff] [blame] | 1037 | "bionic/fdtrack.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1038 | "bionic/ffs.cpp", |
| 1039 | "bionic/fgetxattr.cpp", |
| 1040 | "bionic/flistxattr.cpp", |
| 1041 | "bionic/flockfile.cpp", |
| 1042 | "bionic/fpclassify.cpp", |
| 1043 | "bionic/fsetxattr.cpp", |
| 1044 | "bionic/ftruncate.cpp", |
Elliott Hughes | 13d79ab | 2016-04-15 17:40:33 -0700 | [diff] [blame] | 1045 | "bionic/ftw.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1046 | "bionic/futimens.cpp", |
| 1047 | "bionic/getcwd.cpp", |
Dan Willemsen | 23aae1c | 2016-03-29 15:21:38 -0700 | [diff] [blame] | 1048 | "bionic/getdomainname.cpp", |
Elliott Hughes | 211c4d3 | 2018-02-02 15:10:32 -0800 | [diff] [blame] | 1049 | "bionic/getentropy.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1050 | "bionic/gethostname.cpp", |
Elliott Hughes | 2d0b28b | 2018-10-23 11:23:00 -0700 | [diff] [blame] | 1051 | "bionic/getloadavg.cpp", |
Elliott Hughes | e4510a2 | 2016-04-06 08:34:58 -0700 | [diff] [blame] | 1052 | "bionic/getpagesize.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1053 | "bionic/getpgrp.cpp", |
| 1054 | "bionic/getpid.cpp", |
Elliott Hughes | 8f0e42f | 2016-11-29 15:10:29 -0800 | [diff] [blame] | 1055 | "bionic/getpriority.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1056 | "bionic/gettid.cpp", |
Elliott Hughes | ce934e3 | 2018-09-06 13:26:08 -0700 | [diff] [blame] | 1057 | "bionic/get_device_api_level.cpp", |
Mark Salyzyn | b38347a | 2016-04-05 09:09:46 -0700 | [diff] [blame] | 1058 | "bionic/grp_pwd.cpp", |
Tom Cherry | 6034ef8 | 2018-02-02 16:10:07 -0800 | [diff] [blame] | 1059 | "bionic/grp_pwd_file.cpp", |
Elliott Hughes | a648733 | 2017-08-15 23:16:48 -0700 | [diff] [blame] | 1060 | "bionic/iconv.cpp", |
Elliott Hughes | c41b560 | 2017-07-27 17:08:08 -0700 | [diff] [blame] | 1061 | "bionic/icu_wrappers.cpp", |
Dan Willemsen | 9b59acc | 2016-01-05 14:32:06 -0800 | [diff] [blame] | 1062 | "bionic/ifaddrs.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1063 | "bionic/inotify_init.cpp", |
Dan Willemsen | dc6b0a7 | 2015-11-09 14:03:46 -0800 | [diff] [blame] | 1064 | "bionic/ioctl.cpp", |
Elliott Hughes | 7532b32 | 2017-07-11 15:00:17 -0700 | [diff] [blame] | 1065 | "bionic/killpg.cpp", |
Elliott Hughes | fc8e688 | 2016-11-18 16:27:29 -0800 | [diff] [blame] | 1066 | "bionic/langinfo.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1067 | "bionic/lchown.cpp", |
| 1068 | "bionic/lfs64_support.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1069 | "bionic/libc_init_common.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1070 | "bionic/libgen.cpp", |
| 1071 | "bionic/link.cpp", |
| 1072 | "bionic/locale.cpp", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 1073 | "bionic/lockf.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1074 | "bionic/lstat.cpp", |
Colin Cross | ee84786 | 2016-04-29 14:06:07 -0700 | [diff] [blame] | 1075 | "bionic/mblen.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1076 | "bionic/mbrtoc16.cpp", |
| 1077 | "bionic/mbrtoc32.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1078 | "bionic/mempcpy.cpp", |
| 1079 | "bionic/mkdir.cpp", |
| 1080 | "bionic/mkfifo.cpp", |
| 1081 | "bionic/mknod.cpp", |
| 1082 | "bionic/mntent.cpp", |
Dan Willemsen | dc6b0a7 | 2015-11-09 14:03:46 -0800 | [diff] [blame] | 1083 | "bionic/mremap.cpp", |
Colin Cross | 8ce38af | 2016-01-19 12:50:20 -0800 | [diff] [blame] | 1084 | "bionic/net_if.cpp", |
Dan Albert | e2fd010 | 2017-07-11 14:27:07 -0700 | [diff] [blame] | 1085 | "bionic/netdb.cpp", |
Dan Willemsen | 3e62171 | 2016-02-03 21:48:08 -0800 | [diff] [blame] | 1086 | "bionic/netinet_in.cpp", |
Elliott Hughes | 6cfb84b | 2016-04-06 17:14:45 -0700 | [diff] [blame] | 1087 | "bionic/nl_types.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1088 | "bionic/open.cpp", |
| 1089 | "bionic/pathconf.cpp", |
| 1090 | "bionic/pause.cpp", |
| 1091 | "bionic/pipe.cpp", |
| 1092 | "bionic/poll.cpp", |
| 1093 | "bionic/posix_fadvise.cpp", |
| 1094 | "bionic/posix_fallocate.cpp", |
| 1095 | "bionic/posix_madvise.cpp", |
| 1096 | "bionic/posix_timers.cpp", |
| 1097 | "bionic/ptrace.cpp", |
| 1098 | "bionic/pty.cpp", |
| 1099 | "bionic/raise.cpp", |
| 1100 | "bionic/rand.cpp", |
| 1101 | "bionic/readlink.cpp", |
Elliott Hughes | 22fb267 | 2019-11-01 08:07:25 -0700 | [diff] [blame] | 1102 | "bionic/realpath.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1103 | "bionic/reboot.cpp", |
| 1104 | "bionic/recv.cpp", |
Josh Gao | 9727192 | 2019-11-06 13:15:00 -0800 | [diff] [blame] | 1105 | "bionic/recvmsg.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1106 | "bionic/rename.cpp", |
| 1107 | "bionic/rmdir.cpp", |
| 1108 | "bionic/scandir.cpp", |
| 1109 | "bionic/sched_getaffinity.cpp", |
| 1110 | "bionic/sched_getcpu.cpp", |
| 1111 | "bionic/semaphore.cpp", |
| 1112 | "bionic/send.cpp", |
| 1113 | "bionic/setegid.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1114 | "bionic/seteuid.cpp", |
| 1115 | "bionic/setpgrp.cpp", |
| 1116 | "bionic/sigaction.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1117 | "bionic/signal.cpp", |
Elliott Hughes | 7ae3912 | 2018-02-26 16:49:43 -0800 | [diff] [blame] | 1118 | "bionic/sigprocmask.cpp", |
Elliott Hughes | ca3f8e4 | 2019-10-28 15:59:38 -0700 | [diff] [blame] | 1119 | "bionic/sleep.cpp", |
Josh Gao | b107eab | 2020-04-29 17:17:56 -0700 | [diff] [blame] | 1120 | "bionic/socketpair.cpp", |
Elliott Hughes | 14e3ff9 | 2017-10-06 16:58:36 -0700 | [diff] [blame] | 1121 | "bionic/spawn.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1122 | "bionic/stat.cpp", |
Dan Albert | e2fd010 | 2017-07-11 14:27:07 -0700 | [diff] [blame] | 1123 | "bionic/stdlib_l.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1124 | "bionic/strerror.cpp", |
Dan Albert | e2fd010 | 2017-07-11 14:27:07 -0700 | [diff] [blame] | 1125 | "bionic/string_l.cpp", |
| 1126 | "bionic/strings_l.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1127 | "bionic/strsignal.cpp", |
Elliott Hughes | 1921dce | 2017-12-19 10:27:27 -0800 | [diff] [blame] | 1128 | "bionic/strtol.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1129 | "bionic/strtold.cpp", |
Elliott Hughes | fa386e0 | 2017-10-18 13:34:32 -0700 | [diff] [blame] | 1130 | "bionic/swab.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1131 | "bionic/symlink.cpp", |
Colin Cross | fc8ed2f | 2016-04-11 14:51:38 -0700 | [diff] [blame] | 1132 | "bionic/sync_file_range.cpp", |
Elliott Hughes | 5905d6f | 2018-01-30 15:09:51 -0800 | [diff] [blame] | 1133 | "bionic/sys_epoll.cpp", |
Elliott Hughes | 7c59f3f | 2016-08-16 18:14:26 -0700 | [diff] [blame] | 1134 | "bionic/sys_msg.cpp", |
| 1135 | "bionic/sys_sem.cpp", |
| 1136 | "bionic/sys_shm.cpp", |
Elliott Hughes | 6dafb4a | 2018-01-26 17:47:56 -0800 | [diff] [blame] | 1137 | "bionic/sys_signalfd.cpp", |
Elliott Hughes | 261bd74 | 2019-08-29 20:45:14 -0700 | [diff] [blame] | 1138 | "bionic/sys_statfs.cpp", |
| 1139 | "bionic/sys_statvfs.cpp", |
Elliott Hughes | 449eff0 | 2016-06-08 19:51:20 -0700 | [diff] [blame] | 1140 | "bionic/sys_time.cpp", |
Dan Albert | e2fd010 | 2017-07-11 14:27:07 -0700 | [diff] [blame] | 1141 | "bionic/sysinfo.cpp", |
| 1142 | "bionic/syslog.cpp", |
Elliott Hughes | 71ba589 | 2018-02-07 12:44:45 -0800 | [diff] [blame] | 1143 | "bionic/system.cpp", |
Tom Cherry | e275d6d | 2017-12-11 23:31:33 -0800 | [diff] [blame] | 1144 | "bionic/system_property_api.cpp", |
| 1145 | "bionic/system_property_set.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1146 | "bionic/tdestroy.cpp", |
| 1147 | "bionic/termios.cpp", |
| 1148 | "bionic/thread_private.cpp", |
Elliott Hughes | 4206711 | 2019-04-18 14:27:24 -0700 | [diff] [blame] | 1149 | "bionic/threads.cpp", |
Elliott Hughes | f98d87b | 2018-07-17 13:21:05 -0700 | [diff] [blame] | 1150 | "bionic/timespec_get.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1151 | "bionic/tmpfile.cpp", |
| 1152 | "bionic/umount.cpp", |
| 1153 | "bionic/unlink.cpp", |
Elliott Hughes | ca3f8e4 | 2019-10-28 15:59:38 -0700 | [diff] [blame] | 1154 | "bionic/usleep.cpp", |
Elliott Hughes | 9a1d397 | 2020-08-07 15:55:02 -0700 | [diff] [blame] | 1155 | "bionic/utmp.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1156 | "bionic/wait.cpp", |
| 1157 | "bionic/wchar.cpp", |
Dan Albert | e2fd010 | 2017-07-11 14:27:07 -0700 | [diff] [blame] | 1158 | "bionic/wchar_l.cpp", |
Elliott Hughes | 7f0849f | 2016-08-26 16:17:17 -0700 | [diff] [blame] | 1159 | "bionic/wcstod.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1160 | "bionic/wctype.cpp", |
Elliott Hughes | c41b560 | 2017-07-27 17:08:08 -0700 | [diff] [blame] | 1161 | "bionic/wcwidth.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1162 | "bionic/wmempcpy.cpp", |
Josh Gao | 0e0e370 | 2017-10-12 13:34:42 -0700 | [diff] [blame] | 1163 | |
| 1164 | // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp, |
| 1165 | // which will be overridden by the actual one in libc.so. |
| 1166 | "bionic/icu_static.cpp", |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1167 | ], |
Dan Willemsen | 268a673 | 2015-10-15 14:49:45 -0700 | [diff] [blame] | 1168 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1169 | multilib: { |
| 1170 | lib32: { |
| 1171 | // LP32 cruft |
Colin Cross | 6ab8f89 | 2015-11-23 14:12:15 -0800 | [diff] [blame] | 1172 | srcs: ["bionic/mmap.cpp"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1173 | }, |
| 1174 | }, |
Jayant Chowdhary | ab2f79c | 2017-09-01 16:29:44 -0700 | [diff] [blame] | 1175 | product_variables: { |
Steven Moreland | 96bbc5c | 2017-12-13 14:11:26 -0800 | [diff] [blame] | 1176 | treble_linker_namespaces: { |
| 1177 | cflags: ["-DTREBLE_LINKER_NAMESPACES"], |
Jayant Chowdhary | ab2f79c | 2017-09-01 16:29:44 -0700 | [diff] [blame] | 1178 | }, |
| 1179 | }, |
Bowgo Tsai | a9208f3 | 2020-07-24 17:29:52 +0800 | [diff] [blame] | 1180 | whole_static_libs: [ |
| 1181 | "libc_bionic_systrace", |
| 1182 | "libsystemproperties", |
| 1183 | ], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1184 | cppflags: ["-Wold-style-cast"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1185 | local_include_dirs: ["stdio"], |
| 1186 | include_dirs: ["bionic/libstdc++/include"], |
| 1187 | name: "libc_bionic_ndk", |
Elliott Hughes | 3f6eee9 | 2016-12-13 23:47:25 +0000 | [diff] [blame] | 1188 | generated_headers: ["generated_android_ids"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1189 | } |
| 1190 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1191 | // ======================================================== |
Bowgo Tsai | a9208f3 | 2020-07-24 17:29:52 +0800 | [diff] [blame] | 1192 | // libc_bionic_systrace.a |
| 1193 | // ======================================================== |
| 1194 | |
| 1195 | cc_library_static { |
| 1196 | name: "libc_bionic_systrace", |
| 1197 | defaults: ["libc_defaults"], |
| 1198 | srcs: [ |
| 1199 | "bionic/bionic_systrace.cpp", |
| 1200 | ], |
| 1201 | apex_available: [ |
| 1202 | "com.android.runtime", |
| 1203 | ], |
| 1204 | } |
| 1205 | |
| 1206 | // ======================================================== |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1207 | // libc_pthread.a - pthreads parts that previously lived in |
| 1208 | // libc_bionic.a. Relocated to their own library because |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 1209 | // they can't be included in libc_ndk.a (as the layout of |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1210 | // pthread_t has changed over the years and has ABI |
| 1211 | // compatibility issues). |
| 1212 | // ======================================================== |
| 1213 | |
| 1214 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1215 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1216 | srcs: [ |
Ryan Prichard | 45d1349 | 2019-01-03 02:51:30 -0800 | [diff] [blame] | 1217 | "bionic/bionic_elf_tls.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1218 | "bionic/pthread_atfork.cpp", |
| 1219 | "bionic/pthread_attr.cpp", |
Colin Cross | a35d23d | 2015-11-19 13:32:49 -0800 | [diff] [blame] | 1220 | "bionic/pthread_barrier.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1221 | "bionic/pthread_cond.cpp", |
| 1222 | "bionic/pthread_create.cpp", |
| 1223 | "bionic/pthread_detach.cpp", |
| 1224 | "bionic/pthread_equal.cpp", |
| 1225 | "bionic/pthread_exit.cpp", |
| 1226 | "bionic/pthread_getcpuclockid.cpp", |
| 1227 | "bionic/pthread_getschedparam.cpp", |
| 1228 | "bionic/pthread_gettid_np.cpp", |
Elliott Hughes | 7484c21 | 2017-02-02 02:41:38 +0000 | [diff] [blame] | 1229 | "bionic/pthread_internal.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1230 | "bionic/pthread_join.cpp", |
| 1231 | "bionic/pthread_key.cpp", |
| 1232 | "bionic/pthread_kill.cpp", |
| 1233 | "bionic/pthread_mutex.cpp", |
| 1234 | "bionic/pthread_once.cpp", |
| 1235 | "bionic/pthread_rwlock.cpp", |
Josh Gao | 726b63f | 2018-08-27 16:00:58 -0700 | [diff] [blame] | 1236 | "bionic/pthread_sigqueue.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1237 | "bionic/pthread_self.cpp", |
| 1238 | "bionic/pthread_setname_np.cpp", |
| 1239 | "bionic/pthread_setschedparam.cpp", |
Colin Cross | a35d23d | 2015-11-19 13:32:49 -0800 | [diff] [blame] | 1240 | "bionic/pthread_spinlock.cpp", |
Josh Gao | 0e0e370 | 2017-10-12 13:34:42 -0700 | [diff] [blame] | 1241 | |
| 1242 | // The following implementations depend on pthread data or implementation, |
| 1243 | // so we can't include them in libc_ndk.a. |
| 1244 | "bionic/__cxa_thread_atexit_impl.cpp", |
Peter Collingbourne | 5f45c18 | 2020-01-14 17:59:41 -0800 | [diff] [blame] | 1245 | "bionic/android_unsafe_frame_pointer_chase.cpp", |
Ryan Prichard | afa983c | 2020-02-04 15:46:15 -0800 | [diff] [blame] | 1246 | "bionic/atexit.cpp", |
Josh Gao | 0e0e370 | 2017-10-12 13:34:42 -0700 | [diff] [blame] | 1247 | "bionic/fork.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1248 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1249 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1250 | cppflags: ["-Wold-style-cast"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1251 | include_dirs: ["bionic/libstdc++/include"], |
Peter Collingbourne | 5f45c18 | 2020-01-14 17:59:41 -0800 | [diff] [blame] | 1252 | header_libs: ["bionic_libc_platform_headers"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1253 | name: "libc_pthread", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1254 | } |
| 1255 | |
| 1256 | // ======================================================== |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1257 | // libc_syscalls.a |
| 1258 | // ======================================================== |
| 1259 | |
Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1260 | genrule { |
| 1261 | name: "syscalls-arm.S", |
| 1262 | out: ["syscalls-arm.S"], |
| 1263 | srcs: ["SYSCALLS.TXT"], |
| 1264 | tool_files: [":bionic-gensyscalls"], |
| 1265 | cmd: "$(location :bionic-gensyscalls) arm $(in) > $(out)", |
| 1266 | } |
| 1267 | |
| 1268 | genrule { |
| 1269 | name: "syscalls-arm64.S", |
| 1270 | out: ["syscalls-arm64.S"], |
| 1271 | srcs: ["SYSCALLS.TXT"], |
| 1272 | tool_files: [":bionic-gensyscalls"], |
| 1273 | cmd: "$(location :bionic-gensyscalls) arm64 $(in) > $(out)", |
| 1274 | } |
| 1275 | |
| 1276 | genrule { |
| 1277 | name: "syscalls-x86.S", |
| 1278 | out: ["syscalls-x86.S"], |
| 1279 | srcs: ["SYSCALLS.TXT"], |
| 1280 | tool_files: [":bionic-gensyscalls"], |
| 1281 | cmd: "$(location :bionic-gensyscalls) x86 $(in) > $(out)", |
| 1282 | } |
| 1283 | |
| 1284 | genrule { |
| 1285 | name: "syscalls-x86_64.S", |
| 1286 | out: ["syscalls-x86_64.S"], |
| 1287 | srcs: ["SYSCALLS.TXT"], |
| 1288 | tool_files: [":bionic-gensyscalls"], |
| 1289 | cmd: "$(location :bionic-gensyscalls) x86_64 $(in) > $(out)", |
| 1290 | } |
| 1291 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1292 | cc_library_static { |
Colin Cross | 27c43c5 | 2016-04-07 13:27:24 -0700 | [diff] [blame] | 1293 | defaults: ["libc_defaults"], |
Josh Gao | 0e0e370 | 2017-10-12 13:34:42 -0700 | [diff] [blame] | 1294 | srcs: ["bionic/__set_errno.cpp"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1295 | arch: { |
| 1296 | arm: { |
Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1297 | srcs: [":syscalls-arm.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1298 | }, |
| 1299 | arm64: { |
Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1300 | srcs: [":syscalls-arm64.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1301 | }, |
| 1302 | x86: { |
Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1303 | srcs: [":syscalls-x86.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1304 | }, |
| 1305 | x86_64: { |
Elliott Hughes | 782c485 | 2019-04-16 12:31:00 -0700 | [diff] [blame] | 1306 | srcs: [":syscalls-x86_64.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1307 | }, |
| 1308 | }, |
| 1309 | name: "libc_syscalls", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1310 | } |
| 1311 | |
| 1312 | // ======================================================== |
| 1313 | // libc_aeabi.a |
| 1314 | // This is an LP32 ARM-only library that needs to be built with -fno-builtin |
| 1315 | // to avoid infinite recursion. For the other architectures we just build an |
| 1316 | // empty library to keep this makefile simple. |
| 1317 | // ======================================================== |
| 1318 | |
| 1319 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1320 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1321 | arch: { |
| 1322 | arm: { |
| 1323 | srcs: ["arch-arm/bionic/__aeabi.c"], |
| 1324 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1325 | }, |
| 1326 | name: "libc_aeabi", |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1327 | cflags: ["-fno-builtin"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1328 | } |
| 1329 | |
| 1330 | // ======================================================== |
| 1331 | // libc_ndk.a |
| 1332 | // Compatibility library for the NDK. This library contains |
| 1333 | // all the parts of libc that are safe to statically link. |
| 1334 | // We can't safely statically link things that can only run |
| 1335 | // on a certain version of the OS. Examples include |
| 1336 | // anything that talks to netd (a large portion of the DNS |
| 1337 | // code) and anything that is dependent on the layout of a |
| 1338 | // data structure that has changed across releases (such as |
| 1339 | // pthread_t). |
| 1340 | // ======================================================== |
| 1341 | |
| 1342 | cc_library_static { |
| 1343 | name: "libc_ndk", |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 1344 | defaults: [ |
| 1345 | "libc_defaults", |
| 1346 | "libc_native_allocator_defaults", |
| 1347 | ], |
Yifan Hong | 5a39cee | 2020-01-21 16:43:56 -0800 | [diff] [blame] | 1348 | ramdisk_available: false, |
Christopher Ferris | e4cdbc4 | 2019-02-08 17:30:58 -0800 | [diff] [blame] | 1349 | srcs: libc_common_src_files + [ |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1350 | "bionic/gwp_asan_wrappers.cpp", |
Peter Collingbourne | 1e110fb | 2020-01-09 10:48:22 -0800 | [diff] [blame] | 1351 | "bionic/heap_tagging.cpp", |
Christopher Ferris | e4cdbc4 | 2019-02-08 17:30:58 -0800 | [diff] [blame] | 1352 | "bionic/malloc_common.cpp", |
Christopher Ferris | 1fc5ccf | 2019-02-15 18:06:15 -0800 | [diff] [blame] | 1353 | "bionic/malloc_limit.cpp", |
Christopher Ferris | e4cdbc4 | 2019-02-08 17:30:58 -0800 | [diff] [blame] | 1354 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1355 | multilib: { |
| 1356 | lib32: { |
| 1357 | srcs: libc_common_src_files_32, |
| 1358 | }, |
| 1359 | }, |
| 1360 | arch: { |
| 1361 | arm: { |
| 1362 | srcs: [ |
| 1363 | "arch-arm/bionic/exidx_dynamic.c", |
| 1364 | "arch-common/bionic/crtbegin_so.c", |
| 1365 | "arch-arm/bionic/atexit_legacy.c", |
| 1366 | "arch-common/bionic/crtend_so.S", |
| 1367 | ], |
| 1368 | whole_static_libs: ["libc_aeabi"], |
| 1369 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1370 | }, |
| 1371 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1372 | cflags: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1373 | "-fvisibility=hidden", |
| 1374 | "-DLIBC_STATIC", |
| 1375 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1376 | |
| 1377 | whole_static_libs: [ |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1378 | "gwp_asan", |
Peter Collingbourne | 337a5b3 | 2020-02-21 12:11:02 -0800 | [diff] [blame] | 1379 | "libarm-optimized-routines-string", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1380 | "libc_bionic_ndk", |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1381 | "libc_bootstrap", |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 1382 | "libc_fortify", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1383 | "libc_freebsd", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 1384 | "libc_freebsd_large_stack", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1385 | "libc_gdtoa", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1386 | "libc_netbsd", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 1387 | "libc_openbsd_large_stack", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1388 | "libc_openbsd_ndk", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1389 | "libc_syscalls", |
| 1390 | "libc_tzcode", |
| 1391 | "libm", |
Elliott Hughes | 816fab9 | 2016-05-27 17:57:46 -0700 | [diff] [blame] | 1392 | "libstdc++", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1393 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1394 | } |
| 1395 | |
| 1396 | // ======================================================== |
Josh Gao | 0e0e370 | 2017-10-12 13:34:42 -0700 | [diff] [blame] | 1397 | // libc_nopthread.a |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1398 | // ======================================================== |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1399 | cc_library_static { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1400 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1401 | srcs: libc_common_src_files, |
| 1402 | multilib: { |
| 1403 | lib32: { |
| 1404 | srcs: libc_common_src_files_32, |
| 1405 | }, |
| 1406 | }, |
Josh Gao | 0e0e370 | 2017-10-12 13:34:42 -0700 | [diff] [blame] | 1407 | name: "libc_nopthread", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1408 | |
| 1409 | whole_static_libs: [ |
Peter Collingbourne | 337a5b3 | 2020-02-21 12:11:02 -0800 | [diff] [blame] | 1410 | "libarm-optimized-routines-string", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1411 | "libc_bionic", |
| 1412 | "libc_bionic_ndk", |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1413 | "libc_bootstrap", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1414 | "libc_dns", |
George Burgess IV | 6cb0687 | 2017-07-21 13:28:42 -0700 | [diff] [blame] | 1415 | "libc_fortify", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1416 | "libc_freebsd", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 1417 | "libc_freebsd_large_stack", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1418 | "libc_gdtoa", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1419 | "libc_netbsd", |
| 1420 | "libc_openbsd", |
Elliott Hughes | 8e547bd | 2016-08-16 15:57:47 -0700 | [diff] [blame] | 1421 | "libc_openbsd_large_stack", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1422 | "libc_openbsd_ndk", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1423 | "libc_syscalls", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1424 | "libc_tzcode", |
Elliott Hughes | 816fab9 | 2016-05-27 17:57:46 -0700 | [diff] [blame] | 1425 | "libstdc++", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1426 | ], |
| 1427 | |
| 1428 | arch: { |
| 1429 | arm: { |
| 1430 | whole_static_libs: ["libc_aeabi"], |
| 1431 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1432 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1433 | } |
| 1434 | |
| 1435 | // ======================================================== |
Josh Gao | 0e0e370 | 2017-10-12 13:34:42 -0700 | [diff] [blame] | 1436 | // libc_common.a |
| 1437 | // ======================================================== |
| 1438 | |
| 1439 | cc_library_static { |
| 1440 | defaults: ["libc_defaults"], |
| 1441 | name: "libc_common", |
| 1442 | |
| 1443 | whole_static_libs: [ |
| 1444 | "libc_nopthread", |
| 1445 | "libc_pthread", |
| 1446 | ], |
| 1447 | } |
| 1448 | |
| 1449 | // ======================================================== |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1450 | // libc_static_dispatch.a |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1451 | // ======================================================== |
| 1452 | cc_library_static { |
| 1453 | defaults: ["libc_defaults"], |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1454 | name: "libc_static_dispatch", |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1455 | |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1456 | arch: { |
| 1457 | x86: { |
| 1458 | srcs: ["arch-x86/static_function_dispatch.S"], |
| 1459 | }, |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1460 | arm: { |
| 1461 | srcs: ["arch-arm/static_function_dispatch.S"], |
| 1462 | }, |
Peter Collingbourne | 900d07d | 2019-10-28 13:11:00 -0700 | [diff] [blame] | 1463 | arm64: { |
| 1464 | srcs: ["arch-arm64/static_function_dispatch.S"], |
| 1465 | }, |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1466 | }, |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1467 | } |
| 1468 | |
| 1469 | // ======================================================== |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1470 | // libc_dynamic_dispatch.a |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1471 | // ======================================================== |
| 1472 | cc_library_static { |
| 1473 | defaults: ["libc_defaults"], |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1474 | name: "libc_dynamic_dispatch", |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1475 | |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1476 | cflags: [ |
Peter Collingbourne | 36a5644 | 2019-10-31 17:11:54 -0700 | [diff] [blame] | 1477 | "-ffreestanding", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1478 | "-fno-stack-protector", |
| 1479 | "-fno-jump-tables", |
| 1480 | ], |
| 1481 | arch: { |
| 1482 | x86: { |
| 1483 | srcs: ["arch-x86/dynamic_function_dispatch.cpp"], |
| 1484 | }, |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1485 | arm: { |
Elliott Hughes | 927fe99 | 2019-01-31 22:29:22 +0000 | [diff] [blame] | 1486 | srcs: ["arch-arm/dynamic_function_dispatch.cpp"], |
Haibo Huang | ea9957a | 2018-11-19 11:00:32 -0800 | [diff] [blame] | 1487 | }, |
Peter Collingbourne | 900d07d | 2019-10-28 13:11:00 -0700 | [diff] [blame] | 1488 | arm64: { |
| 1489 | srcs: ["arch-arm64/dynamic_function_dispatch.cpp"], |
| 1490 | }, |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1491 | }, |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1492 | } |
| 1493 | |
| 1494 | // ======================================================== |
| 1495 | // libc_common_static.a For static binaries. |
| 1496 | // ======================================================== |
| 1497 | cc_library_static { |
| 1498 | defaults: ["libc_defaults"], |
| 1499 | name: "libc_common_static", |
Haibo Huang | b9244ff | 2018-08-11 10:12:13 -0700 | [diff] [blame] | 1500 | |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1501 | whole_static_libs: [ |
| 1502 | "libc_common", |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1503 | "libc_static_dispatch", |
| 1504 | ], |
| 1505 | } |
| 1506 | |
| 1507 | // ======================================================== |
| 1508 | // libc_common_shared.a For shared libraries. |
| 1509 | // ======================================================== |
| 1510 | cc_library_static { |
| 1511 | defaults: ["libc_defaults"], |
| 1512 | name: "libc_common_shared", |
| 1513 | |
| 1514 | whole_static_libs: [ |
| 1515 | "libc_common", |
| 1516 | "libc_dynamic_dispatch", |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1517 | ], |
| 1518 | } |
| 1519 | |
Ryan Prichard | 22a6a05 | 2019-10-10 23:59:30 -0700 | [diff] [blame] | 1520 | // Versions of dl_iterate_phdr and similar APIs used to lookup unwinding information in a static |
| 1521 | // executable. |
| 1522 | cc_library_static { |
| 1523 | name: "libc_unwind_static", |
| 1524 | defaults: ["libc_defaults"], |
| 1525 | cflags: ["-DLIBC_STATIC"], |
| 1526 | |
| 1527 | srcs: ["bionic/dl_iterate_phdr_static.cpp"], |
| 1528 | arch: { |
| 1529 | // arm32-specific dl_unwind_find_exidx and __gnu_Unwind_Find_exidx APIs |
| 1530 | arm: { |
| 1531 | srcs: ["arch-arm/bionic/exidx_static.c"], |
| 1532 | }, |
| 1533 | }, |
| 1534 | } |
| 1535 | |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1536 | // ======================================================== |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1537 | // libc_nomalloc.a |
| 1538 | // ======================================================== |
| 1539 | // |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1540 | // This is a version of the static C library used by the dynamic linker that exclude malloc. It also |
| 1541 | // excludes functions selected using ifunc's (e.g. for string.h). Link in either |
| 1542 | // libc_static_dispatch or libc_dynamic_dispatch to provide those functions. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1543 | |
| 1544 | cc_library_static { |
Dimitry Ivanov | fc0d480 | 2016-12-06 11:10:09 -0800 | [diff] [blame] | 1545 | name: "libc_nomalloc", |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1546 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1547 | |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 1548 | whole_static_libs: [ |
Ryan Prichard | 249757b | 2019-11-01 17:18:28 -0700 | [diff] [blame] | 1549 | "libc_common", |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 1550 | "libc_init_static", |
Ryan Prichard | 22a6a05 | 2019-10-10 23:59:30 -0700 | [diff] [blame] | 1551 | "libc_unwind_static", |
Colin Cross | a3f9fca | 2016-01-11 13:20:55 -0800 | [diff] [blame] | 1552 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1553 | } |
| 1554 | |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1555 | filegroup { |
| 1556 | name: "libc_sources_shared", |
| 1557 | srcs: [ |
| 1558 | "arch-common/bionic/crtbegin_so.c", |
| 1559 | "arch-common/bionic/crtbrand.S", |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1560 | "bionic/gwp_asan_wrappers.cpp", |
Peter Collingbourne | 1e110fb | 2020-01-09 10:48:22 -0800 | [diff] [blame] | 1561 | "bionic/heap_tagging.cpp", |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1562 | "bionic/icu.cpp", |
| 1563 | "bionic/malloc_common.cpp", |
Christopher Ferris | e4cdbc4 | 2019-02-08 17:30:58 -0800 | [diff] [blame] | 1564 | "bionic/malloc_common_dynamic.cpp", |
Ryan Savitski | 175c886 | 2020-01-02 19:54:57 +0000 | [diff] [blame] | 1565 | "bionic/android_profiling_dynamic.cpp", |
Christopher Ferris | e4cdbc4 | 2019-02-08 17:30:58 -0800 | [diff] [blame] | 1566 | "bionic/malloc_heapprofd.cpp", |
Christopher Ferris | 1fc5ccf | 2019-02-15 18:06:15 -0800 | [diff] [blame] | 1567 | "bionic/malloc_limit.cpp", |
Peter Collingbourne | 570de33 | 2019-12-11 10:00:58 -0800 | [diff] [blame] | 1568 | "bionic/ndk_cruft.cpp", |
| 1569 | "bionic/ndk_cruft_data.cpp", |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1570 | "bionic/NetdClient.cpp", |
| 1571 | "arch-common/bionic/crtend_so.S", |
| 1572 | ], |
| 1573 | } |
| 1574 | |
| 1575 | filegroup { |
| 1576 | name: "libc_sources_static", |
| 1577 | srcs: [ |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1578 | "bionic/gwp_asan_wrappers.cpp", |
Peter Collingbourne | 1e110fb | 2020-01-09 10:48:22 -0800 | [diff] [blame] | 1579 | "bionic/heap_tagging.cpp", |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1580 | "bionic/malloc_common.cpp", |
Christopher Ferris | 1fc5ccf | 2019-02-15 18:06:15 -0800 | [diff] [blame] | 1581 | "bionic/malloc_limit.cpp", |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1582 | ], |
| 1583 | } |
| 1584 | |
| 1585 | filegroup { |
| 1586 | name: "libc_sources_shared_arm", |
| 1587 | srcs: [ |
| 1588 | "arch-arm/bionic/exidx_dynamic.c", |
| 1589 | "arch-arm/bionic/atexit_legacy.c", |
| 1590 | ], |
| 1591 | } |
| 1592 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1593 | // ======================================================== |
| 1594 | // libc.a + libc.so |
| 1595 | // ======================================================== |
| 1596 | cc_library { |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 1597 | defaults: [ |
| 1598 | "libc_defaults", |
| 1599 | "libc_native_allocator_defaults", |
| 1600 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1601 | name: "libc", |
Dan Albert | 40f15ec | 2017-10-27 11:21:20 -0700 | [diff] [blame] | 1602 | static_ndk_lib: true, |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1603 | product_variables: { |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1604 | platform_sdk_version: { |
| 1605 | asflags: ["-DPLATFORM_SDK_VERSION=%d"], |
| 1606 | }, |
| 1607 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1608 | static: { |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1609 | srcs: [ ":libc_sources_static" ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1610 | cflags: ["-DLIBC_STATIC"], |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1611 | whole_static_libs: [ |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1612 | "gwp_asan", |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1613 | "libc_init_static", |
| 1614 | "libc_common_static", |
Ryan Prichard | 22a6a05 | 2019-10-10 23:59:30 -0700 | [diff] [blame] | 1615 | "libc_unwind_static", |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1616 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1617 | }, |
| 1618 | shared: { |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1619 | srcs: [ ":libc_sources_shared" ], |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1620 | whole_static_libs: [ |
Mitch Phillips | f3968e8 | 2020-01-31 19:57:04 -0800 | [diff] [blame] | 1621 | "gwp_asan", |
Haibo Huang | f71edfa | 2018-11-12 10:06:56 -0800 | [diff] [blame] | 1622 | "libc_init_dynamic", |
| 1623 | "libc_common_shared", |
| 1624 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1625 | }, |
| 1626 | |
Neil Fuller | a7db90f | 2019-04-25 09:28:27 +0100 | [diff] [blame] | 1627 | required: [ |
| 1628 | "tzdata", |
| 1629 | "tz_version", // Version metadata for tzdata to help debugging. |
| 1630 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1631 | |
Colin Cross | 4ce94d2 | 2016-11-15 13:15:43 -0800 | [diff] [blame] | 1632 | // Do not pack libc.so relocations; see http://b/20645321 for details. |
| 1633 | pack_relocations: false, |
| 1634 | |
dimitry | 06016f2 | 2018-01-05 11:39:28 +0100 | [diff] [blame] | 1635 | // WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so! |
| 1636 | // If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the |
| 1637 | // LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into |
| 1638 | // those new libraries from libgcc.a are not declared external; if that were the case, |
| 1639 | // then libc would not pull those symbols from libgcc.a as it should, instead relying |
| 1640 | // on the external symbols from the dependent libraries. That would create a "cloaked" |
| 1641 | // dependency on libgcc.a in libc though the libraries, which is not what you wanted! |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1642 | |
dimitry | 06016f2 | 2018-01-05 11:39:28 +0100 | [diff] [blame] | 1643 | shared_libs: [ |
| 1644 | "ld-android", |
| 1645 | "libdl", |
| 1646 | ], |
Jiyong Park | 3ff116a | 2019-04-02 23:04:52 +0900 | [diff] [blame] | 1647 | static_libs: [ |
| 1648 | "libdl_android", |
| 1649 | ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1650 | |
| 1651 | nocrt: true, |
| 1652 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1653 | arch: { |
| 1654 | arm: { |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1655 | // TODO: This is to work around b/24465209. Remove after root cause is fixed. |
Chih-Hung Hsieh | ecbff83 | 2018-05-23 18:45:53 -0700 | [diff] [blame] | 1656 | pack_relocations: false, |
Ian Pedowitz | b6310c2 | 2018-01-18 16:26:19 -0800 | [diff] [blame] | 1657 | ldflags: ["-Wl,--hash-style=both"], |
| 1658 | |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1659 | version_script: ":libc.arm.map", |
Dan Willemsen | 9e6f98f | 2015-11-03 14:30:57 -0800 | [diff] [blame] | 1660 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1661 | shared: { |
dimitry | c0c0ef6 | 2018-12-05 16:33:52 +0100 | [diff] [blame] | 1662 | srcs: [":libc_sources_shared_arm"], |
Dan Willemsen | 0c65708 | 2016-05-12 01:43:07 -0700 | [diff] [blame] | 1663 | // special for arm |
| 1664 | cflags: ["-DCRT_LEGACY_WORKAROUND"], |
Ryan Prichard | 379e05f | 2020-04-01 20:10:07 -0700 | [diff] [blame] | 1665 | |
| 1666 | whole_static_libs: [ "libunwind_llvm" ], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1667 | }, |
Christopher Ferris | 0c0f6fb | 2019-05-17 16:22:56 -0700 | [diff] [blame] | 1668 | |
| 1669 | // Arm 32 bit does not produce complete exidx unwind information |
| 1670 | // so keep the .debug_frame which is relatively small and does |
| 1671 | // include needed unwind information. |
| 1672 | // See b/132992102 for details. |
| 1673 | strip: { |
| 1674 | keep_symbols_and_debug_frame: true, |
| 1675 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1676 | }, |
Dan Willemsen | 9e6f98f | 2015-11-03 14:30:57 -0800 | [diff] [blame] | 1677 | arm64: { |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1678 | version_script: ":libc.arm64.map", |
Christopher Ferris | 0c0f6fb | 2019-05-17 16:22:56 -0700 | [diff] [blame] | 1679 | |
| 1680 | // Leave the symbols in the shared library so that stack unwinders can produce |
| 1681 | // meaningful name resolution. |
| 1682 | strip: { |
| 1683 | keep_symbols: true, |
| 1684 | }, |
Peter Collingbourne | f2b1e03 | 2019-12-10 17:41:16 -0800 | [diff] [blame] | 1685 | |
Ryan Prichard | 379e05f | 2020-04-01 20:10:07 -0700 | [diff] [blame] | 1686 | shared: { |
| 1687 | whole_static_libs: [ "libgcc_stripped" ], |
| 1688 | }, |
Dan Willemsen | 9e6f98f | 2015-11-03 14:30:57 -0800 | [diff] [blame] | 1689 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1690 | x86: { |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1691 | // TODO: This is to work around b/24465209. Remove after root cause is fixed. |
Chih-Hung Hsieh | ecbff83 | 2018-05-23 18:45:53 -0700 | [diff] [blame] | 1692 | pack_relocations: false, |
Ian Pedowitz | b6310c2 | 2018-01-18 16:26:19 -0800 | [diff] [blame] | 1693 | ldflags: ["-Wl,--hash-style=both"], |
| 1694 | |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1695 | version_script: ":libc.x86.map", |
Christopher Ferris | 0c0f6fb | 2019-05-17 16:22:56 -0700 | [diff] [blame] | 1696 | |
| 1697 | // Leave the symbols in the shared library so that stack unwinders can produce |
| 1698 | // meaningful name resolution. |
| 1699 | strip: { |
| 1700 | keep_symbols: true, |
| 1701 | }, |
Peter Collingbourne | f2b1e03 | 2019-12-10 17:41:16 -0800 | [diff] [blame] | 1702 | |
Ryan Prichard | 379e05f | 2020-04-01 20:10:07 -0700 | [diff] [blame] | 1703 | shared: { |
| 1704 | whole_static_libs: [ "libgcc_stripped" ], |
| 1705 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1706 | }, |
| 1707 | x86_64: { |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1708 | version_script: ":libc.x86_64.map", |
Christopher Ferris | 0c0f6fb | 2019-05-17 16:22:56 -0700 | [diff] [blame] | 1709 | |
| 1710 | // Leave the symbols in the shared library so that stack unwinders can produce |
| 1711 | // meaningful name resolution. |
| 1712 | strip: { |
| 1713 | keep_symbols: true, |
| 1714 | }, |
Peter Collingbourne | f2b1e03 | 2019-12-10 17:41:16 -0800 | [diff] [blame] | 1715 | |
Ryan Prichard | 379e05f | 2020-04-01 20:10:07 -0700 | [diff] [blame] | 1716 | shared: { |
| 1717 | whole_static_libs: [ "libgcc_stripped" ], |
| 1718 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1719 | }, |
| 1720 | }, |
Jiyong Park | c45fe9f | 2018-12-13 18:26:48 +0900 | [diff] [blame] | 1721 | |
| 1722 | stubs: { |
| 1723 | symbol_file: "libc.map.txt", |
Jooyung Han | 26ddc4d | 2020-02-27 18:33:25 +0900 | [diff] [blame] | 1724 | versions: [ |
| 1725 | "29", |
Jooyung Han | dbfa074 | 2020-03-30 13:18:44 +0900 | [diff] [blame] | 1726 | "R", |
Jooyung Han | 26ddc4d | 2020-02-27 18:33:25 +0900 | [diff] [blame] | 1727 | "10000", |
| 1728 | ], |
Jiyong Park | c45fe9f | 2018-12-13 18:26:48 +0900 | [diff] [blame] | 1729 | }, |
Vic Yang | 6903fb8 | 2019-01-14 11:34:39 -0800 | [diff] [blame] | 1730 | |
Jiyong Park | e87e0dc | 2019-10-02 17:09:33 +0900 | [diff] [blame] | 1731 | apex_available: [ |
| 1732 | "//apex_available:platform", |
| 1733 | "com.android.runtime", |
| 1734 | ], |
| 1735 | |
Vic Yang | 03ff436 | 2019-06-24 16:11:37 -0700 | [diff] [blame] | 1736 | // Sorting bss symbols by size usually results in less dirty pages at run |
| 1737 | // time, because small symbols are grouped together. |
| 1738 | sort_bss_symbols_by_size: true, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1739 | } |
| 1740 | |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1741 | genrule { |
| 1742 | name: "libc.arm.map", |
| 1743 | out: ["libc.arm.map"], |
| 1744 | srcs: ["libc.map.txt"], |
| 1745 | tool_files: [":bionic-generate-version-script"], |
| 1746 | cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)", |
| 1747 | } |
| 1748 | |
| 1749 | genrule { |
| 1750 | name: "libc.arm64.map", |
| 1751 | out: ["libc.arm64.map"], |
| 1752 | srcs: ["libc.map.txt"], |
| 1753 | tool_files: [":bionic-generate-version-script"], |
| 1754 | cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)", |
| 1755 | } |
| 1756 | |
| 1757 | genrule { |
| 1758 | name: "libc.x86.map", |
| 1759 | out: ["libc.x86.map"], |
| 1760 | srcs: ["libc.map.txt"], |
| 1761 | tool_files: [":bionic-generate-version-script"], |
| 1762 | cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)", |
| 1763 | } |
| 1764 | |
| 1765 | genrule { |
| 1766 | name: "libc.x86_64.map", |
| 1767 | out: ["libc.x86_64.map"], |
| 1768 | srcs: ["libc.map.txt"], |
| 1769 | tool_files: [":bionic-generate-version-script"], |
| 1770 | cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)", |
| 1771 | } |
| 1772 | |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1773 | // Headers that only other parts of the platform can include. |
| 1774 | cc_library_headers { |
| 1775 | name: "bionic_libc_platform_headers", |
Martin Stjernholm | a276343 | 2020-04-23 16:47:19 +0100 | [diff] [blame] | 1776 | defaults: ["linux_bionic_supported"], |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1777 | visibility: [ |
Christopher Ferris | c5d3a43 | 2019-09-25 17:50:36 -0700 | [diff] [blame] | 1778 | "//art:__subpackages__", |
Josh Gao | 9727192 | 2019-11-06 13:15:00 -0800 | [diff] [blame] | 1779 | "//bionic:__subpackages__", |
Christopher Ferris | c5d3a43 | 2019-09-25 17:50:36 -0700 | [diff] [blame] | 1780 | "//frameworks:__subpackages__", |
Roman Kiryanov | 067f518 | 2020-05-07 14:58:30 -0700 | [diff] [blame] | 1781 | "//device/generic/goldfish-opengl:__subpackages__", |
Mitch Phillips | 3309b3d | 2020-03-25 15:05:48 -0700 | [diff] [blame] | 1782 | "//external/gwp_asan:__subpackages__", |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1783 | "//external/perfetto:__subpackages__", |
Christopher Ferris | c5d3a43 | 2019-09-25 17:50:36 -0700 | [diff] [blame] | 1784 | "//external/scudo:__subpackages__", |
Josh Gao | 5074e7d | 2019-12-13 13:55:53 -0800 | [diff] [blame] | 1785 | "//system/core/debuggerd:__subpackages__", |
Peter Collingbourne | 6e316e6 | 2020-04-07 14:09:52 -0700 | [diff] [blame] | 1786 | "//system/core/libunwindstack:__subpackages__", |
Peter Collingbourne | 6a363f7 | 2020-01-13 10:39:33 -0800 | [diff] [blame] | 1787 | "//system/memory/libmemunreachable:__subpackages__", |
Peter Collingbourne | 1541800 | 2020-05-12 16:02:50 -0700 | [diff] [blame] | 1788 | "//tools/security/sanitizer-status:__subpackages__", |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1789 | ], |
Peter Collingbourne | 6a363f7 | 2020-01-13 10:39:33 -0800 | [diff] [blame] | 1790 | vendor_available: true, |
Yifan Hong | 5a39cee | 2020-01-21 16:43:56 -0800 | [diff] [blame] | 1791 | ramdisk_available: true, |
Christopher Ferris | c5d3a43 | 2019-09-25 17:50:36 -0700 | [diff] [blame] | 1792 | recovery_available: true, |
| 1793 | native_bridge_supported: true, |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1794 | export_include_dirs: [ |
| 1795 | "platform", |
| 1796 | ], |
Christopher Ferris | e55e5ee | 2019-10-01 17:54:42 -0700 | [diff] [blame] | 1797 | system_shared_libs: [], |
| 1798 | stl: "none", |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1799 | sdk_version: "current", |
Jiyong Park | 4ede160 | 2020-04-28 18:21:08 +0900 | [diff] [blame] | 1800 | |
| 1801 | apex_available: [ |
| 1802 | "//apex_available:platform", |
| 1803 | "com.android.runtime", |
| 1804 | "com.android.art.release", // from libdexfile_external |
| 1805 | "com.android.art.debug", // from libdexfile_external |
| 1806 | ], |
Christopher Ferris | 2b0638e | 2019-09-11 19:05:29 -0700 | [diff] [blame] | 1807 | } |
| 1808 | |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1809 | cc_library_headers { |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1810 | // Internal lib for use in libc_headers. Since we cannot intersect arch{} |
| 1811 | // and target{} in the same module, this one specifies the arch-dependent |
| 1812 | // include paths, and then libc_headers filters by target so that the |
| 1813 | // headers only are included for Bionic targets. |
| 1814 | name: "libc_headers_arch", |
| 1815 | visibility: ["//visibility:private"], |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1816 | |
| 1817 | host_supported: true, |
| 1818 | vendor_available: true, |
Yifan Hong | 5a39cee | 2020-01-21 16:43:56 -0800 | [diff] [blame] | 1819 | ramdisk_available: true, |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1820 | recovery_available: true, |
dimitry | 7f04880 | 2019-05-03 15:57:34 +0200 | [diff] [blame] | 1821 | native_bridge_supported: true, |
Jiyong Park | 922a5c7 | 2020-03-07 17:35:02 +0900 | [diff] [blame] | 1822 | apex_available: [ |
| 1823 | "//apex_available:platform", |
Jiyong Park | ad9946c | 2020-03-30 18:36:07 +0900 | [diff] [blame] | 1824 | "//apex_available:anyapex", |
| 1825 | ], |
Jooyung Han | 15c32a8 | 2020-04-16 18:26:45 +0900 | [diff] [blame] | 1826 | // used by most APEXes indirectly via libunwind_llvm |
| 1827 | min_sdk_version: "apex_inherit", |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1828 | |
| 1829 | no_libcrt: true, |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1830 | stl: "none", |
| 1831 | system_shared_libs: [], |
| 1832 | |
Peter Collingbourne | f2b1e03 | 2019-12-10 17:41:16 -0800 | [diff] [blame] | 1833 | // The build system generally requires that any dependencies of a target |
| 1834 | // with an sdk_version must have a lower sdk_version. By setting sdk_version |
| 1835 | // to 1 we let targets with an sdk_version that need to depend on the libc |
| 1836 | // headers but cannot depend on libc itself due to circular dependencies |
| 1837 | // (such as libunwind_llvm) depend on the headers. Setting sdk_version to 1 |
| 1838 | // is correct because the headers can support any sdk_version. |
| 1839 | sdk_version: "1", |
| 1840 | |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1841 | export_system_include_dirs: [ |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1842 | "include", |
| 1843 | "kernel/uapi", |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1844 | "kernel/android/scsi", |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1845 | "kernel/android/uapi", |
| 1846 | ], |
| 1847 | |
| 1848 | arch: { |
| 1849 | arm: { |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1850 | export_system_include_dirs: ["kernel/uapi/asm-arm"], |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1851 | }, |
| 1852 | arm64: { |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1853 | export_system_include_dirs: ["kernel/uapi/asm-arm64"], |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1854 | }, |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1855 | x86: { |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1856 | export_system_include_dirs: ["kernel/uapi/asm-x86"], |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1857 | }, |
| 1858 | x86_64: { |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1859 | export_system_include_dirs: ["kernel/uapi/asm-x86"], |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 1860 | }, |
| 1861 | }, |
| 1862 | } |
| 1863 | |
Martin Stjernholm | 82d84bc | 2020-04-06 20:32:09 +0100 | [diff] [blame] | 1864 | cc_library_headers { |
| 1865 | name: "libc_headers", |
| 1866 | host_supported: true, |
| 1867 | native_bridge_supported: true, |
| 1868 | vendor_available: true, |
| 1869 | ramdisk_available: true, |
| 1870 | recovery_available: true, |
| 1871 | sdk_version: "1", |
| 1872 | |
| 1873 | apex_available: [ |
| 1874 | "//apex_available:platform", |
| 1875 | "//apex_available:anyapex", |
| 1876 | ], |
| 1877 | // used by most APEXes indirectly via libunwind_llvm |
| 1878 | min_sdk_version: "apex_inherit", |
| 1879 | visibility: [ |
| 1880 | "//bionic:__subpackages__", // visible to bionic |
| 1881 | // ... and only to these places (b/152668052) |
| 1882 | "//external/arm-optimized-routines", |
| 1883 | "//external/gwp_asan", |
| 1884 | "//external/jemalloc_new", |
| 1885 | "//external/libunwind_llvm", |
| 1886 | "//external/scudo", |
| 1887 | "//system/core/property_service/libpropertyinfoparser", |
| 1888 | "//system/extras/toolchain-extras", |
| 1889 | // TODO(b/153662223): Clean up these users that needed visibility when |
| 1890 | // the implicit addition of system Bionic paths was removed. |
| 1891 | "//art/tools/cpp-define-generator", |
| 1892 | "//external/boringssl", |
| 1893 | "//external/minijail", |
| 1894 | ], |
| 1895 | |
| 1896 | stl: "none", |
| 1897 | no_libcrt: true, |
| 1898 | system_shared_libs: [], |
| 1899 | |
| 1900 | target: { |
| 1901 | android: { |
| 1902 | header_libs: ["libc_headers_arch"], |
| 1903 | export_header_lib_headers: ["libc_headers_arch"], |
| 1904 | }, |
| 1905 | linux_bionic: { |
| 1906 | header_libs: ["libc_headers_arch"], |
| 1907 | export_header_lib_headers: ["libc_headers_arch"], |
| 1908 | }, |
| 1909 | } |
| 1910 | } |
| 1911 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1912 | // ======================================================== |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1913 | // libstdc++.so and libstdc++.a. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1914 | // ======================================================== |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1915 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1916 | cc_library { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1917 | defaults: ["libc_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1918 | include_dirs: ["bionic/libstdc++/include"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1919 | srcs: [ |
| 1920 | "bionic/__cxa_guard.cpp", |
| 1921 | "bionic/__cxa_pure_virtual.cpp", |
| 1922 | "bionic/new.cpp", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1923 | ], |
| 1924 | name: "libstdc++", |
Dan Albert | 40f15ec | 2017-10-27 11:21:20 -0700 | [diff] [blame] | 1925 | static_ndk_lib: true, |
Isaac Chen | 5e7c90b | 2017-09-20 14:44:42 +0800 | [diff] [blame] | 1926 | static_libs: ["libasync_safe"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1927 | |
Dan Willemsen | 6b3be17 | 2018-12-03 13:57:20 -0800 | [diff] [blame] | 1928 | static: { |
| 1929 | system_shared_libs: [], |
| 1930 | }, |
| 1931 | shared: { |
| 1932 | system_shared_libs: ["libc"], |
| 1933 | }, |
| 1934 | |
Ian Pedowitz | b6310c2 | 2018-01-18 16:26:19 -0800 | [diff] [blame] | 1935 | //TODO (dimitry): 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] | 1936 | arch: { |
| 1937 | arm: { |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1938 | // TODO: This is to work around b/24465209. Remove after root cause is fixed. |
Chih-Hung Hsieh | ecbff83 | 2018-05-23 18:45:53 -0700 | [diff] [blame] | 1939 | pack_relocations: false, |
Ian Pedowitz | b6310c2 | 2018-01-18 16:26:19 -0800 | [diff] [blame] | 1940 | ldflags: ["-Wl,--hash-style=both"], |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1941 | version_script: ":libstdc++.arm.map", |
Dimitry Ivanov | 6cc8d47 | 2016-07-28 13:52:17 -0700 | [diff] [blame] | 1942 | }, |
| 1943 | arm64: { |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1944 | version_script: ":libstdc++.arm64.map", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1945 | }, |
| 1946 | x86: { |
Chih-Hung Hsieh | ecbff83 | 2018-05-23 18:45:53 -0700 | [diff] [blame] | 1947 | pack_relocations: false, |
Ian Pedowitz | b6310c2 | 2018-01-18 16:26:19 -0800 | [diff] [blame] | 1948 | ldflags: ["-Wl,--hash-style=both"], |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1949 | version_script: ":libstdc++.x86.map", |
Dimitry Ivanov | 6cc8d47 | 2016-07-28 13:52:17 -0700 | [diff] [blame] | 1950 | }, |
| 1951 | x86_64: { |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1952 | version_script: ":libstdc++.x86_64.map", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 1953 | }, |
| 1954 | }, |
| 1955 | } |
| 1956 | |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 1957 | genrule { |
| 1958 | name: "libstdc++.arm.map", |
| 1959 | out: ["libstdc++.arm.map"], |
| 1960 | srcs: ["libstdc++.map.txt"], |
| 1961 | tool_files: [":bionic-generate-version-script"], |
| 1962 | cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)", |
| 1963 | } |
| 1964 | |
| 1965 | genrule { |
| 1966 | name: "libstdc++.arm64.map", |
| 1967 | out: ["libstdc++.arm64.map"], |
| 1968 | srcs: ["libstdc++.map.txt"], |
| 1969 | tool_files: [":bionic-generate-version-script"], |
| 1970 | cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)", |
| 1971 | } |
| 1972 | |
| 1973 | genrule { |
| 1974 | name: "libstdc++.x86.map", |
| 1975 | out: ["libstdc++.x86.map"], |
| 1976 | srcs: ["libstdc++.map.txt"], |
| 1977 | tool_files: [":bionic-generate-version-script"], |
| 1978 | cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)", |
| 1979 | } |
| 1980 | |
| 1981 | genrule { |
| 1982 | name: "libstdc++.x86_64.map", |
| 1983 | out: ["libstdc++.x86_64.map"], |
| 1984 | srcs: ["libstdc++.map.txt"], |
| 1985 | tool_files: [":bionic-generate-version-script"], |
| 1986 | cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)", |
| 1987 | } |
| 1988 | |
| 1989 | // ======================================================== |
| 1990 | // crt object files. |
| 1991 | // ======================================================== |
| 1992 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 1993 | cc_defaults { |
| 1994 | name: "crt_defaults", |
Dan Willemsen | 7ec52b1 | 2016-11-28 17:02:25 -0800 | [diff] [blame] | 1995 | defaults: ["linux_bionic_supported"], |
Dan Willemsen | 230a7a4 | 2017-04-07 14:09:05 -0700 | [diff] [blame] | 1996 | vendor_available: true, |
Yifan Hong | 5a39cee | 2020-01-21 16:43:56 -0800 | [diff] [blame] | 1997 | ramdisk_available: true, |
Jiyong Park | 5603c6e | 2018-04-27 21:53:11 +0900 | [diff] [blame] | 1998 | recovery_available: true, |
dimitry | 7f04880 | 2019-05-03 15:57:34 +0200 | [diff] [blame] | 1999 | native_bridge_supported: true, |
Jiyong Park | 922a5c7 | 2020-03-07 17:35:02 +0900 | [diff] [blame] | 2000 | apex_available: [ |
| 2001 | "//apex_available:platform", |
| 2002 | "//apex_available:anyapex", |
| 2003 | ], |
Jooyung Han | 15c32a8 | 2020-04-16 18:26:45 +0900 | [diff] [blame] | 2004 | // crt* objects are used by most cc_binary/cc_library in "anyapex" |
| 2005 | min_sdk_version: "apex_inherit", |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 2006 | cflags: [ |
| 2007 | "-Wno-gcc-compat", |
| 2008 | "-Wall", |
| 2009 | "-Werror", |
| 2010 | ], |
Peter Collingbourne | 7eb851c | 2019-09-26 12:16:06 -0700 | [diff] [blame] | 2011 | sanitize: { |
| 2012 | never: true, |
| 2013 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2014 | } |
| 2015 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2016 | cc_defaults { |
| 2017 | name: "crt_so_defaults", |
Colin Cross | 7d7b368 | 2017-11-03 13:38:40 -0700 | [diff] [blame] | 2018 | defaults: ["crt_defaults"], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2019 | |
| 2020 | arch: { |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2021 | x86: { |
| 2022 | cflags: ["-fPIC"], |
| 2023 | }, |
| 2024 | x86_64: { |
| 2025 | cflags: ["-fPIC"], |
| 2026 | }, |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2027 | }, |
Colin Cross | ab17944 | 2018-09-27 11:03:22 -0700 | [diff] [blame] | 2028 | stl: "none", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2029 | } |
| 2030 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2031 | cc_object { |
| 2032 | name: "crtbrand", |
Dan Willemsen | a3ed901 | 2017-04-04 15:51:26 -0700 | [diff] [blame] | 2033 | // crtbrand.c needs <stdint.h> and a #define for the platform SDK version. |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2034 | local_include_dirs: ["include"], |
| 2035 | product_variables: { |
| 2036 | platform_sdk_version: { |
| 2037 | asflags: ["-DPLATFORM_SDK_VERSION=%d"], |
| 2038 | }, |
| 2039 | }, |
| 2040 | srcs: ["arch-common/bionic/crtbrand.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2041 | |
Colin Cross | 7d7b368 | 2017-11-03 13:38:40 -0700 | [diff] [blame] | 2042 | defaults: ["crt_so_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2043 | } |
| 2044 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2045 | cc_object { |
| 2046 | name: "crtbegin_so1", |
| 2047 | local_include_dirs: ["include"], |
| 2048 | srcs: ["arch-common/bionic/crtbegin_so.c"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2049 | |
Colin Cross | 7d7b368 | 2017-11-03 13:38:40 -0700 | [diff] [blame] | 2050 | defaults: ["crt_so_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2051 | } |
| 2052 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2053 | cc_object { |
| 2054 | name: "crtbegin_so", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2055 | |
Colin Cross | 7d7b368 | 2017-11-03 13:38:40 -0700 | [diff] [blame] | 2056 | defaults: ["crt_so_defaults"], |
Colin Cross | 77d57bf | 2016-04-11 14:34:18 -0700 | [diff] [blame] | 2057 | objs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2058 | "crtbegin_so1", |
| 2059 | "crtbrand", |
| 2060 | ], |
| 2061 | } |
| 2062 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2063 | cc_object { |
| 2064 | name: "crtend_so", |
| 2065 | local_include_dirs: ["include"], |
| 2066 | srcs: ["arch-common/bionic/crtend_so.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2067 | |
Colin Cross | 7d7b368 | 2017-11-03 13:38:40 -0700 | [diff] [blame] | 2068 | defaults: ["crt_so_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2069 | } |
| 2070 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2071 | cc_object { |
| 2072 | name: "crtbegin_static1", |
| 2073 | local_include_dirs: ["include"], |
| 2074 | srcs: ["arch-common/bionic/crtbegin.c"], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2075 | defaults: ["crt_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2076 | } |
| 2077 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2078 | cc_object { |
| 2079 | name: "crtbegin_static", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2080 | |
Colin Cross | 77d57bf | 2016-04-11 14:34:18 -0700 | [diff] [blame] | 2081 | objs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2082 | "crtbegin_static1", |
| 2083 | "crtbrand", |
| 2084 | ], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2085 | defaults: ["crt_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2086 | } |
| 2087 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2088 | cc_object { |
| 2089 | name: "crtbegin_dynamic1", |
| 2090 | local_include_dirs: ["include"], |
| 2091 | srcs: ["arch-common/bionic/crtbegin.c"], |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2092 | defaults: ["crt_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2093 | } |
| 2094 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2095 | cc_object { |
| 2096 | name: "crtbegin_dynamic", |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2097 | |
Colin Cross | 77d57bf | 2016-04-11 14:34:18 -0700 | [diff] [blame] | 2098 | objs: [ |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2099 | "crtbegin_dynamic1", |
| 2100 | "crtbrand", |
| 2101 | ], |
Dan Willemsen | 7ccc50d | 2017-09-18 21:28:14 -0700 | [diff] [blame] | 2102 | target: { |
| 2103 | linux_bionic: { |
| 2104 | generated_sources: ["host_bionic_linker_asm"], |
| 2105 | objs: [ |
| 2106 | "linker_wrapper", |
| 2107 | ], |
| 2108 | }, |
| 2109 | }, |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2110 | defaults: ["crt_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2111 | } |
| 2112 | |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2113 | cc_object { |
| 2114 | // We rename crtend.o to crtend_android.o to avoid a |
| 2115 | // name clash between gcc and bionic. |
| 2116 | name: "crtend_android", |
| 2117 | local_include_dirs: ["include"], |
| 2118 | srcs: ["arch-common/bionic/crtend.S"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2119 | |
Colin Cross | 50c21ab | 2015-10-31 23:03:05 -0700 | [diff] [blame] | 2120 | defaults: ["crt_defaults"], |
Dan Willemsen | 208ae17 | 2015-09-16 16:33:27 -0700 | [diff] [blame] | 2121 | } |
Colin Cross | baa4899 | 2016-07-13 11:15:21 -0700 | [diff] [blame] | 2122 | |
Elliott Hughes | d19b3c5 | 2018-09-06 16:04:08 -0700 | [diff] [blame] | 2123 | // ======================================================== |
| 2124 | // NDK headers. |
| 2125 | // ======================================================== |
| 2126 | |
Dan Albert | 26e1c41 | 2018-05-24 14:56:46 -0700 | [diff] [blame] | 2127 | versioned_ndk_headers { |
Dan Albert | 22805ea | 2017-03-22 15:28:05 -0700 | [diff] [blame] | 2128 | name: "common_libc", |
| 2129 | from: "include", |
| 2130 | to: "", |
| 2131 | license: "NOTICE", |
| 2132 | } |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2133 | |
| 2134 | ndk_headers { |
Dan Albert | 063e86a | 2016-11-29 11:09:12 -0800 | [diff] [blame] | 2135 | name: "libc_uapi", |
| 2136 | from: "kernel/uapi", |
| 2137 | to: "", |
| 2138 | srcs: [ |
| 2139 | "kernel/uapi/asm-generic/**/*.h", |
| 2140 | "kernel/uapi/drm/**/*.h", |
| 2141 | "kernel/uapi/linux/**/*.h", |
| 2142 | "kernel/uapi/misc/**/*.h", |
| 2143 | "kernel/uapi/mtd/**/*.h", |
| 2144 | "kernel/uapi/rdma/**/*.h", |
| 2145 | "kernel/uapi/scsi/**/*.h", |
| 2146 | "kernel/uapi/sound/**/*.h", |
| 2147 | "kernel/uapi/video/**/*.h", |
| 2148 | "kernel/uapi/xen/**/*.h", |
| 2149 | ], |
Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2150 | license: "NOTICE", |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2151 | } |
| 2152 | |
| 2153 | ndk_headers { |
Elliott Hughes | 2fad0d5 | 2017-04-27 16:26:55 -0700 | [diff] [blame] | 2154 | name: "libc_kernel_android_uapi_linux", |
Dan Albert | bae16ef | 2016-09-14 17:15:48 -0700 | [diff] [blame] | 2155 | from: "kernel/android/uapi/linux", |
| 2156 | to: "linux", |
| 2157 | srcs: ["kernel/android/uapi/linux/**/*.h"], |
Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2158 | license: "NOTICE", |
Dan Albert | bae16ef | 2016-09-14 17:15:48 -0700 | [diff] [blame] | 2159 | } |
| 2160 | |
| 2161 | ndk_headers { |
Elliott Hughes | 2fad0d5 | 2017-04-27 16:26:55 -0700 | [diff] [blame] | 2162 | name: "libc_kernel_android_scsi", |
Elliott Hughes | 5059939 | 2017-05-25 17:13:32 -0700 | [diff] [blame] | 2163 | from: "kernel/android/scsi/scsi", |
Elliott Hughes | 2fad0d5 | 2017-04-27 16:26:55 -0700 | [diff] [blame] | 2164 | to: "scsi", |
| 2165 | srcs: ["kernel/android/scsi/**/*.h"], |
| 2166 | license: "NOTICE", |
| 2167 | } |
| 2168 | |
| 2169 | ndk_headers { |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2170 | name: "libc_asm_arm", |
| 2171 | from: "kernel/uapi/asm-arm", |
| 2172 | to: "arm-linux-androideabi", |
| 2173 | srcs: ["kernel/uapi/asm-arm/**/*.h"], |
Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2174 | license: "NOTICE", |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2175 | } |
| 2176 | |
| 2177 | ndk_headers { |
| 2178 | name: "libc_asm_arm64", |
| 2179 | from: "kernel/uapi/asm-arm64", |
| 2180 | to: "aarch64-linux-android", |
| 2181 | srcs: ["kernel/uapi/asm-arm64/**/*.h"], |
Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2182 | license: "NOTICE", |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2183 | } |
| 2184 | |
Lazar Trsic | 790d2f7 | 2017-11-27 11:54:11 +0100 | [diff] [blame] | 2185 | ndk_headers { |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2186 | name: "libc_asm_x86", |
| 2187 | from: "kernel/uapi/asm-x86", |
| 2188 | to: "i686-linux-android", |
| 2189 | srcs: ["kernel/uapi/asm-x86/**/*.h"], |
Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2190 | license: "NOTICE", |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2191 | } |
| 2192 | |
| 2193 | ndk_headers { |
| 2194 | name: "libc_asm_x86_64", |
| 2195 | from: "kernel/uapi/asm-x86", |
| 2196 | to: "x86_64-linux-android", |
| 2197 | srcs: ["kernel/uapi/asm-x86/**/*.h"], |
Dan Albert | 9259265 | 2016-10-20 01:42:54 -0700 | [diff] [blame] | 2198 | license: "NOTICE", |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2199 | } |
| 2200 | |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2201 | ndk_library { |
Dan Willemsen | 51a9bf1 | 2017-04-07 14:09:18 -0700 | [diff] [blame] | 2202 | name: "libc", |
dimitry | 7f04880 | 2019-05-03 15:57:34 +0200 | [diff] [blame] | 2203 | native_bridge_supported: true, |
Dan Albert | 4238a35 | 2016-06-28 11:18:05 -0700 | [diff] [blame] | 2204 | symbol_file: "libc.map.txt", |
| 2205 | first_version: "9", |
| 2206 | } |
| 2207 | |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2208 | llndk_library { |
Dan Willemsen | 51a9bf1 | 2017-04-07 14:09:18 -0700 | [diff] [blame] | 2209 | name: "libc", |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2210 | symbol_file: "libc.map.txt", |
| 2211 | export_headers_as_system: true, |
| 2212 | export_preprocessed_headers: ["include"], |
dimitry | 7f04880 | 2019-05-03 15:57:34 +0200 | [diff] [blame] | 2213 | native_bridge_supported: true, |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 2214 | export_include_dirs: [ |
Wenhao Wang | 69537f1 | 2019-12-17 13:54:04 -0800 | [diff] [blame] | 2215 | "kernel/android/scsi", |
Logan Chien | 17af91b | 2019-01-15 21:19:56 +0800 | [diff] [blame] | 2216 | "kernel/android/uapi", |
| 2217 | "kernel/uapi", |
| 2218 | ], |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2219 | arch: { |
| 2220 | arm: { |
| 2221 | export_include_dirs: [ |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2222 | "kernel/uapi/asm-arm", |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2223 | ], |
| 2224 | }, |
| 2225 | arm64: { |
| 2226 | export_include_dirs: [ |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2227 | "kernel/uapi/asm-arm64", |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2228 | ], |
| 2229 | }, |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2230 | x86: { |
| 2231 | export_include_dirs: [ |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2232 | "kernel/uapi/asm-x86", |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2233 | ], |
| 2234 | }, |
| 2235 | x86_64: { |
| 2236 | export_include_dirs: [ |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2237 | "kernel/uapi/asm-x86", |
Dan Willemsen | b8f7fde | 2017-03-20 14:07:47 -0700 | [diff] [blame] | 2238 | ], |
| 2239 | }, |
| 2240 | }, |
| 2241 | } |
| 2242 | |
Dan Albert | df31aff | 2016-10-06 15:50:41 -0700 | [diff] [blame] | 2243 | ndk_library { |
Dan Willemsen | 51a9bf1 | 2017-04-07 14:09:18 -0700 | [diff] [blame] | 2244 | name: "libstdc++", |
Dan Albert | df31aff | 2016-10-06 15:50:41 -0700 | [diff] [blame] | 2245 | symbol_file: "libstdc++.map.txt", |
| 2246 | first_version: "9", |
| 2247 | } |
| 2248 | |
Dan Willemsen | ca056d7 | 2018-01-08 14:00:24 -0800 | [diff] [blame] | 2249 | // Export these headers for toolbox to process |
| 2250 | filegroup { |
| 2251 | name: "kernel_input_headers", |
| 2252 | srcs: [ |
| 2253 | "kernel/uapi/linux/input.h", |
| 2254 | "kernel/uapi/linux/input-event-codes.h", |
| 2255 | ], |
| 2256 | } |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2257 | |
| 2258 | // Generate a syscall name / number mapping. These objects are text files |
| 2259 | // (thanks to the -dD -E flags) and not binary files. They will then be |
| 2260 | // consumed by the genseccomp.py script and converted into C++ code. |
| 2261 | cc_defaults { |
| 2262 | name: "libseccomp_gen_syscall_nrs_defaults", |
| 2263 | recovery_available: true, |
| 2264 | srcs: ["seccomp/gen_syscall_nrs.cpp"], |
| 2265 | cflags: [ |
| 2266 | "-dD", |
| 2267 | "-E", |
| 2268 | "-Wall", |
| 2269 | "-Werror", |
| 2270 | "-nostdinc", |
| 2271 | ], |
| 2272 | } |
| 2273 | |
| 2274 | cc_object { |
| 2275 | name: "libseccomp_gen_syscall_nrs_arm", |
| 2276 | defaults: ["libseccomp_gen_syscall_nrs_defaults"], |
| 2277 | local_include_dirs: [ |
| 2278 | "kernel/uapi/asm-arm", |
| 2279 | "kernel/uapi", |
| 2280 | ], |
| 2281 | } |
| 2282 | |
| 2283 | cc_object { |
| 2284 | name: "libseccomp_gen_syscall_nrs_arm64", |
| 2285 | defaults: ["libseccomp_gen_syscall_nrs_defaults"], |
| 2286 | local_include_dirs: [ |
| 2287 | "kernel/uapi/asm-arm64", |
| 2288 | "kernel/uapi", |
| 2289 | ], |
| 2290 | } |
| 2291 | |
| 2292 | cc_object { |
| 2293 | name: "libseccomp_gen_syscall_nrs_x86", |
| 2294 | defaults: ["libseccomp_gen_syscall_nrs_defaults"], |
| 2295 | srcs: ["seccomp/gen_syscall_nrs_x86.cpp"], |
| 2296 | exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"], |
| 2297 | local_include_dirs: [ |
| 2298 | "kernel/uapi/asm-x86", |
| 2299 | "kernel/uapi", |
| 2300 | ], |
| 2301 | } |
| 2302 | |
| 2303 | cc_object { |
| 2304 | name: "libseccomp_gen_syscall_nrs_x86_64", |
| 2305 | defaults: ["libseccomp_gen_syscall_nrs_defaults"], |
| 2306 | srcs: ["seccomp/gen_syscall_nrs_x86_64.cpp"], |
| 2307 | exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"], |
| 2308 | local_include_dirs: [ |
| 2309 | "kernel/uapi/asm-x86", |
| 2310 | "kernel/uapi", |
| 2311 | ], |
| 2312 | } |
| 2313 | |
Elliott Hughes | ae03b12 | 2019-09-17 16:37:05 -0700 | [diff] [blame] | 2314 | // Generate the C++ policy sources for app and system seccomp-bpf filters. |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2315 | python_binary_host { |
| 2316 | name: "genseccomp", |
| 2317 | main: "tools/genseccomp.py", |
| 2318 | |
| 2319 | srcs: [ |
| 2320 | "tools/genseccomp.py", |
| 2321 | "tools/gensyscalls.py", |
| 2322 | ], |
| 2323 | |
| 2324 | data: [ |
| 2325 | "kernel/uapi/**/*.h", |
| 2326 | ], |
| 2327 | |
| 2328 | version: { |
| 2329 | py2: { |
| 2330 | enabled: true, |
| 2331 | }, |
| 2332 | py3: { |
| 2333 | enabled: false, |
| 2334 | }, |
| 2335 | }, |
| 2336 | } |
| 2337 | |
Martijn Coenen | 0c6de75 | 2019-01-02 12:52:51 +0100 | [diff] [blame] | 2338 | python_binary_host { |
| 2339 | name: "genfunctosyscallnrs", |
| 2340 | main: "tools/genfunctosyscallnrs.py", |
| 2341 | |
| 2342 | srcs: [ |
| 2343 | "tools/genseccomp.py", |
| 2344 | "tools/genfunctosyscallnrs.py", |
| 2345 | "tools/gensyscalls.py", |
| 2346 | ], |
| 2347 | |
| 2348 | data: [ |
| 2349 | "kernel/uapi/**/*.h", |
| 2350 | ], |
| 2351 | |
| 2352 | version: { |
| 2353 | py2: { |
| 2354 | enabled: true, |
| 2355 | }, |
| 2356 | py3: { |
| 2357 | enabled: false, |
| 2358 | }, |
| 2359 | }, |
| 2360 | } |
| 2361 | |
| 2362 | cc_genrule { |
| 2363 | name: "func_to_syscall_nrs", |
| 2364 | recovery_available: true, |
| 2365 | cmd: "$(location genfunctosyscallnrs) --out-dir=$(genDir) $(in)", |
| 2366 | |
| 2367 | tools: [ "genfunctosyscallnrs" ], |
| 2368 | |
| 2369 | srcs: [ |
| 2370 | "SYSCALLS.TXT", |
| 2371 | ":libseccomp_gen_syscall_nrs_arm", |
| 2372 | ":libseccomp_gen_syscall_nrs_arm64", |
Martijn Coenen | 0c6de75 | 2019-01-02 12:52:51 +0100 | [diff] [blame] | 2373 | ":libseccomp_gen_syscall_nrs_x86", |
| 2374 | ":libseccomp_gen_syscall_nrs_x86_64", |
| 2375 | ], |
| 2376 | |
| 2377 | out: [ |
| 2378 | "func_to_syscall_nrs.h", |
| 2379 | ], |
| 2380 | } |
| 2381 | |
Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2382 | // SECCOMP_BLOCKLIST_APP_ZYGOTE.TXT = SECCOMP_BLOCKLIST_APP.txt - setresgid* |
Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2383 | genrule { |
Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2384 | name: "generate_app_zygote_blocklist", |
| 2385 | out: ["SECCOMP_BLOCKLIST_APP_ZYGOTE.TXT"], |
| 2386 | srcs: ["SECCOMP_BLOCKLIST_APP.TXT"], |
Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2387 | cmd: "grep -v '^int[ \t]*setresgid' $(in) > $(out)", |
| 2388 | } |
| 2389 | |
| 2390 | cc_genrule { |
| 2391 | name: "libseccomp_policy_app_zygote_sources", |
| 2392 | recovery_available: true, |
| 2393 | cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)", |
| 2394 | |
| 2395 | tools: [ "genseccomp" ], |
| 2396 | |
| 2397 | srcs: [ |
| 2398 | "SYSCALLS.TXT", |
Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2399 | "SECCOMP_ALLOWLIST_COMMON.TXT", |
| 2400 | "SECCOMP_ALLOWLIST_APP.TXT", |
| 2401 | "SECCOMP_BLOCKLIST_COMMON.TXT", |
Bram Bonné | acadd09 | 2020-05-06 13:49:55 +0200 | [diff] [blame] | 2402 | "SECCOMP_PRIORITY.TXT", |
Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2403 | ":generate_app_zygote_blocklist", |
Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2404 | ":libseccomp_gen_syscall_nrs_arm", |
| 2405 | ":libseccomp_gen_syscall_nrs_arm64", |
Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2406 | ":libseccomp_gen_syscall_nrs_x86", |
| 2407 | ":libseccomp_gen_syscall_nrs_x86_64", |
| 2408 | ], |
| 2409 | |
| 2410 | out: [ |
| 2411 | "arm64_app_zygote_policy.cpp", |
| 2412 | "arm_app_zygote_policy.cpp", |
Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2413 | "x86_64_app_zygote_policy.cpp", |
| 2414 | "x86_app_zygote_policy.cpp", |
| 2415 | ], |
| 2416 | } |
| 2417 | |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2418 | cc_genrule { |
| 2419 | name: "libseccomp_policy_app_sources", |
| 2420 | recovery_available: true, |
| 2421 | cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)", |
| 2422 | |
| 2423 | tools: [ "genseccomp" ], |
| 2424 | |
| 2425 | srcs: [ |
| 2426 | "SYSCALLS.TXT", |
Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2427 | "SECCOMP_ALLOWLIST_COMMON.TXT", |
| 2428 | "SECCOMP_ALLOWLIST_APP.TXT", |
| 2429 | "SECCOMP_BLOCKLIST_COMMON.TXT", |
| 2430 | "SECCOMP_BLOCKLIST_APP.TXT", |
Bram Bonné | acadd09 | 2020-05-06 13:49:55 +0200 | [diff] [blame] | 2431 | "SECCOMP_PRIORITY.TXT", |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2432 | ":libseccomp_gen_syscall_nrs_arm", |
| 2433 | ":libseccomp_gen_syscall_nrs_arm64", |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2434 | ":libseccomp_gen_syscall_nrs_x86", |
| 2435 | ":libseccomp_gen_syscall_nrs_x86_64", |
| 2436 | ], |
| 2437 | |
| 2438 | out: [ |
| 2439 | "arm64_app_policy.cpp", |
| 2440 | "arm_app_policy.cpp", |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2441 | "x86_64_app_policy.cpp", |
| 2442 | "x86_app_policy.cpp", |
| 2443 | ], |
| 2444 | } |
| 2445 | |
| 2446 | cc_genrule { |
| 2447 | name: "libseccomp_policy_system_sources", |
| 2448 | recovery_available: true, |
| 2449 | cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)", |
| 2450 | |
| 2451 | tools: [ "genseccomp" ], |
| 2452 | |
| 2453 | srcs: [ |
| 2454 | "SYSCALLS.TXT", |
Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 2455 | "SECCOMP_ALLOWLIST_COMMON.TXT", |
| 2456 | "SECCOMP_ALLOWLIST_SYSTEM.TXT", |
| 2457 | "SECCOMP_BLOCKLIST_COMMON.TXT", |
Bram Bonné | acadd09 | 2020-05-06 13:49:55 +0200 | [diff] [blame] | 2458 | "SECCOMP_PRIORITY.TXT", |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2459 | ":libseccomp_gen_syscall_nrs_arm", |
| 2460 | ":libseccomp_gen_syscall_nrs_arm64", |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2461 | ":libseccomp_gen_syscall_nrs_x86", |
| 2462 | ":libseccomp_gen_syscall_nrs_x86_64", |
| 2463 | ], |
| 2464 | |
| 2465 | out: [ |
| 2466 | "arm64_system_policy.cpp", |
| 2467 | "arm_system_policy.cpp", |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2468 | "x86_64_system_policy.cpp", |
| 2469 | "x86_system_policy.cpp", |
| 2470 | ], |
| 2471 | } |
| 2472 | |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2473 | cc_library { |
| 2474 | name: "libseccomp_policy", |
| 2475 | recovery_available: true, |
Martijn Coenen | d269d9b | 2018-11-08 16:41:42 +0100 | [diff] [blame] | 2476 | generated_headers: ["func_to_syscall_nrs"], |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2477 | generated_sources: [ |
| 2478 | "libseccomp_policy_app_sources", |
Martijn Coenen | c3752be | 2019-01-09 16:19:57 +0100 | [diff] [blame] | 2479 | "libseccomp_policy_app_zygote_sources", |
Luis Hector Chavez | fa09b3c | 2018-08-03 20:53:28 -0700 | [diff] [blame] | 2480 | "libseccomp_policy_system_sources", |
| 2481 | ], |
| 2482 | |
| 2483 | srcs: [ |
| 2484 | "seccomp/seccomp_policy.cpp", |
| 2485 | ], |
| 2486 | |
| 2487 | export_include_dirs: ["seccomp/include"], |
| 2488 | cflags: [ |
| 2489 | "-Wall", |
| 2490 | "-Werror", |
| 2491 | ], |
| 2492 | shared: { |
| 2493 | shared_libs: ["libbase"], |
| 2494 | }, |
| 2495 | static: { |
| 2496 | static_libs: ["libbase"], |
| 2497 | }, |
| 2498 | } |
Christopher Ferris | fc26d71 | 2019-02-27 18:07:55 -0800 | [diff] [blame] | 2499 | |
Christopher Ferris | fc26d71 | 2019-02-27 18:07:55 -0800 | [diff] [blame] | 2500 | subdirs = [ |
| 2501 | "bionic/scudo", |
| 2502 | ] |