blob: f5624efc1302737ec3107ec382b0435e44cf366c [file] [log] [blame]
Bob Badouraa7d8352021-02-19 13:06:22 -08001package {
2 default_applicable_licenses: ["bionic_libc_license"],
3}
4
5license {
6 name: "bionic_libc_license",
7 visibility: [":__subpackages__"],
8 license_kinds: [
9 "SPDX-license-identifier-Apache-2.0",
10 "SPDX-license-identifier-BSD",
11 "SPDX-license-identifier-ISC",
12 "SPDX-license-identifier-MIT",
13 "legacy_notice",
14 "legacy_unencumbered",
15 ],
16 license_text: [
17 "NOTICE",
18 ],
19}
20
Elliott Hughes53cf3482016-08-09 13:06:41 -070021libc_common_flags = [
22 "-D_LIBC=1",
Elliott Hughes25f17e42018-02-12 15:48:01 -080023 "-D__BIONIC_LP32_USE_STAT64",
Elliott Hughes53cf3482016-08-09 13:06:41 -070024 "-Wall",
25 "-Wextra",
26 "-Wunused",
Elliott Hughes3048a362018-01-19 17:58:07 -080027 "-Wno-char-subscripts",
Elliott Hughes53cf3482016-08-09 13:06:41 -070028 "-Wno-deprecated-declarations",
Elliott Hughesb348d5c2017-07-24 16:53:11 -070029 "-Wno-gcc-compat",
Elliott Hughes8e547bd2016-08-16 15:57:47 -070030 "-Wframe-larger-than=2048",
Christopher Ferris1de7a482023-09-12 11:06:29 -070031 "-Wno-reorder-init-list",
Elliott Hughes53cf3482016-08-09 13:06:41 -070032
33 // Try to catch typical 32-bit assumptions that break with 64-bit pointers.
34 "-Werror=pointer-to-int-cast",
35 "-Werror=int-to-pointer-cast",
36 "-Werror=type-limits",
37 "-Werror",
Ryan Prichard8f419572018-02-20 17:09:05 -080038
39 // Clang's exit-time destructor registration hides __dso_handle, but
40 // __dso_handle needs to have default visibility on ARM32. See b/73485611.
41 "-Wexit-time-destructors",
Mitch Phillipsf3968e82020-01-31 19:57:04 -080042
Elliott Hughesa13d0662021-12-02 14:42:16 -080043 // We know clang does a lot of harm by rewriting what we've said, and sadly
44 // never see any good it does, so let's just ask it to do what we say...
45 // (The specific motivating example was clang turning a loop that would only
46 // ever touch 0, 1, or 2 bytes into a call to memset, which was never going
47 // to amortize.)
48 "-fno-builtin",
Elliott Hughes53cf3482016-08-09 13:06:41 -070049]
50
Dan Willemsen208ae172015-09-16 16:33:27 -070051// Define some common cflags
52// ========================================================
Colin Cross50c21ab2015-10-31 23:03:05 -070053cc_defaults {
54 name: "libc_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -080055 defaults: ["linux_bionic_supported"],
Christopher Ferrisb5425052024-04-23 17:15:39 -070056 cflags: libc_common_flags + [
57 "-DUSE_SCUDO",
58 ],
Elliott Hughes53cf3482016-08-09 13:06:41 -070059 asflags: libc_common_flags,
Colin Cross50c21ab2015-10-31 23:03:05 -070060 conlyflags: ["-std=gnu99"],
61 cppflags: [],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070062 include_dirs: [
63 "bionic/libc/async_safe/include",
Peter Collingbourne5d3aa862020-09-11 15:05:17 -070064 "bionic/libc/platform",
Tom Cherry379ed1e2020-09-17 09:36:25 -070065 // For android_filesystem_config.h.
66 "system/core/libcutils/include",
Christopher Ferris7a3681e2017-04-24 17:48:32 -070067 ],
Colin Cross50c21ab2015-10-31 23:03:05 -070068
Martin Stjernholm82d84bc2020-04-06 20:32:09 +010069 header_libs: [
70 "libc_headers",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +000071 "liblog_headers", // needed by bionic/libc/async_safe/include
Martin Stjernholm82d84bc2020-04-06 20:32:09 +010072 ],
73 export_header_lib_headers: [
74 "libc_headers",
75 ],
Mitch Phillipsf3968e82020-01-31 19:57:04 -080076
Colin Cross50c21ab2015-10-31 23:03:05 -070077 stl: "none",
78 system_shared_libs: [],
Colin Cross27c43c52016-04-07 13:27:24 -070079 sanitize: {
Evgenii Stepanovbe551f52018-08-13 16:46:15 -070080 address: false,
81 integer_overflow: false,
Mitch Phillipsdfde0ee2019-05-01 14:26:13 -070082 // TODO(b/132640749): Fix broken fuzzer support.
83 fuzzer: false,
Colin Cross27c43c52016-04-07 13:27:24 -070084 },
Yifan Hong5a39cee2020-01-21 16:43:56 -080085 ramdisk_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -070086 vendor_ramdisk_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +090087 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +020088 native_bridge_supported: true,
Ivan Lozanof17fd1d2018-11-27 07:56:17 -080089
Peter Collingbournee99912f2019-11-01 15:37:00 -070090 product_variables: {
Evgenii Stepanov5a73e032020-04-29 14:59:44 -070091 malloc_zero_contents: {
92 cflags: ["-DSCUDO_ZERO_CONTENTS"],
93 },
94 malloc_pattern_fill_contents: {
95 cflags: ["-DSCUDO_PATTERN_FILL_CONTENTS"],
96 },
Christopher Ferrisb5425052024-04-23 17:15:39 -070097 malloc_low_memory: {
98 cflags: ["-UUSE_SCUDO"],
Steven Morelandfb65ee42020-07-31 00:18:38 +000099 },
Peter Collingbournee99912f2019-11-01 15:37:00 -0700100 },
Yi Kong9e33b762021-10-29 02:43:22 +0800101
102 lto: {
103 never: true,
104 },
Elliott Hughesc2043342023-07-20 20:24:09 +0000105
106 apex_available: ["com.android.runtime"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700107}
108
Elliott Hughes788075a2024-06-18 12:25:37 +0000109// Workaround for b/24465209.
110// We're unlikely to be able to remove this before we just
111// remove ILP32 support completely.
112// Note that we also still have `pack_relocations: false`
113// for both libc and libm, even on LP64.
114// ========================================================
115cc_defaults {
116 name: "bug_24465209_workaround",
Elliott Hughesfeb94732024-06-18 19:44:18 +0000117 target: {
118 android_arm: {
Elliott Hughes788075a2024-06-18 12:25:37 +0000119 pack_relocations: false,
120 ldflags: ["-Wl,--hash-style=both"],
121 },
Elliott Hughesfeb94732024-06-18 19:44:18 +0000122 android_x86: {
Elliott Hughes788075a2024-06-18 12:25:37 +0000123 pack_relocations: false,
124 ldflags: ["-Wl,--hash-style=both"],
Elliott Hughesb4e02782024-06-21 11:35:18 +0000125 },
Elliott Hughes788075a2024-06-18 12:25:37 +0000126 },
127}
128
Elliott Hughes89aada12024-07-01 21:59:04 +0000129// Leave the symbols in the shared library so that stack unwinders can produce
130// meaningful name resolution. This is a bit more ugly than it sounds because
131// arm32 is a bit broken.
132// ========================================================
133cc_defaults {
134 name: "keep_symbols",
135 arch: {
136 arm: {
137 // arm32 does not produce complete exidx unwind information,
138 // so keep the .debug_frame which is relatively small and does
139 // include needed unwind information.
140 // See b/132992102 for details.
141 strip: {
142 keep_symbols_and_debug_frame: true,
143 },
144 },
145 arm64: {
146 strip: {
147 keep_symbols: true,
148 },
149 },
150 riscv64: {
151 strip: {
152 keep_symbols: true,
153 },
154 },
155 x86: {
156 strip: {
157 keep_symbols: true,
158 },
159 },
160 x86_64: {
161 strip: {
162 keep_symbols: true,
163 },
164 },
165 },
166}
167
Christopher Ferrise55e5ee2019-10-01 17:54:42 -0700168// Defaults for native allocator libs/includes to make it
169// easier to change.
Christopher Ferrise55e5ee2019-10-01 17:54:42 -0700170// ========================================================
171cc_defaults {
172 name: "libc_native_allocator_defaults",
173
Christopher Ferrise55e5ee2019-10-01 17:54:42 -0700174 whole_static_libs: [
Christopher Ferrisb5425052024-04-23 17:15:39 -0700175 "libscudo",
176 ],
177 cflags: [
178 "-DUSE_SCUDO",
Christopher Ferrise55e5ee2019-10-01 17:54:42 -0700179 ],
Mitch Phillipsf3968e82020-01-31 19:57:04 -0800180 header_libs: ["gwp_asan_headers"],
Christopher Ferrisb5425052024-04-23 17:15:39 -0700181 product_variables: {
182 malloc_low_memory: {
183 cflags: ["-UUSE_SCUDO"],
184 whole_static_libs: [
185 "libjemalloc5",
186 "libc_jemalloc_wrapper",
187 ],
188 exclude_static_libs: [
189 "libscudo",
190 ],
191 },
192 },
Christopher Ferrise55e5ee2019-10-01 17:54:42 -0700193}
194
195// Functions not implemented by jemalloc directly, or that need to
196// be modified for Android.
197cc_library_static {
198 name: "libc_jemalloc_wrapper",
199 defaults: ["libc_defaults"],
200 srcs: ["bionic/jemalloc_wrapper.cpp"],
201 cflags: ["-fvisibility=hidden"],
202
Christopher Ferris4df29ed2020-01-24 18:06:42 -0800203 // Used to pull in the jemalloc include directory so that if the
204 // library is removed, the include directory is also removed.
205 static_libs: ["libjemalloc5"],
Christopher Ferrise55e5ee2019-10-01 17:54:42 -0700206}
207
Dan Willemsen208ae172015-09-16 16:33:27 -0700208// ========================================================
Ryan Prichard249757b2019-11-01 17:18:28 -0700209// libc_bootstrap.a - -fno-stack-protector and -ffreestanding
Dan Willemsen208ae172015-09-16 16:33:27 -0700210// ========================================================
211//
Ryan Prichard249757b2019-11-01 17:18:28 -0700212// Code that implements the stack protector (or that runs before TLS has been set up) needs to be
213// compiled with -fno-stack-protector, since it accesses the stack canary TLS slot. In the linker,
214// some of this code runs before ifunc resolvers have made string.h functions work, so compile with
215// -ffreestanding.
Dan Willemsen208ae172015-09-16 16:33:27 -0700216
217cc_library_static {
218
Colin Crossa3f9fca2016-01-11 13:20:55 -0800219 srcs: [
220 "bionic/__libc_init_main_thread.cpp",
221 "bionic/__stack_chk_fail.cpp",
Ryan Prichard249757b2019-11-01 17:18:28 -0700222 "bionic/bionic_call_ifunc_resolver.cpp",
223 "bionic/getauxval.cpp",
Colin Crossa3f9fca2016-01-11 13:20:55 -0800224 ],
225 arch: {
Colin Crossa3f9fca2016-01-11 13:20:55 -0800226 x86: {
Ryan Prichard27475b52018-05-17 17:14:18 -0700227 srcs: [
228 "arch-x86/bionic/__libc_init_sysinfo.cpp",
Pirama Arumuga Nainar7b89be72021-02-12 15:09:49 -0800229 "arch-x86/bionic/__libc_int0x80.S",
Ryan Prichard27475b52018-05-17 17:14:18 -0700230 "arch-x86/bionic/__set_tls.cpp",
231 ],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800232 },
Colin Crossa3f9fca2016-01-11 13:20:55 -0800233 },
234
Colin Cross50c21ab2015-10-31 23:03:05 -0700235 defaults: ["libc_defaults"],
Elliott Hughes1eacc0e2024-01-19 19:05:36 +0000236 cflags: [
237 "-fno-stack-protector",
238 "-ffreestanding",
239 ],
Ryan Prichard249757b2019-11-01 17:18:28 -0700240 name: "libc_bootstrap",
Dan Willemsen208ae172015-09-16 16:33:27 -0700241}
242
Kalesh Singhf0050fb2023-12-15 10:02:01 -0800243filegroup {
244 name: "elf_note_sources",
245 srcs: ["bionic/elf_note.cpp"],
246}
247
Ryan Prichard249757b2019-11-01 17:18:28 -0700248// libc_init_static.cpp and libc_init_dynamic.cpp need to be built without stack protector.
249// libc_init_static.cpp sets up TLS for static executables, and libc_init_dynamic.cpp initializes
250// the stack protector global variable.
Colin Crossa3f9fca2016-01-11 13:20:55 -0800251
252cc_library_static {
253 name: "libc_init_static",
254 defaults: ["libc_defaults"],
Kalesh Singhf0050fb2023-12-15 10:02:01 -0800255 srcs: [
Florian Mayera6e9dcf2024-11-06 12:41:22 -0800256 "bionic/libc_init_mte.cpp",
Kalesh Singhf0050fb2023-12-15 10:02:01 -0800257 "bionic/libc_init_static.cpp",
258 ":elf_note_sources",
259 ],
Ryan Prichard249757b2019-11-01 17:18:28 -0700260 cflags: [
261 "-fno-stack-protector",
262
263 // Compile libc_init_static.cpp with -ffreestanding, because some of its code is called
264 // from the linker before ifunc resolvers have made string.h functions available.
265 "-ffreestanding",
266 ],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800267}
268
Stephen Cranef4b1cbd2017-05-09 14:27:43 -0700269cc_library_static {
270 name: "libc_init_dynamic",
271 defaults: ["libc_defaults"],
272 srcs: ["bionic/libc_init_dynamic.cpp"],
273 cflags: ["-fno-stack-protector"],
274}
Colin Crossa3f9fca2016-01-11 13:20:55 -0800275
Dan Willemsen208ae172015-09-16 16:33:27 -0700276// ========================================================
277// libc_tzcode.a - upstream 'tzcode' code
278// ========================================================
279
280cc_library_static {
281
Colin Cross50c21ab2015-10-31 23:03:05 -0700282 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700283 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800284 "tzcode/**/*.c",
Elliott Hughes0e8616a2017-04-11 14:44:51 -0700285 "tzcode/bionic.cpp",
Elliott Hughes2bd43162023-06-15 13:17:08 -0700286 // tzcode doesn't include strptime, so we use a fork of the
287 // OpenBSD code which needs this global data.
Elliott Hughesd3627a42022-12-06 22:24:27 +0000288 "upstream-openbsd/lib/libc/locale/_def_time.c",
Elliott Hughes2bd43162023-06-15 13:17:08 -0700289 // tzcode doesn't include wcsftime, so we use the FreeBSD code.
290 "upstream-freebsd/lib/libc/locale/wcsftime.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700291 ],
292
Colin Cross50c21ab2015-10-31 23:03:05 -0700293 cflags: [
Dan Willemsen268a6732015-10-15 14:49:45 -0700294 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700295 // Don't use ridiculous amounts of stack.
296 "-DALL_STATE",
297 // Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
298 "-DSTD_INSPIRED",
Colin Crossa35d23d2015-11-19 13:32:49 -0800299 // Obviously, we want to be thread-safe.
Almaz Mingaleev5411aff2022-02-11 12:27:12 +0000300 "-DTHREAD_SAFE=1",
Dan Willemsen208ae172015-09-16 16:33:27 -0700301 // The name of the tm_gmtoff field in our struct tm.
302 "-DTM_GMTOFF=tm_gmtoff",
Elliott Hughes31fc69f2023-06-20 15:36:11 -0700303 // Android uses a system property instead of /etc/localtime, so make callers crash.
Almaz Mingaleeva52a0da2022-02-28 16:55:50 +0000304 "-DTZDEFAULT=NULL",
Dan Willemsen208ae172015-09-16 16:33:27 -0700305 // Where we store our tzdata.
Colin Cross7b294952016-09-29 14:08:13 -0700306 "-DTZDIR=\"/system/usr/share/zoneinfo\"",
Elliott Hughes0a610d02016-07-29 14:04:17 -0700307 // Include `tzname`, `timezone`, and `daylight` globals.
308 "-DHAVE_POSIX_DECLS=0",
Almaz Mingaleev5411aff2022-02-11 12:27:12 +0000309 "-DUSG_COMPAT=2",
310 "-DHAVE_TZNAME=2",
311 // stdbool.h is available
312 "-DHAVE_STDBOOL_H",
Colin Crossa35d23d2015-11-19 13:32:49 -0800313 // Use the empty string (instead of " ") as the timezone abbreviation
314 // fallback.
Colin Cross7b294952016-09-29 14:08:13 -0700315 "-DWILDABBR=\"\"",
Dan Willemsen208ae172015-09-16 16:33:27 -0700316 "-Dlint",
317 ],
318
Elliott Hughes2bd43162023-06-15 13:17:08 -0700319 local_include_dirs: [
320 "tzcode/",
321 "upstream-freebsd/android/include",
322 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700323 name: "libc_tzcode",
Dan Willemsen208ae172015-09-16 16:33:27 -0700324}
325
326// ========================================================
327// libc_dns.a - modified NetBSD DNS code
328// ========================================================
329
330cc_library_static {
331
Colin Cross50c21ab2015-10-31 23:03:05 -0700332 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700333 srcs: [
Elliott Hughesd0bbfa82021-04-08 11:58:51 -0700334 "dns/**/*.c*",
Dan Willemsen208ae172015-09-16 16:33:27 -0700335
336 "upstream-netbsd/lib/libc/isc/ev_streams.c",
337 "upstream-netbsd/lib/libc/isc/ev_timers.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700338 ],
339
Colin Cross50c21ab2015-10-31 23:03:05 -0700340 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700341 "-DANDROID_CHANGES",
342 "-DINET6",
Dan Willemsen208ae172015-09-16 16:33:27 -0700343 "-Wno-unused-parameter",
344 "-include netbsd-compat.h",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700345 "-Wframe-larger-than=66000",
Dan Willemsen208ae172015-09-16 16:33:27 -0700346 ],
347
Dan Willemsen208ae172015-09-16 16:33:27 -0700348 local_include_dirs: [
349 "dns/include",
350 "private",
351 "upstream-netbsd/lib/libc/include",
352 "upstream-netbsd/android/include",
353 ],
354
355 name: "libc_dns",
Dan Willemsen208ae172015-09-16 16:33:27 -0700356}
357
358// ========================================================
359// libc_freebsd.a - upstream FreeBSD C library code
360// ========================================================
361//
362// These files are built with the freebsd-compat.h header file
363// automatically included.
364
365cc_library_static {
Elliott Hughesc2043342023-07-20 20:24:09 +0000366 name: "libc_freebsd_ldexp",
367 defaults: ["libc_defaults"],
368 cflags: ["-Dscalbn=ldexp"],
369 srcs: [":libc_ldexp_srcs"],
370}
371
372cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700373 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700374 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700375 "upstream-freebsd/lib/libc/stdlib/getopt_long.c",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700376 "upstream-freebsd/lib/libc/stdlib/hcreate.c",
377 "upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
378 "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c",
379 "upstream-freebsd/lib/libc/stdlib/hsearch_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700380 "upstream-freebsd/lib/libc/stdlib/qsort.c",
Elliott Hughes5bae5722024-07-30 12:47:33 -0400381 "upstream-freebsd/lib/libc/stdlib/qsort_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700382 "upstream-freebsd/lib/libc/stdlib/quick_exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700383 "upstream-freebsd/lib/libc/string/wcpcpy.c",
384 "upstream-freebsd/lib/libc/string/wcpncpy.c",
385 "upstream-freebsd/lib/libc/string/wcscasecmp.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700386 "upstream-freebsd/lib/libc/string/wcscat.c",
387 "upstream-freebsd/lib/libc/string/wcschr.c",
388 "upstream-freebsd/lib/libc/string/wcscmp.c",
389 "upstream-freebsd/lib/libc/string/wcscpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700390 "upstream-freebsd/lib/libc/string/wcscspn.c",
391 "upstream-freebsd/lib/libc/string/wcsdup.c",
392 "upstream-freebsd/lib/libc/string/wcslcat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700393 "upstream-freebsd/lib/libc/string/wcslen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700394 "upstream-freebsd/lib/libc/string/wcsncasecmp.c",
395 "upstream-freebsd/lib/libc/string/wcsncat.c",
396 "upstream-freebsd/lib/libc/string/wcsncmp.c",
397 "upstream-freebsd/lib/libc/string/wcsncpy.c",
398 "upstream-freebsd/lib/libc/string/wcsnlen.c",
399 "upstream-freebsd/lib/libc/string/wcspbrk.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700400 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700401 "upstream-freebsd/lib/libc/string/wcsspn.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700402 "upstream-freebsd/lib/libc/string/wcsstr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700403 "upstream-freebsd/lib/libc/string/wcstok.c",
404 "upstream-freebsd/lib/libc/string/wmemchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700405 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700406 "upstream-freebsd/lib/libc/string/wmemcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700407 "upstream-freebsd/lib/libc/string/wmemmove.c",
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800408 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700409 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700410
Colin Cross50c21ab2015-10-31 23:03:05 -0700411 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700412 "-Wno-sign-compare",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700413 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700414 "-include freebsd-compat.h",
415 ],
416
Dan Willemsen208ae172015-09-16 16:33:27 -0700417 local_include_dirs: [
418 "upstream-freebsd/android/include",
419 ],
420
421 name: "libc_freebsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700422}
423
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700424cc_library_static {
425 defaults: ["libc_defaults"],
426 srcs: [
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700427 "upstream-freebsd/lib/libc/gen/glob.c",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700428 ],
429
430 cflags: [
431 "-Wno-sign-compare",
432 "-include freebsd-compat.h",
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700433 "-Wframe-larger-than=66000",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700434 ],
435
436 local_include_dirs: [
437 "upstream-freebsd/android/include",
438 ],
439
440 name: "libc_freebsd_large_stack",
441}
442
Dan Willemsen208ae172015-09-16 16:33:27 -0700443// ========================================================
444// libc_netbsd.a - upstream NetBSD C library code
445// ========================================================
446//
447// These files are built with the netbsd-compat.h header file
448// automatically included.
449
450cc_library_static {
451
Colin Cross50c21ab2015-10-31 23:03:05 -0700452 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700453 srcs: [
454 "upstream-netbsd/common/lib/libc/stdlib/random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700455 "upstream-netbsd/lib/libc/gen/nice.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700456 "upstream-netbsd/lib/libc/gen/psignal.c",
457 "upstream-netbsd/lib/libc/gen/utime.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700458 "upstream-netbsd/lib/libc/inet/nsap_addr.c",
459 "upstream-netbsd/lib/libc/regex/regcomp.c",
460 "upstream-netbsd/lib/libc/regex/regerror.c",
461 "upstream-netbsd/lib/libc/regex/regexec.c",
462 "upstream-netbsd/lib/libc/regex/regfree.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700463 "upstream-netbsd/lib/libc/stdlib/drand48.c",
464 "upstream-netbsd/lib/libc/stdlib/erand48.c",
465 "upstream-netbsd/lib/libc/stdlib/jrand48.c",
466 "upstream-netbsd/lib/libc/stdlib/lcong48.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700467 "upstream-netbsd/lib/libc/stdlib/lrand48.c",
468 "upstream-netbsd/lib/libc/stdlib/mrand48.c",
469 "upstream-netbsd/lib/libc/stdlib/nrand48.c",
470 "upstream-netbsd/lib/libc/stdlib/_rand48.c",
471 "upstream-netbsd/lib/libc/stdlib/rand_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700472 "upstream-netbsd/lib/libc/stdlib/seed48.c",
473 "upstream-netbsd/lib/libc/stdlib/srand48.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700474 ],
475 multilib: {
476 lib32: {
477 // LP32 cruft
478 srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"],
479 },
480 },
Colin Cross50c21ab2015-10-31 23:03:05 -0700481 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700482 "-Wno-sign-compare",
Dan Willemsen879cec22016-02-29 10:37:56 -0800483 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700484 "-DPOSIX_MISTAKE",
485 "-include netbsd-compat.h",
486 ],
487
Dan Willemsen208ae172015-09-16 16:33:27 -0700488 local_include_dirs: [
489 "upstream-netbsd/android/include",
490 "upstream-netbsd/lib/libc/include",
491 ],
492
493 name: "libc_netbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700494}
495
496// ========================================================
Elliott Hughes968adf92024-02-08 13:15:53 -0800497// libc_openbsd.a - upstream OpenBSD C library code
Dan Willemsen208ae172015-09-16 16:33:27 -0700498// ========================================================
499//
500// These files are built with the openbsd-compat.h header file
501// automatically included.
Dan Willemsen208ae172015-09-16 16:33:27 -0700502cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700503 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700504 srcs: [
Elliott Hughes968adf92024-02-08 13:15:53 -0800505 "upstream-openbsd/lib/libc/crypt/arc4random.c",
506 "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700507 "upstream-openbsd/lib/libc/gen/alarm.c",
508 "upstream-openbsd/lib/libc/gen/ctype_.c",
509 "upstream-openbsd/lib/libc/gen/daemon.c",
510 "upstream-openbsd/lib/libc/gen/err.c",
511 "upstream-openbsd/lib/libc/gen/errx.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700512 "upstream-openbsd/lib/libc/gen/fnmatch.c",
513 "upstream-openbsd/lib/libc/gen/ftok.c",
514 "upstream-openbsd/lib/libc/gen/getprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700515 "upstream-openbsd/lib/libc/gen/setprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700516 "upstream-openbsd/lib/libc/gen/verr.c",
517 "upstream-openbsd/lib/libc/gen/verrx.c",
518 "upstream-openbsd/lib/libc/gen/vwarn.c",
519 "upstream-openbsd/lib/libc/gen/vwarnx.c",
520 "upstream-openbsd/lib/libc/gen/warn.c",
521 "upstream-openbsd/lib/libc/gen/warnx.c",
522 "upstream-openbsd/lib/libc/locale/btowc.c",
523 "upstream-openbsd/lib/libc/locale/mbrlen.c",
524 "upstream-openbsd/lib/libc/locale/mbstowcs.c",
525 "upstream-openbsd/lib/libc/locale/mbtowc.c",
526 "upstream-openbsd/lib/libc/locale/wcscoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700527 "upstream-openbsd/lib/libc/locale/wcstombs.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700528 "upstream-openbsd/lib/libc/locale/wcsxfrm.c",
529 "upstream-openbsd/lib/libc/locale/wctob.c",
530 "upstream-openbsd/lib/libc/locale/wctomb.c",
Elliott Hughes26fda772016-04-06 11:56:41 -0700531 "upstream-openbsd/lib/libc/net/base64.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700532 "upstream-openbsd/lib/libc/net/htonl.c",
533 "upstream-openbsd/lib/libc/net/htons.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700534 "upstream-openbsd/lib/libc/net/inet_lnaof.c",
535 "upstream-openbsd/lib/libc/net/inet_makeaddr.c",
536 "upstream-openbsd/lib/libc/net/inet_netof.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700537 "upstream-openbsd/lib/libc/net/inet_ntoa.c",
538 "upstream-openbsd/lib/libc/net/inet_ntop.c",
539 "upstream-openbsd/lib/libc/net/inet_pton.c",
540 "upstream-openbsd/lib/libc/net/ntohl.c",
541 "upstream-openbsd/lib/libc/net/ntohs.c",
Colin Cross8ce38af2016-01-19 12:50:20 -0800542 "upstream-openbsd/lib/libc/net/res_random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700543 "upstream-openbsd/lib/libc/stdio/fgetln.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700544 "upstream-openbsd/lib/libc/stdio/fgetwc.c",
545 "upstream-openbsd/lib/libc/stdio/fgetws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700546 "upstream-openbsd/lib/libc/stdio/flags.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700547 "upstream-openbsd/lib/libc/stdio/fputwc.c",
548 "upstream-openbsd/lib/libc/stdio/fputws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700549 "upstream-openbsd/lib/libc/stdio/fvwrite.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700550 "upstream-openbsd/lib/libc/stdio/fwide.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700551 "upstream-openbsd/lib/libc/stdio/getdelim.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700552 "upstream-openbsd/lib/libc/stdio/gets.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700553 "upstream-openbsd/lib/libc/stdio/makebuf.c",
554 "upstream-openbsd/lib/libc/stdio/mktemp.c",
555 "upstream-openbsd/lib/libc/stdio/open_memstream.c",
556 "upstream-openbsd/lib/libc/stdio/open_wmemstream.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700557 "upstream-openbsd/lib/libc/stdio/rget.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700558 "upstream-openbsd/lib/libc/stdio/setvbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700559 "upstream-openbsd/lib/libc/stdio/ungetc.c",
560 "upstream-openbsd/lib/libc/stdio/ungetwc.c",
561 "upstream-openbsd/lib/libc/stdio/vasprintf.c",
562 "upstream-openbsd/lib/libc/stdio/vdprintf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700563 "upstream-openbsd/lib/libc/stdio/vsscanf.c",
564 "upstream-openbsd/lib/libc/stdio/vswprintf.c",
565 "upstream-openbsd/lib/libc/stdio/vswscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700566 "upstream-openbsd/lib/libc/stdio/wbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700567 "upstream-openbsd/lib/libc/stdio/wsetup.c",
568 "upstream-openbsd/lib/libc/stdlib/abs.c",
Elliott Hughes01809e12019-02-05 16:48:22 -0800569 "upstream-openbsd/lib/libc/stdlib/div.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700570 "upstream-openbsd/lib/libc/stdlib/getenv.c",
Colin Crossb8396102016-04-07 13:24:50 -0700571 "upstream-openbsd/lib/libc/stdlib/getsubopt.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700572 "upstream-openbsd/lib/libc/stdlib/insque.c",
573 "upstream-openbsd/lib/libc/stdlib/imaxabs.c",
574 "upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
575 "upstream-openbsd/lib/libc/stdlib/labs.c",
Elliott Hughes01809e12019-02-05 16:48:22 -0800576 "upstream-openbsd/lib/libc/stdlib/ldiv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700577 "upstream-openbsd/lib/libc/stdlib/llabs.c",
Elliott Hughes01809e12019-02-05 16:48:22 -0800578 "upstream-openbsd/lib/libc/stdlib/lldiv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700579 "upstream-openbsd/lib/libc/stdlib/lsearch.c",
Elliott Hughes26b06072020-07-31 11:00:10 -0700580 "upstream-openbsd/lib/libc/stdlib/recallocarray.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700581 "upstream-openbsd/lib/libc/stdlib/remque.c",
582 "upstream-openbsd/lib/libc/stdlib/setenv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700583 "upstream-openbsd/lib/libc/stdlib/tfind.c",
584 "upstream-openbsd/lib/libc/stdlib/tsearch.c",
Elliott Hughesfbac97a2019-02-04 16:46:24 -0800585 "upstream-openbsd/lib/libc/string/memccpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700586 "upstream-openbsd/lib/libc/string/strcasecmp.c",
Elliott Hughesfbac97a2019-02-04 16:46:24 -0800587 "upstream-openbsd/lib/libc/string/strcasestr.c",
588 "upstream-openbsd/lib/libc/string/strcoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700589 "upstream-openbsd/lib/libc/string/strcspn.c",
590 "upstream-openbsd/lib/libc/string/strdup.c",
591 "upstream-openbsd/lib/libc/string/strndup.c",
592 "upstream-openbsd/lib/libc/string/strpbrk.c",
593 "upstream-openbsd/lib/libc/string/strsep.c",
594 "upstream-openbsd/lib/libc/string/strspn.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700595 "upstream-openbsd/lib/libc/string/strtok.c",
Elliott Hughesfbac97a2019-02-04 16:46:24 -0800596 "upstream-openbsd/lib/libc/string/strxfrm.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700597 "upstream-openbsd/lib/libc/string/wcslcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700598 "upstream-openbsd/lib/libc/string/wcswidth.c",
Colin Cross69bcb8b2021-09-08 13:24:16 -0700599
Elliott Hughesd4c61182024-08-16 17:31:24 -0400600 // These files are originally from OpenBSD,
601 // and benefit from being compiled with openbsd-compat.h.
602 // TODO: clean them up instead.
Colin Cross69bcb8b2021-09-08 13:24:16 -0700603 "bionic/fts.c",
Elliott Hughesd4c61182024-08-16 17:31:24 -0400604 "stdio/vfprintf.cpp",
605 "stdio/vfwprintf.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700606 ],
607
Elliott Hughes7d136662023-10-27 15:40:32 -0700608 // Each architecture has optimized versions of some routines,
609 // and only includes the portable C versions of ones it's missing.
Dan Willemsen208ae172015-09-16 16:33:27 -0700610 arch: {
611 arm: {
Elliott Hughes7d136662023-10-27 15:40:32 -0700612 srcs: [
Elliott Hughes7d136662023-10-27 15:40:32 -0700613 "upstream-openbsd/lib/libc/string/stpncpy.c",
Elliott Hughes7d136662023-10-27 15:40:32 -0700614 "upstream-openbsd/lib/libc/string/strncat.c",
615 "upstream-openbsd/lib/libc/string/strncmp.c",
616 "upstream-openbsd/lib/libc/string/strncpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700617 ],
618 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700619 arm64: {
Elliott Hughes7d136662023-10-27 15:40:32 -0700620 srcs: [
Elliott Hughes7d136662023-10-27 15:40:32 -0700621 "upstream-openbsd/lib/libc/string/strcat.c",
Elliott Hughesaefe9992023-11-08 12:04:41 -0800622 "upstream-openbsd/lib/libc/string/stpncpy.c",
Elliott Hughes7d136662023-10-27 15:40:32 -0700623 "upstream-openbsd/lib/libc/string/strncat.c",
624 "upstream-openbsd/lib/libc/string/strncpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700625 ],
626 },
Elliott Hughesebc19a92022-10-14 23:25:36 +0000627 riscv64: {
628 srcs: [
Elliott Hughes7d136662023-10-27 15:40:32 -0700629 "upstream-openbsd/lib/libc/string/stpncpy.c",
Elliott Hughesebc19a92022-10-14 23:25:36 +0000630 ],
631 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700632 x86: {
Elliott Hughesaefe9992023-11-08 12:04:41 -0800633 srcs: [
634 // x86 has custom implementations of all of these.
635 ],
Elliott Hughes7d136662023-10-27 15:40:32 -0700636 },
637 x86_64: {
638 srcs: [
George Burgess IV414bfb32024-11-19 09:00:39 -0700639 // x86_64 has custom/llvm-libc implementations of all of these.
Colin Cross6ab8f892015-11-23 14:12:15 -0800640 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700641 },
642 },
643
Colin Cross50c21ab2015-10-31 23:03:05 -0700644 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700645 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700646 "-Wno-unused-parameter",
647 "-include openbsd-compat.h",
648 ],
649
Dan Willemsen208ae172015-09-16 16:33:27 -0700650 local_include_dirs: [
651 "private",
Elliott Hughes968adf92024-02-08 13:15:53 -0800652 "stdio",
Elliott Hughesd4c61182024-08-16 17:31:24 -0400653 "upstream-openbsd/android/include/",
654 "upstream-openbsd/lib/libc/gdtoa/",
655 "upstream-openbsd/lib/libc/include/",
656 "upstream-openbsd/lib/libc/stdio/",
Dan Willemsen208ae172015-09-16 16:33:27 -0700657 ],
658
659 name: "libc_openbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700660}
661
Elliott Hughes968adf92024-02-08 13:15:53 -0800662cc_library_static {
663 name: "libc_openbsd_large_stack",
664 defaults: ["libc_defaults"],
665 srcs: [
Elliott Hughes968adf92024-02-08 13:15:53 -0800666 "upstream-openbsd/lib/libc/string/memmem.c",
667 "upstream-openbsd/lib/libc/string/strstr.c",
668 ],
669 cflags: [
670 "-include openbsd-compat.h",
671 "-Wno-sign-compare",
672 "-Wframe-larger-than=5000",
673 ],
674
675 local_include_dirs: [
Elliott Hughes968adf92024-02-08 13:15:53 -0800676 "upstream-openbsd/android/include/",
Elliott Hughes968adf92024-02-08 13:15:53 -0800677 ],
678}
679
Dan Willemsen208ae172015-09-16 16:33:27 -0700680// ========================================================
681// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
682// ========================================================
683//
684// These files are built with the openbsd-compat.h header file
685// automatically included.
686
687cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700688 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700689 srcs: [
690 "upstream-openbsd/android/gdtoa_support.cpp",
691 "upstream-openbsd/lib/libc/gdtoa/dmisc.c",
692 "upstream-openbsd/lib/libc/gdtoa/dtoa.c",
693 "upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
694 "upstream-openbsd/lib/libc/gdtoa/gethex.c",
695 "upstream-openbsd/lib/libc/gdtoa/gmisc.c",
696 "upstream-openbsd/lib/libc/gdtoa/hd_init.c",
697 "upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
698 "upstream-openbsd/lib/libc/gdtoa/hexnan.c",
699 "upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
700 "upstream-openbsd/lib/libc/gdtoa/misc.c",
701 "upstream-openbsd/lib/libc/gdtoa/smisc.c",
702 "upstream-openbsd/lib/libc/gdtoa/strtod.c",
703 "upstream-openbsd/lib/libc/gdtoa/strtodg.c",
704 "upstream-openbsd/lib/libc/gdtoa/strtof.c",
705 "upstream-openbsd/lib/libc/gdtoa/strtord.c",
706 "upstream-openbsd/lib/libc/gdtoa/sum.c",
707 "upstream-openbsd/lib/libc/gdtoa/ulp.c",
708 ],
709 multilib: {
710 lib64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800711 srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700712 },
713 },
714
Colin Cross50c21ab2015-10-31 23:03:05 -0700715 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700716 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700717 "-include openbsd-compat.h",
718 ],
719
Dan Willemsen208ae172015-09-16 16:33:27 -0700720 local_include_dirs: [
721 "private",
722 "upstream-openbsd/android/include",
723 "upstream-openbsd/lib/libc/include",
724 ],
725
726 name: "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -0700727}
728
729// ========================================================
Pierre-Clément Tosi467e58e2023-02-01 13:44:43 +0000730// libc_fortify.a - container for our FORTIFY
George Burgess IV6cb06872017-07-21 13:28:42 -0700731// implementation details
732// ========================================================
733cc_library_static {
734 defaults: ["libc_defaults"],
George Burgess IVd34b0a92017-07-25 11:43:39 -0700735 srcs: ["bionic/fortify.cpp"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700736
737 name: "libc_fortify",
738
739 // Disable FORTIFY for the compilation of these, so we don't end up having
740 // FORTIFY silently call itself.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800741 cflags: [
742 "-U_FORTIFY_SOURCE",
743 "-D__BIONIC_DECLARE_FORTIFY_HELPERS",
744 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700745
746 arch: {
747 arm: {
Haibo Huangf1c8d1a2018-11-27 15:38:47 -0800748 cflags: [
Haibo Huangf1c8d1a2018-11-27 15:38:47 -0800749 "-DRENAME___STRCAT_CHK",
750 "-DRENAME___STRCPY_CHK",
751 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700752 srcs: [
753 "arch-arm/generic/bionic/__memcpy_chk.S",
Haibo Huangf1c8d1a2018-11-27 15:38:47 -0800754
755 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
756 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
757
758 "arch-arm/cortex-a7/bionic/__strcat_chk.S",
759 "arch-arm/cortex-a7/bionic/__strcpy_chk.S",
760
761 "arch-arm/cortex-a9/bionic/__strcat_chk.S",
762 "arch-arm/cortex-a9/bionic/__strcpy_chk.S",
763
764 "arch-arm/krait/bionic/__strcat_chk.S",
765 "arch-arm/krait/bionic/__strcpy_chk.S",
766
767 "arch-arm/cortex-a53/bionic/__strcat_chk.S",
768 "arch-arm/cortex-a53/bionic/__strcpy_chk.S",
769
Haibo Huang01bfd892018-12-03 15:05:16 -0800770 "arch-arm/cortex-a55/bionic/__strcat_chk.S",
771 "arch-arm/cortex-a55/bionic/__strcpy_chk.S",
George Burgess IV6cb06872017-07-21 13:28:42 -0700772 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700773 },
774 arm64: {
775 srcs: [
Elliott Hughes023e4e72022-11-17 19:27:02 +0000776 "arch-arm64/string/__memcpy_chk.S",
777 "arch-arm64/string/__memset_chk.S",
George Burgess IV6cb06872017-07-21 13:28:42 -0700778 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700779 },
780 },
781}
782
783// ========================================================
Manish Goregaokar361854c2025-03-05 15:02:28 -0800784// icu4x_bionic.a - Thin Rust wrapper around ICU4X
785// ========================================================
786
787rust_ffi_static {
788 name: "libicu4x_bionic",
789 crate_name: "icu4x_bionic",
790 crate_root: "bionic/icu4x.rs",
791 edition: "2021",
792 features: [],
793 rustlibs: [
794 "//external/rust/android-crates-io/crates/icu_casemap:libicu_casemap",
795 "//external/rust/android-crates-io/crates/icu_collections:libicu_collections",
796 "//external/rust/android-crates-io/crates/icu_properties:libicu_properties",
797 ],
798 apex_available: [
799 "//apex_available:platform",
800 "//apex_available:anyapex",
801 ],
802 vendor_available: true,
803 product_available: true,
804 ramdisk_available: true,
805 vendor_ramdisk_available: true,
806 recovery_available: true,
807 native_bridge_supported: true,
808 sdk_version: "minimum",
809 defaults: ["linux_bionic_supported"],
810}
811
812// current rust implementation detail; will be removed as part of a larger cleanup later
813// go/android-mto-staticlibs-in-make
814cc_rustlibs_for_make {
815 name: "libstatic_rustlibs_for_make",
816 whole_static_libs: ["libicu4x_bionic"],
817 apex_available: [
818 "//apex_available:platform",
819 "//apex_available:anyapex",
820 ],
821 vendor_available: true,
822 product_available: true,
823 ramdisk_available: true,
824 vendor_ramdisk_available: true,
825 recovery_available: true,
826 native_bridge_supported: true,
827 defaults: ["linux_bionic_supported"],
828}
829
830// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -0700831// libc_bionic.a - home-grown C library code
832// ========================================================
833
834cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700835 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700836 srcs: [
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -0800837 "bionic/NetdClientDispatch.cpp",
838 "bionic/__bionic_get_shell_path.cpp",
839 "bionic/__cmsg_nxthdr.cpp",
840 "bionic/__cxa_thread_atexit_impl.cpp",
841 "bionic/__errno.cpp",
842 "bionic/__gnu_basename.cpp",
843 "bionic/__libc_current_sigrtmax.cpp",
844 "bionic/__libc_current_sigrtmin.cpp",
845 "bionic/abort.cpp",
846 "bionic/accept.cpp",
847 "bionic/access.cpp",
Florian Mayerca4749a2024-02-14 12:55:46 -0800848 "bionic/android_crash_detail.cpp",
Josh Gao10ec9282017-04-03 15:13:29 -0700849 "bionic/android_set_abort_message.cpp",
Elliott Hughesb0948922024-01-26 00:28:12 +0000850 "bionic/android_unsafe_frame_pointer_chase.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -0800851 "bionic/arpa_inet.cpp",
852 "bionic/assert.cpp",
Elliott Hughesb0948922024-01-26 00:28:12 +0000853 "bionic/atexit.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -0800854 "bionic/atof.cpp",
855 "bionic/bionic_allocator.cpp",
856 "bionic/bionic_arc4random.cpp",
Elliott Hughesb0948922024-01-26 00:28:12 +0000857 "bionic/bionic_elf_tls.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -0800858 "bionic/bionic_futex.cpp",
859 "bionic/bionic_netlink.cpp",
860 "bionic/bionic_systrace.cpp",
861 "bionic/bionic_time_conversions.cpp",
862 "bionic/brk.cpp",
863 "bionic/c16rtomb.cpp",
864 "bionic/c32rtomb.cpp",
865 "bionic/chmod.cpp",
866 "bionic/chown.cpp",
867 "bionic/clearenv.cpp",
868 "bionic/clock.cpp",
869 "bionic/clock_getcpuclockid.cpp",
870 "bionic/clock_nanosleep.cpp",
871 "bionic/clone.cpp",
872 "bionic/ctype.cpp",
873 "bionic/dirent.cpp",
874 "bionic/dup.cpp",
875 "bionic/environ.cpp",
876 "bionic/error.cpp",
877 "bionic/eventfd.cpp",
878 "bionic/exec.cpp",
879 "bionic/execinfo.cpp",
Elliott Hughes69bd8e92024-02-09 10:04:26 -0800880 "bionic/exit.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -0800881 "bionic/faccessat.cpp",
882 "bionic/fchmod.cpp",
883 "bionic/fchmodat.cpp",
884 "bionic/fcntl.cpp",
885 "bionic/fdsan.cpp",
886 "bionic/fdtrack.cpp",
887 "bionic/ffs.cpp",
888 "bionic/fgetxattr.cpp",
889 "bionic/flistxattr.cpp",
Elliott Hughesb0948922024-01-26 00:28:12 +0000890 "bionic/fork.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -0800891 "bionic/fpclassify.cpp",
892 "bionic/fsetxattr.cpp",
893 "bionic/ftruncate.cpp",
894 "bionic/ftw.cpp",
895 "bionic/futimens.cpp",
896 "bionic/getcwd.cpp",
897 "bionic/getdomainname.cpp",
898 "bionic/getentropy.cpp",
899 "bionic/gethostname.cpp",
900 "bionic/getloadavg.cpp",
901 "bionic/getpagesize.cpp",
902 "bionic/getpgrp.cpp",
903 "bionic/getpid.cpp",
904 "bionic/getpriority.cpp",
905 "bionic/gettid.cpp",
906 "bionic/get_device_api_level.cpp",
907 "bionic/grp_pwd.cpp",
908 "bionic/grp_pwd_file.cpp",
909 "bionic/heap_zero_init.cpp",
910 "bionic/iconv.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -0800911 "bionic/ifaddrs.cpp",
912 "bionic/inotify_init.cpp",
913 "bionic/ioctl.cpp",
Elliott Hughes17e40682024-02-13 16:32:29 -0800914 "bionic/isatty.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -0800915 "bionic/killpg.cpp",
916 "bionic/langinfo.cpp",
Elliott Hughes219e6022024-08-27 19:12:08 +0000917 "bionic/lchmod.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -0800918 "bionic/lchown.cpp",
919 "bionic/lfs64_support.cpp",
920 "bionic/libc_init_common.cpp",
921 "bionic/libgen.cpp",
922 "bionic/link.cpp",
923 "bionic/locale.cpp",
924 "bionic/lockf.cpp",
925 "bionic/lstat.cpp",
926 "bionic/mblen.cpp",
927 "bionic/mbrtoc16.cpp",
928 "bionic/mbrtoc32.cpp",
929 "bionic/mempcpy.cpp",
930 "bionic/memset_explicit.cpp",
931 "bionic/mkdir.cpp",
932 "bionic/mkfifo.cpp",
933 "bionic/mknod.cpp",
934 "bionic/mntent.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -0800935 "bionic/netdb.cpp",
Elliott Hughes3ed6e722024-02-16 01:18:01 +0000936 "bionic/net_if.cpp",
937 "bionic/netinet_ether.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -0800938 "bionic/netinet_in.cpp",
939 "bionic/nl_types.cpp",
940 "bionic/open.cpp",
941 "bionic/pathconf.cpp",
942 "bionic/pause.cpp",
943 "bionic/pidfd.cpp",
944 "bionic/pipe.cpp",
945 "bionic/poll.cpp",
946 "bionic/posix_fadvise.cpp",
947 "bionic/posix_fallocate.cpp",
948 "bionic/posix_madvise.cpp",
949 "bionic/posix_timers.cpp",
950 "bionic/preadv_pwritev.cpp",
Elliott Hughesb0948922024-01-26 00:28:12 +0000951 "bionic/pthread_atfork.cpp",
952 "bionic/pthread_attr.cpp",
953 "bionic/pthread_barrier.cpp",
954 "bionic/pthread_cond.cpp",
955 "bionic/pthread_create.cpp",
956 "bionic/pthread_detach.cpp",
957 "bionic/pthread_equal.cpp",
958 "bionic/pthread_exit.cpp",
Elliott Hughese117d6e2024-11-14 17:31:13 +0000959 "bionic/pthread_getaffinity.cpp",
Elliott Hughesb0948922024-01-26 00:28:12 +0000960 "bionic/pthread_getcpuclockid.cpp",
961 "bionic/pthread_getschedparam.cpp",
962 "bionic/pthread_gettid_np.cpp",
963 "bionic/pthread_internal.cpp",
964 "bionic/pthread_join.cpp",
965 "bionic/pthread_key.cpp",
966 "bionic/pthread_kill.cpp",
967 "bionic/pthread_mutex.cpp",
968 "bionic/pthread_once.cpp",
969 "bionic/pthread_rwlock.cpp",
970 "bionic/pthread_sigqueue.cpp",
971 "bionic/pthread_self.cpp",
972 "bionic/pthread_setname_np.cpp",
Elliott Hughese117d6e2024-11-14 17:31:13 +0000973 "bionic/pthread_setaffinity.cpp",
Elliott Hughesb0948922024-01-26 00:28:12 +0000974 "bionic/pthread_setschedparam.cpp",
975 "bionic/pthread_spinlock.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -0800976 "bionic/ptrace.cpp",
977 "bionic/pty.cpp",
978 "bionic/raise.cpp",
979 "bionic/rand.cpp",
980 "bionic/readlink.cpp",
981 "bionic/realpath.cpp",
982 "bionic/reboot.cpp",
983 "bionic/recv.cpp",
984 "bionic/recvmsg.cpp",
985 "bionic/rename.cpp",
986 "bionic/rmdir.cpp",
987 "bionic/scandir.cpp",
Elliott Hughes17e40682024-02-13 16:32:29 -0800988 "bionic/sched_cpualloc.cpp",
989 "bionic/sched_cpucount.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -0800990 "bionic/sched_getaffinity.cpp",
991 "bionic/sched_getcpu.cpp",
992 "bionic/semaphore.cpp",
993 "bionic/send.cpp",
994 "bionic/setegid.cpp",
995 "bionic/seteuid.cpp",
Elliott Hughesb0948922024-01-26 00:28:12 +0000996 "bionic/setjmp_cookie.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -0800997 "bionic/setpgrp.cpp",
998 "bionic/sigaction.cpp",
999 "bionic/signal.cpp",
1000 "bionic/sigprocmask.cpp",
1001 "bionic/sleep.cpp",
1002 "bionic/socketpair.cpp",
1003 "bionic/spawn.cpp",
1004 "bionic/stat.cpp",
1005 "bionic/stdlib_l.cpp",
1006 "bionic/strerror.cpp",
1007 "bionic/string_l.cpp",
1008 "bionic/strings_l.cpp",
1009 "bionic/strsignal.cpp",
1010 "bionic/strtol.cpp",
1011 "bionic/strtold.cpp",
1012 "bionic/swab.cpp",
1013 "bionic/symlink.cpp",
1014 "bionic/sync_file_range.cpp",
Elliott Hughesb0948922024-01-26 00:28:12 +00001015 "bionic/sysconf.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -08001016 "bionic/sys_epoll.cpp",
1017 "bionic/sys_msg.cpp",
1018 "bionic/sys_sem.cpp",
1019 "bionic/sys_shm.cpp",
1020 "bionic/sys_signalfd.cpp",
1021 "bionic/sys_statfs.cpp",
1022 "bionic/sys_statvfs.cpp",
Elliott Hughesb0948922024-01-26 00:28:12 +00001023 "bionic/sys_thread_properties.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -08001024 "bionic/sys_time.cpp",
1025 "bionic/sysinfo.cpp",
1026 "bionic/syslog.cpp",
Elliott Hughes69bd8e92024-02-09 10:04:26 -08001027 "bionic/sysprop_helpers.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -08001028 "bionic/system.cpp",
1029 "bionic/system_property_api.cpp",
1030 "bionic/system_property_set.cpp",
1031 "bionic/tdestroy.cpp",
1032 "bionic/termios.cpp",
1033 "bionic/thread_private.cpp",
1034 "bionic/threads.cpp",
1035 "bionic/time.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -08001036 "bionic/tmpfile.cpp",
1037 "bionic/umount.cpp",
1038 "bionic/unlink.cpp",
1039 "bionic/usleep.cpp",
1040 "bionic/utmp.cpp",
Elliott Hughesb0948922024-01-26 00:28:12 +00001041 "bionic/vdso.cpp",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -08001042 "bionic/wait.cpp",
1043 "bionic/wchar.cpp",
1044 "bionic/wchar_l.cpp",
1045 "bionic/wcstod.cpp",
1046 "bionic/wctype.cpp",
1047 "bionic/wcwidth.cpp",
1048 "bionic/wmempcpy.cpp",
1049
Elliott Hughes69bd8e92024-02-09 10:04:26 -08001050 // Forked but not yet cleaned up/rewritten stdio code.
1051 // TODO: finish cleanup.
1052 "stdio/fmemopen.cpp",
1053 "stdio/parsefloat.c",
1054 "stdio/refill.c",
1055 "stdio/stdio.cpp",
1056 "stdio/stdio_ext.cpp",
1057 "stdio/vfscanf.cpp",
1058 "stdio/vfwscanf.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001059 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001060
1061 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001062 arm: {
Elliott Hughes1b61d782019-06-04 10:38:34 -07001063 asflags: libc_common_flags + ["-mno-restrict-it"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001064 srcs: [
Ryan Prichard45024fe2018-12-30 21:10:26 -08001065 "arch-arm/bionic/__aeabi_read_tp.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001066 "arch-arm/bionic/__bionic_clone.S",
Yi Kongb410d0e2019-04-22 16:00:46 -07001067 "arch-arm/bionic/__restore.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001068 "arch-arm/bionic/_exit_with_stack_teardown.S",
Yi Kongb410d0e2019-04-22 16:00:46 -07001069 "arch-arm/bionic/atomics_arm.c",
1070 "arch-arm/bionic/bpabi.c",
Yi Kong165b1cf2019-02-13 14:10:10 -08001071 "arch-arm/bionic/libcrt_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07001072 "arch-arm/bionic/popcount_tab.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07001073 "arch-arm/bionic/setjmp.S",
1074 "arch-arm/bionic/syscall.S",
1075 "arch-arm/bionic/vfork.S",
Haibo Huangea9957a2018-11-19 11:00:32 -08001076
Haibo Huangea9957a2018-11-19 11:00:32 -08001077 "arch-arm/cortex-a7/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -08001078 "arch-arm/cortex-a7/bionic/memset.S",
1079
1080 "arch-arm/cortex-a9/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -08001081 "arch-arm/cortex-a9/bionic/memset.S",
1082 "arch-arm/cortex-a9/bionic/stpcpy.S",
1083 "arch-arm/cortex-a9/bionic/strcat.S",
Haibo Huangea9957a2018-11-19 11:00:32 -08001084 "arch-arm/cortex-a9/bionic/strcpy.S",
1085 "arch-arm/cortex-a9/bionic/strlen.S",
1086
Elliott Hughesaefe9992023-11-08 12:04:41 -08001087 "arch-arm/cortex-a15/bionic/memcpy.S",
1088 "arch-arm/cortex-a15/bionic/memmove.S",
1089 "arch-arm/cortex-a15/bionic/memset.S",
1090 "arch-arm/cortex-a15/bionic/stpcpy.S",
1091 "arch-arm/cortex-a15/bionic/strcat.S",
1092 "arch-arm/cortex-a15/bionic/strcmp.S",
1093 "arch-arm/cortex-a15/bionic/strcpy.S",
1094 "arch-arm/cortex-a15/bionic/strlen.S",
Haibo Huangea9957a2018-11-19 11:00:32 -08001095
1096 "arch-arm/cortex-a53/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -08001097
Haibo Huang01bfd892018-12-03 15:05:16 -08001098 "arch-arm/cortex-a55/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -08001099
Elliott Hughesaefe9992023-11-08 12:04:41 -08001100 "arch-arm/generic/bionic/memcmp.S",
1101 "arch-arm/generic/bionic/memmove.S",
1102 "arch-arm/generic/bionic/memset.S",
1103 "arch-arm/generic/bionic/stpcpy.c",
1104 "arch-arm/generic/bionic/strcat.c",
1105 "arch-arm/generic/bionic/strcmp.S",
1106 "arch-arm/generic/bionic/strcpy.S",
1107 "arch-arm/generic/bionic/strlen.c",
1108
1109 "arch-arm/krait/bionic/memcpy.S",
1110 "arch-arm/krait/bionic/memset.S",
1111
Haibo Huangea9957a2018-11-19 11:00:32 -08001112 "arch-arm/kryo/bionic/memcpy.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001113 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001114 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001115 arm64: {
1116 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001117 "arch-arm64/bionic/__bionic_clone.S",
1118 "arch-arm64/bionic/_exit_with_stack_teardown.S",
1119 "arch-arm64/bionic/setjmp.S",
1120 "arch-arm64/bionic/syscall.S",
1121 "arch-arm64/bionic/vfork.S",
Vaisakh K V83e55842024-03-29 12:47:39 +05301122 "arch-arm64/oryon/memcpy-nt.S",
Vaisakh K V54a61212024-03-29 13:32:45 +05301123 "arch-arm64/oryon/memset-nt.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001124 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001125 },
1126
Elliott Hughesebc19a92022-10-14 23:25:36 +00001127 riscv64: {
1128 srcs: [
1129 "arch-riscv64/bionic/__bionic_clone.S",
1130 "arch-riscv64/bionic/_exit_with_stack_teardown.S",
Elliott Hughese1905ed2022-10-17 23:23:36 +00001131 "arch-riscv64/bionic/setjmp.S",
Elliott Hughesebc19a92022-10-14 23:25:36 +00001132 "arch-riscv64/bionic/syscall.S",
1133 "arch-riscv64/bionic/vfork.S",
Yun Hsiang40a82d02023-05-26 10:10:40 +08001134
Elliott Hughesff7bb092025-02-03 06:06:55 -08001135 "arch-riscv64/string/memchr.S",
1136 "arch-riscv64/string/memcmp.S",
1137 "arch-riscv64/string/memcpy.S",
1138 "arch-riscv64/string/memmove.S",
1139 "arch-riscv64/string/memset.S",
1140 "arch-riscv64/string/stpcpy.S",
1141 "arch-riscv64/string/strcat.S",
1142 "arch-riscv64/string/strchr.S",
1143 "arch-riscv64/string/strcmp.S",
1144 "arch-riscv64/string/strcpy.S",
1145 "arch-riscv64/string/strlen.S",
1146 "arch-riscv64/string/strncat.S",
1147 "arch-riscv64/string/strncmp.S",
1148 "arch-riscv64/string/strncpy.S",
1149 "arch-riscv64/string/strnlen.S",
Elliott Hughesebc19a92022-10-14 23:25:36 +00001150 ],
1151 },
1152
Dan Willemsen208ae172015-09-16 16:33:27 -07001153 x86: {
1154 srcs: [
Elliott Hughes7d136662023-10-27 15:40:32 -07001155 "arch-x86/bionic/__bionic_clone.S",
1156 "arch-x86/bionic/_exit_with_stack_teardown.S",
1157 "arch-x86/bionic/libcrt_compat.c",
Elliott Hughes7d136662023-10-27 15:40:32 -07001158 "arch-x86/bionic/setjmp.S",
1159 "arch-x86/bionic/syscall.S",
1160 "arch-x86/bionic/vfork.S",
1161 "arch-x86/bionic/__x86.get_pc_thunk.S",
1162
Elliott Hughesed777142022-07-25 16:25:11 +00001163 "arch-x86/string/sse2-memmove-slm.S",
Elliott Hughesed777142022-07-25 16:25:11 +00001164 "arch-x86/string/sse2-memset-slm.S",
1165 "arch-x86/string/sse2-stpcpy-slm.S",
1166 "arch-x86/string/sse2-stpncpy-slm.S",
Elliott Hughesed777142022-07-25 16:25:11 +00001167 "arch-x86/string/sse2-strcpy-slm.S",
1168 "arch-x86/string/sse2-strlen-slm.S",
1169 "arch-x86/string/sse2-strncpy-slm.S",
Elliott Hughesed777142022-07-25 16:25:11 +00001170
1171 "arch-x86/string/ssse3-memcmp-atom.S",
Elliott Hughesed777142022-07-25 16:25:11 +00001172 "arch-x86/string/ssse3-strcat-atom.S",
1173 "arch-x86/string/ssse3-strcmp-atom.S",
Elliott Hughesed777142022-07-25 16:25:11 +00001174 "arch-x86/string/ssse3-strncat-atom.S",
1175 "arch-x86/string/ssse3-strncmp-atom.S",
Elliott Hughesed777142022-07-25 16:25:11 +00001176
1177 "arch-x86/string/sse4-memcmp-slm.S",
Dan Willemsen268a6732015-10-15 14:49:45 -07001178 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001179 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001180 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001181 srcs: [
Elliott Hughes7d136662023-10-27 15:40:32 -07001182 "arch-x86_64/bionic/__bionic_clone.S",
1183 "arch-x86_64/bionic/_exit_with_stack_teardown.S",
1184 "arch-x86_64/bionic/__restore_rt.S",
1185 "arch-x86_64/bionic/setjmp.S",
1186 "arch-x86_64/bionic/syscall.S",
1187 "arch-x86_64/bionic/vfork.S",
1188
ahs919fb7f2022-06-10 07:11:14 +05301189 "arch-x86_64/string/avx2-memset-kbl.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001190 "arch-x86_64/string/sse2-memmove-slm.S",
1191 "arch-x86_64/string/sse2-memset-slm.S",
1192 "arch-x86_64/string/sse2-stpcpy-slm.S",
1193 "arch-x86_64/string/sse2-stpncpy-slm.S",
1194 "arch-x86_64/string/sse2-strcat-slm.S",
1195 "arch-x86_64/string/sse2-strcpy-slm.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001196 "arch-x86_64/string/sse2-strlen-slm.S",
1197 "arch-x86_64/string/sse2-strncat-slm.S",
1198 "arch-x86_64/string/sse2-strncpy-slm.S",
1199 "arch-x86_64/string/sse4-memcmp-slm.S",
1200 "arch-x86_64/string/ssse3-strcmp-slm.S",
1201 "arch-x86_64/string/ssse3-strncmp-slm.S",
1202 ],
1203 },
Dan Willemsen268a6732015-10-15 14:49:45 -07001204 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001205
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -08001206 multilib: {
1207 lib32: {
Elliott Hughes69bd8e92024-02-09 10:04:26 -08001208 srcs: [
1209 // off64_t/time64_t support on LP32.
1210 "bionic/legacy_32_bit_support.cpp",
1211 "bionic/time64.c",
Elliott Hughes69bd8e92024-02-09 10:04:26 -08001212 ],
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -08001213 },
1214 },
1215
1216 local_include_dirs: ["stdio"],
1217 generated_headers: ["generated_android_ids"],
1218
1219 whole_static_libs: [
George Burgess IVc5a98e62024-11-18 14:50:32 -07001220 "//external/llvm-libc:llvmlibc",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -08001221 "libsystemproperties",
Manish Goregaokar361854c2025-03-05 15:02:28 -08001222 "libicu4x_bionic",
Elliott Hughes2e2b9bc2024-02-07 16:10:23 -08001223 ],
1224
Colin Cross50c21ab2015-10-31 23:03:05 -07001225 cppflags: ["-Wold-style-cast"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001226 include_dirs: ["bionic/libstdc++/include"],
1227 name: "libc_bionic",
Dan Willemsen268a6732015-10-15 14:49:45 -07001228}
1229
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001230genrule {
1231 name: "generated_android_ids",
Colin Cross35bbed82017-01-17 18:16:07 -08001232 out: ["generated_android_ids.h"],
1233 srcs: [":android_filesystem_config_header"],
Cole Faustb1a0a9d2023-11-28 17:51:16 -08001234 tools: ["fs_config_generator"],
1235 cmd: "$(location fs_config_generator) aidarray $(in) > $(out)",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001236}
1237
Dan Willemsen268a6732015-10-15 14:49:45 -07001238// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001239// libc_syscalls.a
1240// ========================================================
1241
Elliott Hughes782c4852019-04-16 12:31:00 -07001242genrule {
Cole Faustf5968d82023-04-11 15:20:19 -07001243 name: "syscalls-arm",
Elliott Hughes782c4852019-04-16 12:31:00 -07001244 out: ["syscalls-arm.S"],
1245 srcs: ["SYSCALLS.TXT"],
Elliott Hughes291f98a2022-06-30 23:35:11 +00001246 tools: ["gensyscalls"],
1247 cmd: "$(location gensyscalls) arm $(in) > $(out)",
Elliott Hughes782c4852019-04-16 12:31:00 -07001248}
1249
1250genrule {
Cole Faustf5968d82023-04-11 15:20:19 -07001251 name: "syscalls-arm64",
Elliott Hughes782c4852019-04-16 12:31:00 -07001252 out: ["syscalls-arm64.S"],
1253 srcs: ["SYSCALLS.TXT"],
Elliott Hughes291f98a2022-06-30 23:35:11 +00001254 tools: ["gensyscalls"],
1255 cmd: "$(location gensyscalls) arm64 $(in) > $(out)",
Elliott Hughes782c4852019-04-16 12:31:00 -07001256}
1257
1258genrule {
Cole Faustf5968d82023-04-11 15:20:19 -07001259 name: "syscalls-riscv64",
Elliott Hughes704772b2022-10-10 17:06:43 +00001260 out: ["syscalls-riscv64.S"],
1261 srcs: ["SYSCALLS.TXT"],
1262 tools: ["gensyscalls"],
1263 cmd: "$(location gensyscalls) riscv64 $(in) > $(out)",
1264}
1265
1266genrule {
Cole Faustf5968d82023-04-11 15:20:19 -07001267 name: "syscalls-x86",
Elliott Hughes782c4852019-04-16 12:31:00 -07001268 out: ["syscalls-x86.S"],
1269 srcs: ["SYSCALLS.TXT"],
Elliott Hughes291f98a2022-06-30 23:35:11 +00001270 tools: ["gensyscalls"],
1271 cmd: "$(location gensyscalls) x86 $(in) > $(out)",
Elliott Hughes782c4852019-04-16 12:31:00 -07001272}
1273
1274genrule {
Cole Faustf5968d82023-04-11 15:20:19 -07001275 name: "syscalls-x86_64",
Elliott Hughes782c4852019-04-16 12:31:00 -07001276 out: ["syscalls-x86_64.S"],
1277 srcs: ["SYSCALLS.TXT"],
Elliott Hughes291f98a2022-06-30 23:35:11 +00001278 tools: ["gensyscalls"],
1279 cmd: "$(location gensyscalls) x86_64 $(in) > $(out)",
Elliott Hughes782c4852019-04-16 12:31:00 -07001280}
1281
Dan Willemsen208ae172015-09-16 16:33:27 -07001282cc_library_static {
Colin Cross27c43c52016-04-07 13:27:24 -07001283 defaults: ["libc_defaults"],
Josh Gao0e0e3702017-10-12 13:34:42 -07001284 srcs: ["bionic/__set_errno.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001285 arch: {
1286 arm: {
Cole Faustf5968d82023-04-11 15:20:19 -07001287 srcs: [":syscalls-arm"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001288 },
1289 arm64: {
Cole Faustf5968d82023-04-11 15:20:19 -07001290 srcs: [":syscalls-arm64"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001291 },
Elliott Hughes704772b2022-10-10 17:06:43 +00001292 riscv64: {
Cole Faustf5968d82023-04-11 15:20:19 -07001293 srcs: [":syscalls-riscv64"],
Elliott Hughes704772b2022-10-10 17:06:43 +00001294 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001295 x86: {
Cole Faustf5968d82023-04-11 15:20:19 -07001296 srcs: [":syscalls-x86"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001297 },
1298 x86_64: {
Cole Faustf5968d82023-04-11 15:20:19 -07001299 srcs: [":syscalls-x86_64"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001300 },
1301 },
1302 name: "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001303}
1304
1305// ========================================================
1306// libc_aeabi.a
1307// This is an LP32 ARM-only library that needs to be built with -fno-builtin
1308// to avoid infinite recursion. For the other architectures we just build an
1309// empty library to keep this makefile simple.
1310// ========================================================
1311
1312cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001313 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001314 arch: {
1315 arm: {
1316 srcs: ["arch-arm/bionic/__aeabi.c"],
1317 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001318 },
1319 name: "libc_aeabi",
Colin Cross50c21ab2015-10-31 23:03:05 -07001320 cflags: ["-fno-builtin"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001321}
1322
1323// ========================================================
Elliott Hughes69bd8e92024-02-09 10:04:26 -08001324// libc_common.a --- everything shared by libc.a and libc.so
Dan Willemsen208ae172015-09-16 16:33:27 -07001325// ========================================================
Elliott Hughesb0948922024-01-26 00:28:12 +00001326
Dan Willemsen208ae172015-09-16 16:33:27 -07001327cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001328 defaults: ["libc_defaults"],
Elliott Hughesb0948922024-01-26 00:28:12 +00001329 name: "libc_common",
1330
Dan Willemsen208ae172015-09-16 16:33:27 -07001331 whole_static_libs: [
Peter Collingbourne337a5b32020-02-21 12:11:02 -08001332 "libarm-optimized-routines-string",
Rupert Shuttleworth78f48a52021-03-16 06:39:19 +00001333 "libasync_safe",
Dan Willemsen208ae172015-09-16 16:33:27 -07001334 "libc_bionic",
Ryan Prichard249757b2019-11-01 17:18:28 -07001335 "libc_bootstrap",
Dan Willemsen208ae172015-09-16 16:33:27 -07001336 "libc_dns",
George Burgess IV6cb06872017-07-21 13:28:42 -07001337 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001338 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001339 "libc_freebsd_large_stack",
Elliott Hughesc2043342023-07-20 20:24:09 +00001340 "libc_freebsd_ldexp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001341 "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -07001342 "libc_netbsd",
1343 "libc_openbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001344 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001345 "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001346 "libc_tzcode",
Elliott Hughes816fab92016-05-27 17:57:46 -07001347 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001348 ],
1349
1350 arch: {
1351 arm: {
1352 whole_static_libs: ["libc_aeabi"],
1353 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001354 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001355}
1356
1357// ========================================================
Elliott Hughesadc41712024-08-16 13:08:11 +00001358// libc_static_dispatch.a/libc_dynamic_dispatch.a --- string/memory "ifuncs"
1359// (Actually ifuncs for libc.so, but a home-grown alternative for libc.a.)
Haibo Huangf71edfa2018-11-12 10:06:56 -08001360// ========================================================
Elliott Hughesadc41712024-08-16 13:08:11 +00001361
1362cc_defaults {
1363 name: "libc_dispatch_defaults",
Haibo Huangf71edfa2018-11-12 10:06:56 -08001364 defaults: ["libc_defaults"],
Haibo Huangb9244ff2018-08-11 10:12:13 -07001365 arch: {
ahs919fb7f2022-06-10 07:11:14 +05301366 x86_64: {
1367 srcs: ["arch-x86_64/dynamic_function_dispatch.cpp"],
1368 },
Haibo Huangb9244ff2018-08-11 10:12:13 -07001369 x86: {
1370 srcs: ["arch-x86/dynamic_function_dispatch.cpp"],
1371 },
Haibo Huangea9957a2018-11-19 11:00:32 -08001372 arm: {
Elliott Hughes927fe992019-01-31 22:29:22 +00001373 srcs: ["arch-arm/dynamic_function_dispatch.cpp"],
Haibo Huangea9957a2018-11-19 11:00:32 -08001374 },
Peter Collingbourne900d07d2019-10-28 13:11:00 -07001375 arm64: {
1376 srcs: ["arch-arm64/dynamic_function_dispatch.cpp"],
1377 },
Haibo Huangb9244ff2018-08-11 10:12:13 -07001378 },
Elliott Hughesadc41712024-08-16 13:08:11 +00001379 // Prevent the compiler from inserting calls to libc/taking the address of
1380 // a jump table from within an ifunc (or, in the static case, code that
1381 // can be executed arbitrarily early).
1382 cflags: [
1383 "-ffreestanding",
1384 "-fno-stack-protector",
1385 "-fno-jump-tables",
1386 ],
1387}
1388
1389cc_library_static {
1390 name: "libc_static_dispatch",
1391 defaults: ["libc_dispatch_defaults"],
1392 cflags: [
1393 "-DBIONIC_STATIC_DISPATCH",
1394 ],
1395}
1396
1397cc_library_static {
1398 name: "libc_dynamic_dispatch",
1399 defaults: ["libc_dispatch_defaults"],
1400 cflags: [
1401 "-DBIONIC_DYNAMIC_DISPATCH",
1402 ],
Ryan Prichard249757b2019-11-01 17:18:28 -07001403}
1404
1405// ========================================================
1406// libc_common_static.a For static binaries.
1407// ========================================================
1408cc_library_static {
1409 defaults: ["libc_defaults"],
1410 name: "libc_common_static",
Haibo Huangb9244ff2018-08-11 10:12:13 -07001411
Haibo Huangf71edfa2018-11-12 10:06:56 -08001412 whole_static_libs: [
1413 "libc_common",
Ryan Prichard249757b2019-11-01 17:18:28 -07001414 "libc_static_dispatch",
1415 ],
1416}
1417
1418// ========================================================
1419// libc_common_shared.a For shared libraries.
1420// ========================================================
1421cc_library_static {
1422 defaults: ["libc_defaults"],
1423 name: "libc_common_shared",
1424
1425 whole_static_libs: [
1426 "libc_common",
1427 "libc_dynamic_dispatch",
Haibo Huangf71edfa2018-11-12 10:06:56 -08001428 ],
1429}
1430
Ryan Prichard22a6a052019-10-10 23:59:30 -07001431// Versions of dl_iterate_phdr and similar APIs used to lookup unwinding information in a static
1432// executable.
1433cc_library_static {
1434 name: "libc_unwind_static",
1435 defaults: ["libc_defaults"],
1436 cflags: ["-DLIBC_STATIC"],
1437
1438 srcs: ["bionic/dl_iterate_phdr_static.cpp"],
1439 arch: {
1440 // arm32-specific dl_unwind_find_exidx and __gnu_Unwind_Find_exidx APIs
1441 arm: {
1442 srcs: ["arch-arm/bionic/exidx_static.c"],
1443 },
1444 },
1445}
1446
Haibo Huangf71edfa2018-11-12 10:06:56 -08001447// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001448// libc_nomalloc.a
1449// ========================================================
1450//
Ryan Prichard249757b2019-11-01 17:18:28 -07001451// This is a version of the static C library used by the dynamic linker that exclude malloc. It also
1452// excludes functions selected using ifunc's (e.g. for string.h). Link in either
1453// libc_static_dispatch or libc_dynamic_dispatch to provide those functions.
Dan Willemsen208ae172015-09-16 16:33:27 -07001454
1455cc_library_static {
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -08001456 name: "libc_nomalloc",
Colin Cross50c21ab2015-10-31 23:03:05 -07001457 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001458
Colin Crossa3f9fca2016-01-11 13:20:55 -08001459 whole_static_libs: [
Ryan Prichard249757b2019-11-01 17:18:28 -07001460 "libc_common",
Colin Crossa3f9fca2016-01-11 13:20:55 -08001461 "libc_init_static",
Ryan Prichard22a6a052019-10-10 23:59:30 -07001462 "libc_unwind_static",
Colin Crossa3f9fca2016-01-11 13:20:55 -08001463 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001464}
1465
dimitryc0c0ef62018-12-05 16:33:52 +01001466filegroup {
1467 name: "libc_sources_shared",
1468 srcs: [
1469 "arch-common/bionic/crtbegin_so.c",
1470 "arch-common/bionic/crtbrand.S",
Christopher Ferris0ac5da02024-11-07 06:59:33 +00001471 "bionic/android_mallopt.cpp",
Mitch Phillipsf3968e82020-01-31 19:57:04 -08001472 "bionic/gwp_asan_wrappers.cpp",
Peter Collingbourne1e110fb2020-01-09 10:48:22 -08001473 "bionic/heap_tagging.cpp",
dimitryc0c0ef62018-12-05 16:33:52 +01001474 "bionic/malloc_common.cpp",
Christopher Ferrise4cdbc42019-02-08 17:30:58 -08001475 "bionic/malloc_common_dynamic.cpp",
Ryan Savitski175c8862020-01-02 19:54:57 +00001476 "bionic/android_profiling_dynamic.cpp",
Christopher Ferrise4cdbc42019-02-08 17:30:58 -08001477 "bionic/malloc_heapprofd.cpp",
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -08001478 "bionic/malloc_limit.cpp",
Peter Collingbourne570de332019-12-11 10:00:58 -08001479 "bionic/ndk_cruft.cpp",
1480 "bionic/ndk_cruft_data.cpp",
dimitryc0c0ef62018-12-05 16:33:52 +01001481 "bionic/NetdClient.cpp",
1482 "arch-common/bionic/crtend_so.S",
1483 ],
1484}
1485
1486filegroup {
1487 name: "libc_sources_static",
1488 srcs: [
Christopher Ferris0ac5da02024-11-07 06:59:33 +00001489 "bionic/android_mallopt.cpp",
Mitch Phillipsf3968e82020-01-31 19:57:04 -08001490 "bionic/gwp_asan_wrappers.cpp",
Peter Collingbourne1e110fb2020-01-09 10:48:22 -08001491 "bionic/heap_tagging.cpp",
dimitryc0c0ef62018-12-05 16:33:52 +01001492 "bionic/malloc_common.cpp",
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -08001493 "bionic/malloc_limit.cpp",
dimitryc0c0ef62018-12-05 16:33:52 +01001494 ],
1495}
1496
1497filegroup {
1498 name: "libc_sources_shared_arm",
1499 srcs: [
1500 "arch-arm/bionic/exidx_dynamic.c",
1501 "arch-arm/bionic/atexit_legacy.c",
1502 ],
1503}
1504
Dan Willemsen208ae172015-09-16 16:33:27 -07001505// ========================================================
1506// libc.a + libc.so
1507// ========================================================
Florian Mayerc10d0642023-03-22 16:12:49 -07001508cc_defaults {
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07001509 defaults: [
1510 "libc_defaults",
1511 "libc_native_allocator_defaults",
Elliott Hughes788075a2024-06-18 12:25:37 +00001512 "bug_24465209_workaround",
Elliott Hughes89aada12024-07-01 21:59:04 +00001513 "keep_symbols",
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07001514 ],
Florian Mayerc10d0642023-03-22 16:12:49 -07001515 name: "libc_library_defaults",
Colin Cross50c21ab2015-10-31 23:03:05 -07001516 product_variables: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001517 platform_sdk_version: {
1518 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1519 },
1520 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001521 static: {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00001522 srcs: [":libc_sources_static"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001523 cflags: ["-DLIBC_STATIC"],
Haibo Huangf71edfa2018-11-12 10:06:56 -08001524 whole_static_libs: [
Mitch Phillipsf3968e82020-01-31 19:57:04 -08001525 "gwp_asan",
Haibo Huangf71edfa2018-11-12 10:06:56 -08001526 "libc_init_static",
1527 "libc_common_static",
Ryan Prichard22a6a052019-10-10 23:59:30 -07001528 "libc_unwind_static",
Haibo Huangf71edfa2018-11-12 10:06:56 -08001529 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001530 },
1531 shared: {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00001532 srcs: [":libc_sources_shared"],
Haibo Huangf71edfa2018-11-12 10:06:56 -08001533 whole_static_libs: [
Mitch Phillipsf3968e82020-01-31 19:57:04 -08001534 "gwp_asan",
Haibo Huangf71edfa2018-11-12 10:06:56 -08001535 "libc_init_dynamic",
1536 "libc_common_shared",
Ryan Prichardcdf71752020-12-16 03:37:22 -08001537 "libunwind-exported",
Haibo Huangf71edfa2018-11-12 10:06:56 -08001538 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001539 },
1540
Neil Fullera7db90f2019-04-25 09:28:27 +01001541 required: [
MarkDacekd88d7ea2022-06-28 20:14:58 +00001542 "tzdata_prebuilt",
1543 "tz_version_prebuilt", // Version metadata for tzdata to help debugging.
Neil Fullera7db90f2019-04-25 09:28:27 +01001544 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001545
Colin Cross4ce94d22016-11-15 13:15:43 -08001546 // Do not pack libc.so relocations; see http://b/20645321 for details.
1547 pack_relocations: false,
1548
dimitry06016f22018-01-05 11:39:28 +01001549 shared_libs: [
1550 "ld-android",
1551 "libdl",
1552 ],
Jiyong Park3ff116a2019-04-02 23:04:52 +09001553 static_libs: [
1554 "libdl_android",
1555 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001556
1557 nocrt: true,
1558
Dan Willemsen208ae172015-09-16 16:33:27 -07001559 arch: {
1560 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001561 version_script: ":libc.arm.map",
Ryan Prichardc22562c2021-01-27 17:27:31 -08001562 no_libcrt: true,
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001563
Dan Willemsen208ae172015-09-16 16:33:27 -07001564 shared: {
dimitryc0c0ef62018-12-05 16:33:52 +01001565 srcs: [":libc_sources_shared_arm"],
Dan Willemsen0c657082016-05-12 01:43:07 -07001566 // special for arm
1567 cflags: ["-DCRT_LEGACY_WORKAROUND"],
Elliott Hughes89aada12024-07-01 21:59:04 +00001568 // For backwards compatibility, some arm32 builtins are exported from libc.so.
Colin Cross335e27b2022-02-10 11:37:28 -08001569 static_libs: ["libclang_rt.builtins-exported"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001570 },
Christopher Ferris0c0f6fb2019-05-17 16:22:56 -07001571
Elliott Hughes89aada12024-07-01 21:59:04 +00001572 ldflags: [
1573 // Since we preserve the debug_frame for libc, do not compress
1574 // in this case to make unwinds as fast as possible.
1575 "-Wl,--compress-debug-sections=none",
1576 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001577 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001578 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001579 version_script: ":libc.arm64.map",
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001580 },
Elliott Hughes604ab0f2022-10-17 19:58:22 +00001581 riscv64: {
1582 version_script: ":libc.riscv64.map",
Elliott Hughes604ab0f2022-10-17 19:58:22 +00001583 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001584 x86: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001585 version_script: ":libc.x86.map",
Ryan Prichardc22562c2021-01-27 17:27:31 -08001586 no_libcrt: true,
1587
1588 shared: {
Elliott Hughes89aada12024-07-01 21:59:04 +00001589 // For backwards compatibility, some x86 builtins are exported from libc.so.
Colin Cross335e27b2022-02-10 11:37:28 -08001590 static_libs: ["libclang_rt.builtins-exported"],
Ryan Prichardc22562c2021-01-27 17:27:31 -08001591 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001592 },
1593 x86_64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001594 version_script: ":libc.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001595 },
1596 },
Jiyong Parkc45fe9f2018-12-13 18:26:48 +09001597
Jiyong Parke87e0dc2019-10-02 17:09:33 +09001598 apex_available: [
Jiyong Parke87e0dc2019-10-02 17:09:33 +09001599 "com.android.runtime",
1600 ],
1601
Colin Cross7edd0082021-10-28 13:20:35 -07001602 target: {
1603 native_bridge: {
1604 shared: {
1605 installable: false,
1606 },
1607 },
1608 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001609}
1610
Florian Mayerc10d0642023-03-22 16:12:49 -07001611cc_library {
1612 name: "libc",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00001613 defaults: [
Florian Mayerc10d0642023-03-22 16:12:49 -07001614 "libc_library_defaults",
1615 ],
1616 stubs: {
1617 symbol_file: "libc.map.txt",
1618 versions: [
1619 "29",
1620 "R",
1621 "current",
1622 ],
1623 },
1624 static_ndk_lib: true,
1625 llndk: {
1626 symbol_file: "libc.map.txt",
1627 export_headers_as_system: true,
Dan Alberte9f02e02024-08-28 23:20:20 +00001628 export_llndk_headers: ["libc_headers"],
Florian Mayerc10d0642023-03-22 16:12:49 -07001629 },
1630}
1631
1632cc_library {
1633 name: "libc_hwasan",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00001634 defaults: [
Florian Mayerc10d0642023-03-22 16:12:49 -07001635 "libc_library_defaults",
1636 ],
1637 sanitize: {
1638 hwaddress: true,
1639 },
1640 enabled: false,
Florian Mayerff116ed2023-04-14 17:38:53 -07001641 target: {
1642 android_arm64: {
Florian Mayerc10d0642023-03-22 16:12:49 -07001643 enabled: true,
1644 },
1645 },
1646 stem: "libc",
1647 relative_install_path: "hwasan",
1648 // We don't really need the stubs, but this needs to stay to trigger the
1649 // symlink logic in soong.
1650 stubs: {
1651 symbol_file: "libc.map.txt",
1652 },
1653 native_bridge_supported: false,
1654 // It is never correct to depend on this directly. This is only
Kiyoung Kim06a86dc2024-12-02 11:18:51 +09001655 // needed for the runtime apex, and in base_system.mk, and system_image_defaults
1656 // which is default module for soong-defined system image.
1657 visibility: [
1658 "//bionic/apex",
Kiyoung Kim4028fec2025-01-08 14:30:55 +09001659 "//visibility:any_system_partition",
Kiyoung Kim06a86dc2024-12-02 11:18:51 +09001660 ],
Florian Mayerc10d0642023-03-22 16:12:49 -07001661}
1662
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001663genrule {
1664 name: "libc.arm.map",
Cole Faustf5968d82023-04-11 15:20:19 -07001665 out: ["libc.arm.map.txt"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001666 srcs: ["libc.map.txt"],
Elliott Hughes291f98a2022-06-30 23:35:11 +00001667 tools: ["generate-version-script"],
1668 cmd: "$(location generate-version-script) arm $(in) $(out)",
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001669}
1670
1671genrule {
1672 name: "libc.arm64.map",
Cole Faustf5968d82023-04-11 15:20:19 -07001673 out: ["libc.arm64.map.txt"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001674 srcs: ["libc.map.txt"],
Elliott Hughes291f98a2022-06-30 23:35:11 +00001675 tools: ["generate-version-script"],
1676 cmd: "$(location generate-version-script) arm64 $(in) $(out)",
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001677}
1678
1679genrule {
Elliott Hughes604ab0f2022-10-17 19:58:22 +00001680 name: "libc.riscv64.map",
Cole Faustf5968d82023-04-11 15:20:19 -07001681 out: ["libc.riscv64.map.txt"],
Elliott Hughes604ab0f2022-10-17 19:58:22 +00001682 srcs: ["libc.map.txt"],
1683 tools: ["generate-version-script"],
1684 cmd: "$(location generate-version-script) riscv64 $(in) $(out)",
1685}
1686
1687genrule {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001688 name: "libc.x86.map",
Cole Faustf5968d82023-04-11 15:20:19 -07001689 out: ["libc.x86.map.txt"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001690 srcs: ["libc.map.txt"],
Elliott Hughes291f98a2022-06-30 23:35:11 +00001691 tools: ["generate-version-script"],
1692 cmd: "$(location generate-version-script) x86 $(in) $(out)",
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001693}
1694
1695genrule {
1696 name: "libc.x86_64.map",
Cole Faustf5968d82023-04-11 15:20:19 -07001697 out: ["libc.x86_64.map.txt"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001698 srcs: ["libc.map.txt"],
Elliott Hughes291f98a2022-06-30 23:35:11 +00001699 tools: ["generate-version-script"],
1700 cmd: "$(location generate-version-script) x86_64 $(in) $(out)",
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001701}
1702
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001703// Headers that only other parts of the platform can include.
1704cc_library_headers {
1705 name: "bionic_libc_platform_headers",
Martin Stjernholma2763432020-04-23 16:47:19 +01001706 defaults: ["linux_bionic_supported"],
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001707 visibility: [
Christopher Ferrisc5d3a432019-09-25 17:50:36 -07001708 "//art:__subpackages__",
Josh Gao97271922019-11-06 13:15:00 -08001709 "//bionic:__subpackages__",
Christopher Ferrisc5d3a432019-09-25 17:50:36 -07001710 "//frameworks:__subpackages__",
Roman Kiryanov067f5182020-05-07 14:58:30 -07001711 "//device/generic/goldfish-opengl:__subpackages__",
Mitch Phillips3309b3d2020-03-25 15:05:48 -07001712 "//external/gwp_asan:__subpackages__",
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001713 "//external/perfetto:__subpackages__",
Christopher Ferrisc5d3a432019-09-25 17:50:36 -07001714 "//external/scudo:__subpackages__",
Josh Gao5074e7d2019-12-13 13:55:53 -08001715 "//system/core/debuggerd:__subpackages__",
Florian Mayerf5d70ce2022-09-13 13:58:30 -07001716 "//system/core/init:__subpackages__",
Steven Moreland0cdf1322020-10-05 21:55:26 +00001717 "//system/core/libcutils:__subpackages__",
Peter Collingbourne6a363f72020-01-13 10:39:33 -08001718 "//system/memory/libmemunreachable:__subpackages__",
Baligh Uddindb0c6de2020-10-15 04:49:00 +00001719 "//system/unwinding/libunwindstack:__subpackages__",
Peter Collingbourne15418002020-05-12 16:02:50 -07001720 "//tools/security/sanitizer-status:__subpackages__",
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001721 ],
Peter Collingbourne6a363f72020-01-13 10:39:33 -08001722 vendor_available: true,
Justin Yun869a0fa2020-11-11 15:16:11 +09001723 product_available: true,
Yifan Hong5a39cee2020-01-21 16:43:56 -08001724 ramdisk_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -07001725 vendor_ramdisk_available: true,
Christopher Ferrisc5d3a432019-09-25 17:50:36 -07001726 recovery_available: true,
1727 native_bridge_supported: true,
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001728 export_include_dirs: [
1729 "platform",
1730 ],
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07001731 system_shared_libs: [],
1732 stl: "none",
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001733 sdk_version: "current",
Jiyong Park4ede1602020-04-28 18:21:08 +09001734
Steven Moreland0cdf1322020-10-05 21:55:26 +00001735 min_sdk_version: "29",
Jiyong Park4ede1602020-04-28 18:21:08 +09001736 apex_available: [
1737 "//apex_available:platform",
Steven Moreland0cdf1322020-10-05 21:55:26 +00001738 "//apex_available:anyapex",
Jiyong Park4ede1602020-04-28 18:21:08 +09001739 ],
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001740}
1741
Logan Chien17af91b2019-01-15 21:19:56 +08001742cc_library_headers {
Dan Albert64a6efc2024-08-29 19:04:59 +00001743 name: "libc_uapi_headers",
Colin Cross5d50dbb2021-06-29 11:35:29 -07001744 visibility: [
1745 "//external/musl",
Alistair Delvabad22722024-10-07 12:52:40 -07001746 "//external/rust/crates/v4l2r/android",
Colin Cross5d50dbb2021-06-29 11:35:29 -07001747 ],
Colin Crossa0a4a6c2021-03-02 10:23:04 -08001748 llndk: {
1749 llndk_headers: true,
1750 },
Logan Chien17af91b2019-01-15 21:19:56 +08001751 host_supported: true,
1752 vendor_available: true,
Justin Yun869a0fa2020-11-11 15:16:11 +09001753 product_available: true,
Yifan Hong5a39cee2020-01-21 16:43:56 -08001754 ramdisk_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -07001755 vendor_ramdisk_available: true,
Logan Chien17af91b2019-01-15 21:19:56 +08001756 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +02001757 native_bridge_supported: true,
Jiyong Park922a5c72020-03-07 17:35:02 +09001758 apex_available: [
1759 "//apex_available:platform",
Jiyong Parkad9946c2020-03-30 18:36:07 +09001760 "//apex_available:anyapex",
1761 ],
Jooyung Han15c32a82020-04-16 18:26:45 +09001762 // used by most APEXes indirectly via libunwind_llvm
1763 min_sdk_version: "apex_inherit",
Logan Chien17af91b2019-01-15 21:19:56 +08001764
1765 no_libcrt: true,
Logan Chien17af91b2019-01-15 21:19:56 +08001766 stl: "none",
1767 system_shared_libs: [],
1768
Peter Collingbournef2b1e032019-12-10 17:41:16 -08001769 // The build system generally requires that any dependencies of a target
1770 // with an sdk_version must have a lower sdk_version. By setting sdk_version
1771 // to 1 we let targets with an sdk_version that need to depend on the libc
1772 // headers but cannot depend on libc itself due to circular dependencies
1773 // (such as libunwind_llvm) depend on the headers. Setting sdk_version to 1
1774 // is correct because the headers can support any sdk_version.
1775 sdk_version: "1",
1776
Martin Stjernholm82d84bc2020-04-06 20:32:09 +01001777 export_system_include_dirs: [
Logan Chien17af91b2019-01-15 21:19:56 +08001778 "kernel/uapi",
Martin Stjernholm82d84bc2020-04-06 20:32:09 +01001779 "kernel/android/scsi",
Logan Chien17af91b2019-01-15 21:19:56 +08001780 "kernel/android/uapi",
1781 ],
1782
1783 arch: {
1784 arm: {
Martin Stjernholm82d84bc2020-04-06 20:32:09 +01001785 export_system_include_dirs: ["kernel/uapi/asm-arm"],
Logan Chien17af91b2019-01-15 21:19:56 +08001786 },
1787 arm64: {
Martin Stjernholm82d84bc2020-04-06 20:32:09 +01001788 export_system_include_dirs: ["kernel/uapi/asm-arm64"],
Logan Chien17af91b2019-01-15 21:19:56 +08001789 },
Elliott Hughes48e53332022-10-07 20:39:25 +00001790 riscv64: {
1791 export_system_include_dirs: ["kernel/uapi/asm-riscv"],
1792 },
Logan Chien17af91b2019-01-15 21:19:56 +08001793 x86: {
Martin Stjernholm82d84bc2020-04-06 20:32:09 +01001794 export_system_include_dirs: ["kernel/uapi/asm-x86"],
Logan Chien17af91b2019-01-15 21:19:56 +08001795 },
1796 x86_64: {
Martin Stjernholm82d84bc2020-04-06 20:32:09 +01001797 export_system_include_dirs: ["kernel/uapi/asm-x86"],
Logan Chien17af91b2019-01-15 21:19:56 +08001798 },
1799 },
1800}
1801
Martin Stjernholm82d84bc2020-04-06 20:32:09 +01001802cc_library_headers {
1803 name: "libc_headers",
1804 host_supported: true,
1805 native_bridge_supported: true,
1806 vendor_available: true,
Justin Yun869a0fa2020-11-11 15:16:11 +09001807 product_available: true,
Martin Stjernholm82d84bc2020-04-06 20:32:09 +01001808 ramdisk_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -07001809 vendor_ramdisk_available: true,
Martin Stjernholm82d84bc2020-04-06 20:32:09 +01001810 recovery_available: true,
1811 sdk_version: "1",
1812
1813 apex_available: [
1814 "//apex_available:platform",
1815 "//apex_available:anyapex",
1816 ],
1817 // used by most APEXes indirectly via libunwind_llvm
1818 min_sdk_version: "apex_inherit",
1819 visibility: [
1820 "//bionic:__subpackages__", // visible to bionic
1821 // ... and only to these places (b/152668052)
1822 "//external/arm-optimized-routines",
1823 "//external/gwp_asan",
1824 "//external/jemalloc_new",
1825 "//external/libunwind_llvm",
Nick Desaulniers942ae552024-02-12 10:26:19 -08001826 "//external/llvm-libc",
Martin Stjernholm82d84bc2020-04-06 20:32:09 +01001827 "//external/scudo",
1828 "//system/core/property_service/libpropertyinfoparser",
1829 "//system/extras/toolchain-extras",
Martin Stjernholm82d84bc2020-04-06 20:32:09 +01001830 ],
1831
1832 stl: "none",
1833 no_libcrt: true,
1834 system_shared_libs: [],
1835
1836 target: {
1837 android: {
Colin Crossa0a4a6c2021-03-02 10:23:04 -08001838 export_system_include_dirs: ["include"],
Dan Albert64a6efc2024-08-29 19:04:59 +00001839 header_libs: ["libc_uapi_headers"],
1840 export_header_lib_headers: ["libc_uapi_headers"],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +01001841 },
1842 linux_bionic: {
Colin Crossa0a4a6c2021-03-02 10:23:04 -08001843 export_system_include_dirs: ["include"],
Dan Albert64a6efc2024-08-29 19:04:59 +00001844 header_libs: ["libc_uapi_headers"],
1845 export_header_lib_headers: ["libc_uapi_headers"],
Martin Stjernholm82d84bc2020-04-06 20:32:09 +01001846 },
Rupert Shuttleworthfd648682021-02-16 03:27:05 +00001847 },
Martin Stjernholm82d84bc2020-04-06 20:32:09 +01001848}
1849
Dan Willemsen208ae172015-09-16 16:33:27 -07001850// ========================================================
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001851// libstdc++.so and libstdc++.a.
Dan Willemsen208ae172015-09-16 16:33:27 -07001852// ========================================================
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001853
Dan Willemsen208ae172015-09-16 16:33:27 -07001854cc_library {
Elliott Hughes788075a2024-06-18 12:25:37 +00001855 defaults: [
1856 "libc_defaults",
1857 "bug_24465209_workaround",
1858 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001859 include_dirs: ["bionic/libstdc++/include"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001860 srcs: [
1861 "bionic/__cxa_guard.cpp",
1862 "bionic/__cxa_pure_virtual.cpp",
1863 "bionic/new.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001864 ],
1865 name: "libstdc++",
Dan Albert40f15ec2017-10-27 11:21:20 -07001866 static_ndk_lib: true,
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001867 static_libs: ["libasync_safe"],
Elliott Hughesc2043342023-07-20 20:24:09 +00001868 apex_available: [
1869 "//apex_available:platform",
1870 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001871
Dan Willemsen6b3be172018-12-03 13:57:20 -08001872 static: {
1873 system_shared_libs: [],
1874 },
Colin Crossb5bfe0b2021-07-13 16:26:28 -07001875 target: {
1876 bionic: {
1877 shared: {
1878 system_shared_libs: ["libc"],
1879 },
1880 },
Dan Willemsen6b3be172018-12-03 13:57:20 -08001881 },
1882
Dan Willemsen208ae172015-09-16 16:33:27 -07001883 arch: {
1884 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001885 version_script: ":libstdc++.arm.map",
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001886 },
1887 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001888 version_script: ":libstdc++.arm64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001889 },
Elliott Hughes604ab0f2022-10-17 19:58:22 +00001890 riscv64: {
1891 version_script: ":libstdc++.riscv64.map",
1892 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001893 x86: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001894 version_script: ":libstdc++.x86.map",
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001895 },
1896 x86_64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001897 version_script: ":libstdc++.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001898 },
1899 },
1900}
1901
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001902genrule {
1903 name: "libstdc++.arm.map",
Cole Faustf5968d82023-04-11 15:20:19 -07001904 out: ["libstdc++.arm.map.txt"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001905 srcs: ["libstdc++.map.txt"],
Elliott Hughes291f98a2022-06-30 23:35:11 +00001906 tools: ["generate-version-script"],
1907 cmd: "$(location generate-version-script) arm $(in) $(out)",
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001908}
1909
1910genrule {
1911 name: "libstdc++.arm64.map",
Cole Faustf5968d82023-04-11 15:20:19 -07001912 out: ["libstdc++.arm64.map.txt"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001913 srcs: ["libstdc++.map.txt"],
Elliott Hughes291f98a2022-06-30 23:35:11 +00001914 tools: ["generate-version-script"],
1915 cmd: "$(location generate-version-script) arm64 $(in) $(out)",
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001916}
1917
1918genrule {
Elliott Hughes604ab0f2022-10-17 19:58:22 +00001919 name: "libstdc++.riscv64.map",
Cole Faustf5968d82023-04-11 15:20:19 -07001920 out: ["libstdc++.riscv64.map.txt"],
Elliott Hughes604ab0f2022-10-17 19:58:22 +00001921 srcs: ["libstdc++.map.txt"],
1922 tools: ["generate-version-script"],
1923 cmd: "$(location generate-version-script) riscv64 $(in) $(out)",
1924}
1925
1926genrule {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001927 name: "libstdc++.x86.map",
Cole Faustf5968d82023-04-11 15:20:19 -07001928 out: ["libstdc++.x86.map.txt"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001929 srcs: ["libstdc++.map.txt"],
Elliott Hughes291f98a2022-06-30 23:35:11 +00001930 tools: ["generate-version-script"],
1931 cmd: "$(location generate-version-script) x86 $(in) $(out)",
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001932}
1933
1934genrule {
1935 name: "libstdc++.x86_64.map",
Cole Faustf5968d82023-04-11 15:20:19 -07001936 out: ["libstdc++.x86_64.map.txt"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001937 srcs: ["libstdc++.map.txt"],
Elliott Hughes291f98a2022-06-30 23:35:11 +00001938 tools: ["generate-version-script"],
1939 cmd: "$(location generate-version-script) x86_64 $(in) $(out)",
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001940}
1941
1942// ========================================================
1943// crt object files.
1944// ========================================================
1945
Colin Cross50c21ab2015-10-31 23:03:05 -07001946cc_defaults {
Colin Cross10d92682021-06-22 13:25:46 -07001947 name: "crt_and_memtag_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -08001948 defaults: ["linux_bionic_supported"],
Dan Willemsen230a7a42017-04-07 14:09:05 -07001949 vendor_available: true,
Justin Yun869a0fa2020-11-11 15:16:11 +09001950 product_available: true,
Yifan Hong5a39cee2020-01-21 16:43:56 -08001951 ramdisk_available: true,
Yifan Hongb04490d2020-10-21 18:36:36 -07001952 vendor_ramdisk_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +09001953 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +02001954 native_bridge_supported: true,
Jiyong Park922a5c72020-03-07 17:35:02 +09001955 apex_available: [
1956 "//apex_available:platform",
1957 "//apex_available:anyapex",
1958 ],
Dan Albertdc503f62020-07-15 17:22:18 -07001959 // Generate NDK variants of the CRT objects for every supported API level.
1960 min_sdk_version: "16",
1961 stl: "none",
1962 crt: true,
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001963 cflags: [
1964 "-Wno-gcc-compat",
1965 "-Wall",
1966 "-Werror",
1967 ],
Peter Collingbourne7eb851c2019-09-26 12:16:06 -07001968 sanitize: {
1969 never: true,
1970 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001971}
1972
Colin Cross50c21ab2015-10-31 23:03:05 -07001973cc_defaults {
Colin Cross10d92682021-06-22 13:25:46 -07001974 name: "crt_defaults",
1975 defaults: ["crt_and_memtag_defaults"],
Colin Cross02f81372021-07-22 12:02:10 -07001976 system_shared_libs: [],
Colin Cross10d92682021-06-22 13:25:46 -07001977}
1978
1979cc_defaults {
Colin Cross50c21ab2015-10-31 23:03:05 -07001980 name: "crt_so_defaults",
Colin Cross7d7b3682017-11-03 13:38:40 -07001981 defaults: ["crt_defaults"],
Colin Crossab179442018-09-27 11:03:22 -07001982 stl: "none",
Dan Willemsen208ae172015-09-16 16:33:27 -07001983}
1984
Dan Willemsen208ae172015-09-16 16:33:27 -07001985cc_object {
1986 name: "crtbrand",
Jingwen Chen7e13cf22021-02-23 00:43:01 -05001987 local_include_dirs: [
Jingwen Chen7e13cf22021-02-23 00:43:01 -05001988 "private", // crtbrand.S depends on private/bionic_asm_note.h
1989 ],
Elliott Hughes6a30b712024-03-13 23:41:32 +00001990 // crtbrand.S needs to know the platform SDK version.
Dan Willemsen208ae172015-09-16 16:33:27 -07001991 product_variables: {
1992 platform_sdk_version: {
1993 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1994 },
1995 },
1996 srcs: ["arch-common/bionic/crtbrand.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001997
Colin Cross7d7b3682017-11-03 13:38:40 -07001998 defaults: ["crt_so_defaults"],
Dan Alberteee46dc2023-04-04 23:27:52 +00001999 // crtbrand is an intermediate artifact, not a final CRT object.
2000 exclude_from_ndk_sysroot: true,
Dan Willemsen208ae172015-09-16 16:33:27 -07002001}
2002
Dan Willemsen208ae172015-09-16 16:33:27 -07002003cc_object {
Liz Kammere718dd72021-03-09 15:00:06 -05002004 name: "crtbegin_so",
Dan Willemsen208ae172015-09-16 16:33:27 -07002005 local_include_dirs: ["include"],
2006 srcs: ["arch-common/bionic/crtbegin_so.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002007
Colin Cross7d7b3682017-11-03 13:38:40 -07002008 defaults: ["crt_so_defaults"],
Colin Cross77d57bf2016-04-11 14:34:18 -07002009 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07002010 "crtbrand",
2011 ],
2012}
2013
Dan Willemsen208ae172015-09-16 16:33:27 -07002014cc_object {
2015 name: "crtend_so",
Liz Kammeraab2ad72021-03-15 18:03:24 -04002016 local_include_dirs: [
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002017 "private", // crtend_so.S depends on private/bionic_asm_arm64.h
Liz Kammeraab2ad72021-03-15 18:03:24 -04002018 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07002019 srcs: ["arch-common/bionic/crtend_so.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002020
Colin Cross7d7b3682017-11-03 13:38:40 -07002021 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002022}
2023
Dan Willemsen208ae172015-09-16 16:33:27 -07002024cc_object {
Liz Kammere718dd72021-03-09 15:00:06 -05002025 name: "crtbegin_static",
2026
Jingwen Chen0b1611e2021-02-18 23:22:03 -05002027 local_include_dirs: [
2028 "include",
2029 "bionic", // crtbegin.c includes bionic/libc_init_common.h
2030 ],
Liz Kammere718dd72021-03-09 15:00:06 -05002031
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002032 cflags: ["-DCRTBEGIN_STATIC"],
Yabin Cui744cfd32023-08-24 13:20:23 -07002033
Dan Willemsen208ae172015-09-16 16:33:27 -07002034 srcs: ["arch-common/bionic/crtbegin.c"],
Colin Cross77d57bf2016-04-11 14:34:18 -07002035 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07002036 "crtbrand",
2037 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07002038 defaults: ["crt_defaults"],
Jiyong Park268a6002021-01-12 23:14:37 +09002039 // When using libc.a, we're using the latest library regardless of target API level.
2040 min_sdk_version: "current",
Dan Willemsen208ae172015-09-16 16:33:27 -07002041}
2042
Dan Willemsen208ae172015-09-16 16:33:27 -07002043cc_object {
Liz Kammere718dd72021-03-09 15:00:06 -05002044 name: "crtbegin_dynamic",
2045
Jingwen Chen0b1611e2021-02-18 23:22:03 -05002046 local_include_dirs: [
2047 "include",
2048 "bionic", // crtbegin.c includes bionic/libc_init_common.h
2049 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07002050 srcs: ["arch-common/bionic/crtbegin.c"],
Colin Cross77d57bf2016-04-11 14:34:18 -07002051 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07002052 "crtbrand",
2053 ],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -07002054 target: {
2055 linux_bionic: {
2056 generated_sources: ["host_bionic_linker_asm"],
2057 objs: [
2058 "linker_wrapper",
2059 ],
2060 },
2061 },
Colin Cross50c21ab2015-10-31 23:03:05 -07002062 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002063}
2064
Dan Willemsen208ae172015-09-16 16:33:27 -07002065cc_object {
2066 // We rename crtend.o to crtend_android.o to avoid a
2067 // name clash between gcc and bionic.
2068 name: "crtend_android",
Liz Kammeraab2ad72021-03-15 18:03:24 -04002069 local_include_dirs: [
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002070 "private", // crtend.S depends on private/bionic_asm_arm64.h
Liz Kammeraab2ad72021-03-15 18:03:24 -04002071 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07002072 srcs: ["arch-common/bionic/crtend.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002073
Colin Cross50c21ab2015-10-31 23:03:05 -07002074 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002075}
Colin Crossbaa48992016-07-13 11:15:21 -07002076
Kalesh Singh862a23d2024-01-09 13:13:50 -08002077cc_object {
2078 name: "crt_pad_segment",
2079 local_include_dirs: [
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002080 "private", // crt_pad_segment.S depends on private/bionic_asm_note.h
Kalesh Singh862a23d2024-01-09 13:13:50 -08002081 ],
2082 srcs: ["arch-common/bionic/crt_pad_segment.S"],
2083
2084 defaults: ["crt_defaults"],
2085}
2086
Evgenii Stepanov8564b8d2020-12-15 13:55:32 -08002087cc_library_static {
2088 name: "note_memtag_heap_async",
2089 arch: {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002090 arm64: {
2091 srcs: ["arch-arm64/bionic/note_memtag_heap_async.S"],
2092 },
Evgenii Stepanov8564b8d2020-12-15 13:55:32 -08002093 },
Mitch Phillips22c90752021-03-03 15:39:57 -08002094 sdk_version: "minimum",
Evgenii Stepanov8564b8d2020-12-15 13:55:32 -08002095
Colin Cross10d92682021-06-22 13:25:46 -07002096 defaults: ["crt_and_memtag_defaults"],
Evgenii Stepanov8564b8d2020-12-15 13:55:32 -08002097}
2098
2099cc_library_static {
2100 name: "note_memtag_heap_sync",
2101 arch: {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002102 arm64: {
2103 srcs: ["arch-arm64/bionic/note_memtag_heap_sync.S"],
2104 },
Evgenii Stepanov8564b8d2020-12-15 13:55:32 -08002105 },
Mitch Phillips22c90752021-03-03 15:39:57 -08002106 sdk_version: "minimum",
Evgenii Stepanov8564b8d2020-12-15 13:55:32 -08002107
Colin Cross10d92682021-06-22 13:25:46 -07002108 defaults: ["crt_and_memtag_defaults"],
Evgenii Stepanov8564b8d2020-12-15 13:55:32 -08002109}
2110
Elliott Hughesd19b3c52018-09-06 16:04:08 -07002111// ========================================================
Pierre-Clément Tosi74a14582022-12-09 18:49:29 +00002112// libc dependencies for baremetal Rust projects.
2113// ========================================================
2114
Pierre-Clément Tosi199a62e2022-12-09 19:00:44 +00002115// This library contains the following unresolved symbols:
2116// __errno
Daniel Verkamp1c040692025-01-31 11:52:14 -08002117// __x86_shared_cache_size_half (x86_64 only)
Pierre-Clément Tosi199a62e2022-12-09 19:00:44 +00002118// abort
2119// async_safe_fatal_va_list
Pierre-Clément Tosi3af57992023-01-03 17:57:42 +00002120cc_library_static {
2121 name: "librust_baremetal",
Pierre-Clément Tosi9018e5f2024-10-02 15:57:00 +01002122 defaults: ["cc_baremetal_defaults"],
Pierre-Clément Tosi74a14582022-12-09 18:49:29 +00002123 header_libs: ["libc_headers"],
2124 include_dirs: [
2125 "bionic/libc/async_safe/include",
2126 "bionic/libc/platform",
2127 ],
2128 cflags: [
2129 "-Wall",
2130 "-Werror",
2131 ],
Pierre-Clément Tosi199a62e2022-12-09 19:00:44 +00002132 srcs: [
2133 "bionic/fortify.cpp",
Pierre-Clément Tosi816176c2022-11-30 14:33:41 +00002134 "bionic/strtol.cpp",
Pierre-Clément Tosi199a62e2022-12-09 19:00:44 +00002135 ],
2136 arch: {
Daniel Verkamp1c040692025-01-31 11:52:14 -08002137 arm: {
2138 enabled: false,
2139 },
Pierre-Clément Tosi199a62e2022-12-09 19:00:44 +00002140 arm64: {
Pierre-Clément Tosi199a62e2022-12-09 19:00:44 +00002141 srcs: [
2142 "arch-arm64/string/__memcpy_chk.S",
2143 ],
2144 },
Daniel Verkamp1c040692025-01-31 11:52:14 -08002145 x86: {
2146 enabled: false,
2147 },
2148 x86_64: {
Daniel Verkamp0c0f92c2025-02-11 10:39:39 -08002149 asflags: [
2150 // Statically choose the SSE2 memset_generic as memset for
2151 // baremetal, where we do not have the dynamic function
2152 // dispatch machinery.
2153 "-Dmemset_generic=memset",
2154 ],
Daniel Verkamp1c040692025-01-31 11:52:14 -08002155 srcs: [
2156 "arch-x86_64/string/sse2-memmove-slm.S",
2157 "arch-x86_64/string/sse2-memset-slm.S",
2158 "arch-x86_64/string/sse2-stpcpy-slm.S",
2159 "arch-x86_64/string/sse2-stpncpy-slm.S",
2160 "arch-x86_64/string/sse2-strcat-slm.S",
2161 "arch-x86_64/string/sse2-strcpy-slm.S",
2162 "arch-x86_64/string/sse2-strlen-slm.S",
2163 "arch-x86_64/string/sse2-strncat-slm.S",
2164 "arch-x86_64/string/sse2-strncpy-slm.S",
2165 "arch-x86_64/string/sse4-memcmp-slm.S",
2166 "arch-x86_64/string/ssse3-strcmp-slm.S",
2167 "arch-x86_64/string/ssse3-strncmp-slm.S",
2168 ],
2169 },
Pierre-Clément Tosi199a62e2022-12-09 19:00:44 +00002170 },
Pierre-Clément Tosi74a14582022-12-09 18:49:29 +00002171 whole_static_libs: [
George Burgess IVc5a98e62024-11-18 14:50:32 -07002172 "//external/llvm-libc:llvmlibc",
Pierre-Clément Tosi74a14582022-12-09 18:49:29 +00002173 "libarm-optimized-routines-mem",
Pierre-Clément Tosieb46ac92023-02-01 13:44:57 +00002174 "libc_netbsd",
Pierre-Clément Tosi74a14582022-12-09 18:49:29 +00002175 ],
Pierre-Clément Tosi3af57992023-01-03 17:57:42 +00002176 system_shared_libs: [],
2177 nocrt: true,
2178 stl: "none",
Pierre-Clément Tosi74a14582022-12-09 18:49:29 +00002179 visibility: [
Jiyong Park072ce532024-07-22 11:20:47 +09002180 "//packages/modules/Virtualization/libs/libvmbase",
Pierre-Clément Tosi74a14582022-12-09 18:49:29 +00002181 ],
Zijun427504a2024-08-15 23:16:27 +00002182
2183 // b/358211032: This library gets linked into a rust rlib. Disable LTO
2184 // until cross-language lto is supported.
2185 lto: {
2186 never: true,
2187 },
Pierre-Clément Tosi74a14582022-12-09 18:49:29 +00002188}
2189
2190// ========================================================
Elliott Hughesd19b3c52018-09-06 16:04:08 -07002191// NDK headers.
2192// ========================================================
2193
Dan Albertcce54372024-08-22 18:24:30 +00002194ndk_headers {
Dan Albert22805ea2017-03-22 15:28:05 -07002195 name: "common_libc",
2196 from: "include",
2197 to: "",
Dan Albertcce54372024-08-22 18:24:30 +00002198 srcs: ["include/**/*.h"],
Dan Albert22805ea2017-03-22 15:28:05 -07002199 license: "NOTICE",
Dan Albertcce54372024-08-22 18:24:30 +00002200 // These don't pass the bad verification we do because many of them are
2201 // arch-specific, and they aren't necessarily independently includable.
2202 // That's not much of a problem though, since C-incompaitibilities in the
2203 // UAPI headers should run into problems long before they reach us.
2204 skip_verification: true,
Dan Albert22805ea2017-03-22 15:28:05 -07002205}
Dan Albert4238a352016-06-28 11:18:05 -07002206
2207ndk_headers {
Dan Albert063e86a2016-11-29 11:09:12 -08002208 name: "libc_uapi",
2209 from: "kernel/uapi",
2210 to: "",
2211 srcs: [
2212 "kernel/uapi/asm-generic/**/*.h",
2213 "kernel/uapi/drm/**/*.h",
2214 "kernel/uapi/linux/**/*.h",
2215 "kernel/uapi/misc/**/*.h",
2216 "kernel/uapi/mtd/**/*.h",
2217 "kernel/uapi/rdma/**/*.h",
2218 "kernel/uapi/scsi/**/*.h",
2219 "kernel/uapi/sound/**/*.h",
2220 "kernel/uapi/video/**/*.h",
2221 "kernel/uapi/xen/**/*.h",
2222 ],
Dan Albert92592652016-10-20 01:42:54 -07002223 license: "NOTICE",
Dan Albert6aa62772024-08-13 22:01:23 +00002224 skip_verification: true,
Dan Albert4238a352016-06-28 11:18:05 -07002225}
2226
2227ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002228 name: "libc_kernel_android_uapi_linux",
Dan Albertbae16ef2016-09-14 17:15:48 -07002229 from: "kernel/android/uapi/linux",
2230 to: "linux",
2231 srcs: ["kernel/android/uapi/linux/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002232 license: "NOTICE",
Dan Albertbae16ef2016-09-14 17:15:48 -07002233}
2234
2235ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002236 name: "libc_kernel_android_scsi",
Elliott Hughes50599392017-05-25 17:13:32 -07002237 from: "kernel/android/scsi/scsi",
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002238 to: "scsi",
2239 srcs: ["kernel/android/scsi/**/*.h"],
2240 license: "NOTICE",
Dan Albert6aa62772024-08-13 22:01:23 +00002241 skip_verification: true,
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002242}
2243
2244ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002245 name: "libc_asm_arm",
2246 from: "kernel/uapi/asm-arm",
2247 to: "arm-linux-androideabi",
2248 srcs: ["kernel/uapi/asm-arm/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002249 license: "NOTICE",
Dan Albert6aa62772024-08-13 22:01:23 +00002250 skip_verification: true,
Dan Albert4238a352016-06-28 11:18:05 -07002251}
2252
2253ndk_headers {
2254 name: "libc_asm_arm64",
2255 from: "kernel/uapi/asm-arm64",
2256 to: "aarch64-linux-android",
2257 srcs: ["kernel/uapi/asm-arm64/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002258 license: "NOTICE",
Dan Albert6aa62772024-08-13 22:01:23 +00002259 skip_verification: true,
Dan Albert4238a352016-06-28 11:18:05 -07002260}
2261
Lazar Trsic790d2f72017-11-27 11:54:11 +01002262ndk_headers {
Colin Crossbd26e0f2022-10-19 15:03:14 -07002263 name: "libc_asm_riscv64",
2264 from: "kernel/uapi/asm-riscv",
2265 to: "riscv64-linux-android",
2266 srcs: ["kernel/uapi/asm-riscv/**/*.h"],
2267 license: "NOTICE",
Dan Albert6aa62772024-08-13 22:01:23 +00002268 skip_verification: true,
Colin Crossbd26e0f2022-10-19 15:03:14 -07002269}
2270
2271ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002272 name: "libc_asm_x86",
2273 from: "kernel/uapi/asm-x86",
2274 to: "i686-linux-android",
2275 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002276 license: "NOTICE",
Dan Albert6aa62772024-08-13 22:01:23 +00002277 skip_verification: true,
Dan Albert4238a352016-06-28 11:18:05 -07002278}
2279
2280ndk_headers {
2281 name: "libc_asm_x86_64",
2282 from: "kernel/uapi/asm-x86",
2283 to: "x86_64-linux-android",
2284 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002285 license: "NOTICE",
Dan Albert6aa62772024-08-13 22:01:23 +00002286 skip_verification: true,
Dan Albert4238a352016-06-28 11:18:05 -07002287}
2288
Dan Albert4238a352016-06-28 11:18:05 -07002289ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002290 name: "libc",
Dan Albert4238a352016-06-28 11:18:05 -07002291 symbol_file: "libc.map.txt",
2292 first_version: "9",
2293}
2294
Dan Albertdf31aff2016-10-06 15:50:41 -07002295ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002296 name: "libstdc++",
Dan Albertdf31aff2016-10-06 15:50:41 -07002297 symbol_file: "libstdc++.map.txt",
2298 first_version: "9",
2299}
2300
Dan Willemsenca056d72018-01-08 14:00:24 -08002301// Export these headers for toolbox to process
2302filegroup {
2303 name: "kernel_input_headers",
2304 srcs: [
2305 "kernel/uapi/linux/input.h",
2306 "kernel/uapi/linux/input-event-codes.h",
2307 ],
2308}
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002309
2310// Generate a syscall name / number mapping. These objects are text files
2311// (thanks to the -dD -E flags) and not binary files. They will then be
2312// consumed by the genseccomp.py script and converted into C++ code.
2313cc_defaults {
2314 name: "libseccomp_gen_syscall_nrs_defaults",
2315 recovery_available: true,
2316 srcs: ["seccomp/gen_syscall_nrs.cpp"],
2317 cflags: [
2318 "-dD",
2319 "-E",
2320 "-Wall",
2321 "-Werror",
Ryan Prichardeffe86f2024-12-18 17:07:37 -08002322 // Soong implicitly adds a -c argument that we override with -E.
2323 // Suppress Clang's error about the unused -c argument.
2324 "-Wno-unused-command-line-argument",
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002325 "-nostdinc",
2326 ],
2327}
2328
2329cc_object {
2330 name: "libseccomp_gen_syscall_nrs_arm",
2331 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2332 local_include_dirs: [
2333 "kernel/uapi/asm-arm",
2334 "kernel/uapi",
2335 ],
2336}
2337
2338cc_object {
2339 name: "libseccomp_gen_syscall_nrs_arm64",
2340 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2341 local_include_dirs: [
2342 "kernel/uapi/asm-arm64",
2343 "kernel/uapi",
2344 ],
2345}
2346
2347cc_object {
Elliott Hughes704772b2022-10-10 17:06:43 +00002348 name: "libseccomp_gen_syscall_nrs_riscv64",
2349 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2350 local_include_dirs: [
2351 "kernel/uapi/asm-riscv",
2352 "kernel/uapi",
2353 ],
2354}
2355
2356cc_object {
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002357 name: "libseccomp_gen_syscall_nrs_x86",
2358 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2359 srcs: ["seccomp/gen_syscall_nrs_x86.cpp"],
2360 exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"],
2361 local_include_dirs: [
2362 "kernel/uapi/asm-x86",
2363 "kernel/uapi",
2364 ],
2365}
2366
2367cc_object {
2368 name: "libseccomp_gen_syscall_nrs_x86_64",
2369 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2370 srcs: ["seccomp/gen_syscall_nrs_x86_64.cpp"],
2371 exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"],
2372 local_include_dirs: [
2373 "kernel/uapi/asm-x86",
2374 "kernel/uapi",
2375 ],
2376}
2377
Jingwen Chenca366332021-01-29 05:16:32 -05002378filegroup {
2379 name: "all_kernel_uapi_headers",
2380 srcs: ["kernel/uapi/**/*.h"],
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002381}
2382
Martijn Coenen0c6de752019-01-02 12:52:51 +01002383cc_genrule {
2384 name: "func_to_syscall_nrs",
2385 recovery_available: true,
2386 cmd: "$(location genfunctosyscallnrs) --out-dir=$(genDir) $(in)",
2387
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002388 tools: ["genfunctosyscallnrs"],
Martijn Coenen0c6de752019-01-02 12:52:51 +01002389
2390 srcs: [
2391 "SYSCALLS.TXT",
Martijn Coenen0c6de752019-01-02 12:52:51 +01002392 ],
2393
Elliott Hughes704772b2022-10-10 17:06:43 +00002394 arch: {
2395 arm: {
2396 srcs: [
2397 ":libseccomp_gen_syscall_nrs_arm",
2398 ":libseccomp_gen_syscall_nrs_arm64",
2399 ],
2400 },
2401 arm64: {
2402 srcs: [
2403 ":libseccomp_gen_syscall_nrs_arm",
2404 ":libseccomp_gen_syscall_nrs_arm64",
2405 ],
2406 },
2407 riscv64: {
2408 srcs: [":libseccomp_gen_syscall_nrs_riscv64"],
2409 },
2410 x86: {
2411 srcs: [
2412 ":libseccomp_gen_syscall_nrs_x86",
2413 ":libseccomp_gen_syscall_nrs_x86_64",
2414 ],
2415 },
2416 x86_64: {
2417 srcs: [
2418 ":libseccomp_gen_syscall_nrs_x86",
2419 ":libseccomp_gen_syscall_nrs_x86_64",
2420 ],
2421 },
2422 },
2423
Martijn Coenen0c6de752019-01-02 12:52:51 +01002424 out: [
2425 "func_to_syscall_nrs.h",
2426 ],
2427}
2428
Victor Hsiehdbb86702020-06-15 09:29:07 -07002429// SECCOMP_BLOCKLIST_APP_ZYGOTE.TXT = SECCOMP_BLOCKLIST_APP.txt - setresgid*
Martijn Coenenc3752be2019-01-09 16:19:57 +01002430genrule {
Victor Hsiehdbb86702020-06-15 09:29:07 -07002431 name: "generate_app_zygote_blocklist",
2432 out: ["SECCOMP_BLOCKLIST_APP_ZYGOTE.TXT"],
2433 srcs: ["SECCOMP_BLOCKLIST_APP.TXT"],
Elliott Hughes6de2a8b2025-02-14 09:07:45 -08002434 cmd: "grep -v '^setresgid' $(in) > $(out)",
Martijn Coenenc3752be2019-01-09 16:19:57 +01002435}
2436
Yu Liu938ec9b2022-10-17 16:36:30 -07002437filegroup {
2438 name: "seccomp_syscalls_sources_zygote",
Martijn Coenenc3752be2019-01-09 16:19:57 +01002439 srcs: [
2440 "SYSCALLS.TXT",
Victor Hsiehdbb86702020-06-15 09:29:07 -07002441 "SECCOMP_ALLOWLIST_COMMON.TXT",
2442 "SECCOMP_ALLOWLIST_APP.TXT",
2443 "SECCOMP_BLOCKLIST_COMMON.TXT",
Bram Bonnéacadd092020-05-06 13:49:55 +02002444 "SECCOMP_PRIORITY.TXT",
Victor Hsiehdbb86702020-06-15 09:29:07 -07002445 ":generate_app_zygote_blocklist",
Martijn Coenenc3752be2019-01-09 16:19:57 +01002446 ],
Martijn Coenenc3752be2019-01-09 16:19:57 +01002447}
2448
Yu Liu938ec9b2022-10-17 16:36:30 -07002449filegroup {
2450 name: "seccomp_syscalls_sources_app",
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002451 srcs: [
2452 "SYSCALLS.TXT",
Victor Hsiehdbb86702020-06-15 09:29:07 -07002453 "SECCOMP_ALLOWLIST_COMMON.TXT",
2454 "SECCOMP_ALLOWLIST_APP.TXT",
2455 "SECCOMP_BLOCKLIST_COMMON.TXT",
2456 "SECCOMP_BLOCKLIST_APP.TXT",
Bram Bonnéacadd092020-05-06 13:49:55 +02002457 "SECCOMP_PRIORITY.TXT",
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002458 ],
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002459}
2460
Yu Liu938ec9b2022-10-17 16:36:30 -07002461filegroup {
2462 name: "seccomp_syscalls_sources_system",
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002463 srcs: [
2464 "SYSCALLS.TXT",
Victor Hsiehdbb86702020-06-15 09:29:07 -07002465 "SECCOMP_ALLOWLIST_COMMON.TXT",
2466 "SECCOMP_ALLOWLIST_SYSTEM.TXT",
2467 "SECCOMP_BLOCKLIST_COMMON.TXT",
Bram Bonnéacadd092020-05-06 13:49:55 +02002468 "SECCOMP_PRIORITY.TXT",
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002469 ],
Yu Liu938ec9b2022-10-17 16:36:30 -07002470}
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002471
Yu Liu938ec9b2022-10-17 16:36:30 -07002472cc_genrule {
2473 name: "libseccomp_policy_app_zygote_sources_x86",
2474 recovery_available: true,
2475 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002476 tools: ["genseccomp"],
Yu Liu938ec9b2022-10-17 16:36:30 -07002477 srcs: [
2478 ":seccomp_syscalls_sources_zygote",
2479 ":libseccomp_gen_syscall_nrs_x86",
2480 ":libseccomp_gen_syscall_nrs_x86_64",
2481 ],
2482 out: [
2483 "x86_app_zygote_policy.cpp",
2484 "x86_64_app_zygote_policy.cpp",
2485 ],
2486 enabled: false,
Yu Liu3a579692022-10-18 03:02:32 +00002487 arch: {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002488 x86: {
2489 enabled: true,
2490 },
2491 x86_64: {
2492 enabled: true,
2493 },
Yu Liu938ec9b2022-10-17 16:36:30 -07002494 },
2495}
2496
2497cc_genrule {
2498 name: "libseccomp_policy_app_zygote_sources_arm",
2499 recovery_available: true,
2500 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002501 tools: ["genseccomp"],
Yu Liu938ec9b2022-10-17 16:36:30 -07002502 srcs: [
2503 ":seccomp_syscalls_sources_zygote",
2504 ":libseccomp_gen_syscall_nrs_arm",
2505 ":libseccomp_gen_syscall_nrs_arm64",
2506 ],
2507 out: [
2508 "arm_app_zygote_policy.cpp",
2509 "arm64_app_zygote_policy.cpp",
2510 ],
2511 enabled: false,
2512 arch: {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002513 arm: {
2514 enabled: true,
2515 },
2516 arm64: {
2517 enabled: true,
2518 },
Yu Liu938ec9b2022-10-17 16:36:30 -07002519 },
2520}
2521
2522cc_genrule {
2523 name: "libseccomp_policy_app_zygote_sources_riscv64",
2524 recovery_available: true,
2525 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002526 tools: ["genseccomp"],
Yu Liu938ec9b2022-10-17 16:36:30 -07002527 srcs: [
2528 ":seccomp_syscalls_sources_zygote",
2529 ":libseccomp_gen_syscall_nrs_riscv64",
2530 ],
2531 out: [
2532 "riscv64_app_zygote_policy.cpp",
2533 ],
2534 enabled: false,
2535 arch: {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002536 riscv64: {
2537 enabled: true,
2538 },
Yu Liu938ec9b2022-10-17 16:36:30 -07002539 },
2540}
2541
2542cc_genrule {
2543 name: "libseccomp_policy_app_sources_x86",
2544 recovery_available: true,
2545 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002546 tools: ["genseccomp"],
Yu Liu938ec9b2022-10-17 16:36:30 -07002547 srcs: [
2548 ":seccomp_syscalls_sources_app",
2549 ":libseccomp_gen_syscall_nrs_x86",
2550 ":libseccomp_gen_syscall_nrs_x86_64",
2551 ],
2552 out: [
2553 "x86_app_policy.cpp",
2554 "x86_64_app_policy.cpp",
2555 ],
2556 enabled: false,
2557 arch: {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002558 x86: {
2559 enabled: true,
2560 },
2561 x86_64: {
2562 enabled: true,
2563 },
Yu Liu938ec9b2022-10-17 16:36:30 -07002564 },
2565}
2566
2567cc_genrule {
2568 name: "libseccomp_policy_app_sources_arm",
2569 recovery_available: true,
2570 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002571 tools: ["genseccomp"],
Yu Liu938ec9b2022-10-17 16:36:30 -07002572 srcs: [
2573 ":seccomp_syscalls_sources_app",
2574 ":libseccomp_gen_syscall_nrs_arm",
2575 ":libseccomp_gen_syscall_nrs_arm64",
2576 ],
2577 out: [
2578 "arm_app_policy.cpp",
2579 "arm64_app_policy.cpp",
2580 ],
2581 enabled: false,
2582 arch: {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002583 arm: {
2584 enabled: true,
2585 },
2586 arm64: {
2587 enabled: true,
2588 },
Yu Liu938ec9b2022-10-17 16:36:30 -07002589 },
2590}
2591
2592cc_genrule {
2593 name: "libseccomp_policy_app_sources_riscv64",
2594 recovery_available: true,
2595 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002596 tools: ["genseccomp"],
Yu Liu938ec9b2022-10-17 16:36:30 -07002597 srcs: [
2598 ":seccomp_syscalls_sources_app",
2599 ":libseccomp_gen_syscall_nrs_riscv64",
2600 ],
2601 out: [
2602 "riscv64_app_policy.cpp",
2603 ],
2604 enabled: false,
2605 arch: {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002606 riscv64: {
2607 enabled: true,
2608 },
Yu Liu938ec9b2022-10-17 16:36:30 -07002609 },
2610}
2611
2612cc_genrule {
2613 name: "libseccomp_policy_system_sources_x86",
2614 recovery_available: true,
2615 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002616 tools: ["genseccomp"],
Yu Liu938ec9b2022-10-17 16:36:30 -07002617 srcs: [
2618 ":seccomp_syscalls_sources_system",
2619 ":libseccomp_gen_syscall_nrs_x86",
2620 ":libseccomp_gen_syscall_nrs_x86_64",
2621 ],
2622 out: [
2623 "x86_system_policy.cpp",
2624 "x86_64_system_policy.cpp",
2625 ],
2626 enabled: false,
2627 arch: {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002628 x86: {
2629 enabled: true,
2630 },
2631 x86_64: {
2632 enabled: true,
2633 },
Yu Liu938ec9b2022-10-17 16:36:30 -07002634 },
2635}
2636
2637cc_genrule {
2638 name: "libseccomp_policy_system_sources_arm",
2639 recovery_available: true,
2640 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002641 tools: ["genseccomp"],
Yu Liu938ec9b2022-10-17 16:36:30 -07002642 srcs: [
2643 ":seccomp_syscalls_sources_system",
2644 ":libseccomp_gen_syscall_nrs_arm",
2645 ":libseccomp_gen_syscall_nrs_arm64",
2646 ],
2647 out: [
2648 "arm_system_policy.cpp",
2649 "arm64_system_policy.cpp",
2650 ],
2651 enabled: false,
2652 arch: {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002653 arm: {
2654 enabled: true,
2655 },
2656 arm64: {
2657 enabled: true,
2658 },
Yu Liu938ec9b2022-10-17 16:36:30 -07002659 },
2660}
2661
2662cc_genrule {
2663 name: "libseccomp_policy_system_sources_riscv64",
2664 recovery_available: true,
2665 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)",
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002666 tools: ["genseccomp"],
Yu Liu938ec9b2022-10-17 16:36:30 -07002667 srcs: [
2668 ":seccomp_syscalls_sources_system",
2669 ":libseccomp_gen_syscall_nrs_riscv64",
2670 ],
2671 out: [
2672 "riscv64_system_policy.cpp",
2673 ],
2674 enabled: false,
2675 arch: {
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002676 riscv64: {
2677 enabled: true,
2678 },
Yu Liu3a579692022-10-18 03:02:32 +00002679 },
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002680}
2681
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002682cc_library {
2683 name: "libseccomp_policy",
2684 recovery_available: true,
Martijn Coenend269d9b2018-11-08 16:41:42 +01002685 generated_headers: ["func_to_syscall_nrs"],
Yu Liu938ec9b2022-10-17 16:36:30 -07002686
2687 arch: {
2688 arm: {
2689 generated_sources: [
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002690 "libseccomp_policy_app_sources_arm",
2691 "libseccomp_policy_app_zygote_sources_arm",
2692 "libseccomp_policy_system_sources_arm",
Yu Liu938ec9b2022-10-17 16:36:30 -07002693 ],
2694 },
2695 arm64: {
2696 generated_sources: [
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002697 "libseccomp_policy_app_sources_arm",
2698 "libseccomp_policy_app_zygote_sources_arm",
2699 "libseccomp_policy_system_sources_arm",
Yu Liu938ec9b2022-10-17 16:36:30 -07002700 ],
2701 },
2702 riscv64: {
2703 generated_sources: [
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002704 "libseccomp_policy_app_sources_riscv64",
2705 "libseccomp_policy_app_zygote_sources_riscv64",
2706 "libseccomp_policy_system_sources_riscv64",
Yu Liu938ec9b2022-10-17 16:36:30 -07002707 ],
2708 },
2709 x86: {
2710 generated_sources: [
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002711 "libseccomp_policy_app_sources_x86",
2712 "libseccomp_policy_app_zygote_sources_x86",
2713 "libseccomp_policy_system_sources_x86",
Yu Liu938ec9b2022-10-17 16:36:30 -07002714 ],
2715 },
2716 x86_64: {
2717 generated_sources: [
Elliott Hughes1eacc0e2024-01-19 19:05:36 +00002718 "libseccomp_policy_app_sources_x86",
2719 "libseccomp_policy_app_zygote_sources_x86",
2720 "libseccomp_policy_system_sources_x86",
Yu Liu938ec9b2022-10-17 16:36:30 -07002721 ],
2722 },
2723 },
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002724
2725 srcs: [
2726 "seccomp/seccomp_policy.cpp",
2727 ],
2728
2729 export_include_dirs: ["seccomp/include"],
2730 cflags: [
2731 "-Wall",
2732 "-Werror",
2733 ],
2734 shared: {
2735 shared_libs: ["libbase"],
2736 },
2737 static: {
2738 static_libs: ["libbase"],
2739 },
2740}
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002741
Elliott Hughes241a3672025-02-18 13:52:09 -08002742// TODO: add this directly to musl like libexecinfo and libb64?
Colin Cross048f24e2021-09-01 17:26:00 -07002743cc_library_host_static {
2744 name: "libfts",
2745 srcs: [
2746 "bionic/fts.c",
2747 "upstream-openbsd/lib/libc/stdlib/recallocarray.c",
2748 ],
2749 export_include_dirs: ["fts/include"],
2750 local_include_dirs: [
2751 "private",
2752 "upstream-openbsd/android/include",
2753 ],
2754 cflags: [
Elliott Hughes241a3672025-02-18 13:52:09 -08002755 "-std=gnu99",
Colin Cross048f24e2021-09-01 17:26:00 -07002756 "-include openbsd-compat.h",
2757 "-Wno-unused-parameter",
2758 ],
2759 enabled: false,
2760 target: {
2761 musl: {
2762 enabled: true,
2763 },
2764 },
Colin Cross2a9843f2022-01-13 12:26:30 -08002765 stl: "none",
2766}
2767
2768cc_library_host_static {
2769 name: "libexecinfo",
2770 visibility: ["//external/musl"],
2771 srcs: ["bionic/execinfo.cpp"],
2772 export_include_dirs: ["execinfo/include"],
2773 local_include_dirs: ["private"],
2774 enabled: false,
2775 target: {
2776 musl: {
2777 enabled: true,
2778 system_shared_libs: [],
2779 header_libs: ["libc_musl_headers"],
2780 },
2781 },
2782 stl: "none",
Colin Cross048f24e2021-09-01 17:26:00 -07002783}
2784
Colin Cross9da85fa2022-01-24 18:20:05 -08002785cc_library_host_static {
2786 name: "libb64",
2787 visibility: ["//external/musl"],
2788 srcs: ["upstream-openbsd/lib/libc/net/base64.c"],
2789 export_include_dirs: ["b64/include"],
2790 local_include_dirs: [
2791 "private",
2792 "upstream-openbsd/android/include",
2793 ],
2794 cflags: [
Elliott Hughes241a3672025-02-18 13:52:09 -08002795 "-std=gnu99",
Colin Cross9da85fa2022-01-24 18:20:05 -08002796 "-include openbsd-compat.h",
2797 ],
2798 enabled: false,
2799 target: {
2800 musl: {
2801 enabled: true,
2802 system_shared_libs: [],
2803 header_libs: ["libc_musl_headers"],
2804 },
2805 },
2806 stl: "none",
2807}
2808
Colin Cross9d4a56e2022-02-03 10:20:32 -08002809// Export kernel uapi headers to be used in the musl sysroot.
2810// Also include the execinfo headers for the libexecinfo and the
2811// b64 headers for libb64 embedded in musl libc.
2812cc_genrule {
2813 name: "libc_musl_sysroot_bionic_headers",
2814 visibility: ["//external/musl"],
2815 host_supported: true,
2816 device_supported: false,
2817 enabled: false,
2818 target: {
2819 musl: {
2820 enabled: true,
2821 },
2822 },
2823 srcs: [
2824 "kernel/uapi/**/*.h",
2825 "kernel/android/**/*.h",
Colin Cross9d4a56e2022-02-03 10:20:32 -08002826 "execinfo/include/**/*.h",
Colin Cross9d4a56e2022-02-03 10:20:32 -08002827 "b64/include/**/*.h",
Colin Crossaeef9f02022-02-07 21:01:26 -08002828
Colin Crossaeef9f02022-02-07 21:01:26 -08002829 "NOTICE",
Colin Cross9d4a56e2022-02-03 10:20:32 -08002830
2831 ":libc_musl_sysroot_bionic_arch_headers",
2832 ],
2833 out: ["libc_musl_sysroot_bionic_headers.zip"],
2834 tools: [
2835 "soong_zip",
2836 "merge_zips",
2837 "zip2zip",
2838 ],
Colin Crossaeef9f02022-02-07 21:01:26 -08002839 cmd: "BIONIC_LIBC_DIR=$$(dirname $(location NOTICE)) && " +
2840 "$(location soong_zip) -o $(genDir)/sysroot.zip -symlinks=false" +
Colin Crossad33d022022-02-25 18:27:04 -08002841 // NOTICE
2842 " -j -f $(location NOTICE) " +
Colin Cross9d4a56e2022-02-03 10:20:32 -08002843 // headers
2844 " -P include " +
Colin Crossaeef9f02022-02-07 21:01:26 -08002845 " -C $${BIONIC_LIBC_DIR}/kernel/uapi " +
2846 " -D $${BIONIC_LIBC_DIR}/kernel/uapi " +
2847 " -C $${BIONIC_LIBC_DIR}/kernel/android/scsi " +
2848 " -D $${BIONIC_LIBC_DIR}/kernel/android/scsi " +
2849 " -C $${BIONIC_LIBC_DIR}/kernel/android/uapi " +
2850 " -D $${BIONIC_LIBC_DIR}/kernel/android/uapi " +
2851 " -C $${BIONIC_LIBC_DIR}/execinfo/include " +
2852 " -D $${BIONIC_LIBC_DIR}/execinfo/include " +
2853 " -C $${BIONIC_LIBC_DIR}/b64/include " +
2854 " -D $${BIONIC_LIBC_DIR}/b64/include " +
Colin Cross9d4a56e2022-02-03 10:20:32 -08002855 " && " +
Colin Crossad33d022022-02-25 18:27:04 -08002856 "$(location zip2zip) -i $(genDir)/sysroot.zip -o $(genDir)/sysroot-renamed.zip " +
Colin Cross1c0a7a02022-08-11 12:22:26 -07002857 " -x **/BUILD " +
Colin Crossad33d022022-02-25 18:27:04 -08002858 " include/**/*:include/ " +
2859 " NOTICE:NOTICE.bionic " +
2860 " && " +
2861 "$(location merge_zips) $(out) $(location :libc_musl_sysroot_bionic_arch_headers) $(genDir)/sysroot-renamed.zip",
Colin Cross9d4a56e2022-02-03 10:20:32 -08002862}
2863
2864// The architecture-specific bits have to be handled separately because the label varies based
2865// on architecture, which prevents using $(locations) to find them and requires using $(in)
2866// instead, which would mix in all the other files if this were part of the main libc_musl_sysroot
2867// genrule.
2868cc_genrule {
2869 name: "libc_musl_sysroot_bionic_arch_headers",
2870 visibility: ["//visibility:private"],
2871 host_supported: true,
2872 device_supported: false,
2873 enabled: false,
2874 target: {
2875 musl: {
2876 enabled: true,
2877 },
2878 },
2879 arch: {
2880 arm: {
2881 srcs: ["kernel/uapi/asm-arm/**/*.h"],
2882 },
2883 arm64: {
2884 srcs: ["kernel/uapi/asm-arm64/**/*.h"],
2885 },
2886 x86: {
2887 srcs: ["kernel/uapi/asm-x86/**/*.h"],
2888 },
2889 x86_64: {
2890 srcs: ["kernel/uapi/asm-x86/**/*.h"],
2891 },
2892 },
2893 out: ["libc_musl_sysroot_bionic_arch_headers.zip"],
2894 tools: ["soong_zip"],
2895 cmd: "includes=($(in)) && $(location soong_zip) -o $(out) -P include/asm -j -D $$(dirname $${includes[0]})",
2896}
Colin Cross290c4952022-10-13 12:51:13 -07002897
2898cc_genrule {
2899 name: "bionic_sysroot_crt_objects",
2900 visibility: ["//visibility:private"],
2901 out: ["bionic_sysroot_crt_objects.zip"],
2902 tools: ["soong_zip"],
2903 srcs: [
2904 ":crtbegin_dynamic",
2905 ":crtbegin_so",
2906 ":crtbegin_static",
2907 ":crtend_android",
2908 ":crtend_so",
2909 ],
2910 cmd: "$(location soong_zip) -o $(out) -j " +
2911 "-f $(location :crtbegin_dynamic) " +
2912 "-f $(location :crtbegin_so) " +
2913 "-f $(location :crtbegin_static) " +
2914 "-f $(location :crtend_android) " +
2915 "-f $(location :crtend_so)",
2916 dist: {
2917 targets: ["bionic_sysroot_crt_objects"],
2918 },
2919 arch: {
2920 arm: {
2921 dist: {
2922 suffix: "_arm",
2923 },
2924 },
2925 arm64: {
2926 dist: {
2927 suffix: "_arm64",
2928 },
2929 },
2930 riscv64: {
2931 dist: {
2932 suffix: "_riscv64",
2933 },
2934 },
2935 x86: {
2936 dist: {
2937 suffix: "_x86",
2938 },
2939 },
2940 x86_64: {
2941 dist: {
2942 suffix: "_x86_64",
2943 },
2944 },
2945 },
2946}
Spandan Das8fce52a2023-09-28 18:00:12 +00002947
Jiyong Park35a280d2024-05-03 16:53:39 +09002948filegroup {
2949 name: "linux_capability_header",
2950 srcs: ["kernel/uapi/linux/capability.h"],
2951}