2015-09-17 01:33:27 +02:00
|
|
|
// Define the common source files for all the libc instances
|
|
|
|
// =========================================================
|
2021-02-19 22:06:22 +01:00
|
|
|
package {
|
|
|
|
default_applicable_licenses: ["bionic_libc_license"],
|
|
|
|
}
|
|
|
|
|
|
|
|
license {
|
|
|
|
name: "bionic_libc_license",
|
|
|
|
visibility: [":__subpackages__"],
|
|
|
|
license_kinds: [
|
|
|
|
"SPDX-license-identifier-Apache-2.0",
|
|
|
|
"SPDX-license-identifier-BSD",
|
|
|
|
"SPDX-license-identifier-ISC",
|
|
|
|
"SPDX-license-identifier-MIT",
|
|
|
|
"legacy_notice",
|
|
|
|
"legacy_unencumbered",
|
|
|
|
],
|
|
|
|
license_text: [
|
|
|
|
"NOTICE",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
libc_common_src_files = [
|
|
|
|
"bionic/ether_aton.c",
|
|
|
|
"bionic/ether_ntoa.c",
|
2020-06-09 21:57:05 +02:00
|
|
|
"bionic/exit.cpp",
|
2015-09-17 01:33:27 +02:00
|
|
|
"bionic/initgroups.c",
|
|
|
|
"bionic/isatty.c",
|
|
|
|
"bionic/sched_cpualloc.c",
|
|
|
|
"bionic/sched_cpucount.c",
|
2020-12-01 00:04:14 +01:00
|
|
|
"bionic/sysprop_helpers.cpp",
|
2017-07-20 02:20:24 +02:00
|
|
|
"stdio/fmemopen.cpp",
|
2016-08-27 01:17:17 +02:00
|
|
|
"stdio/parsefloat.c",
|
2015-10-15 23:49:45 +02:00
|
|
|
"stdio/refill.c",
|
2016-02-04 06:48:08 +01:00
|
|
|
"stdio/stdio.cpp",
|
2015-09-17 01:33:27 +02:00
|
|
|
"stdio/stdio_ext.cpp",
|
2018-01-18 19:21:29 +01:00
|
|
|
"stdio/vfscanf.cpp",
|
2022-08-06 00:51:05 +02:00
|
|
|
"stdio/vfwscanf.cpp",
|
2015-09-17 01:33:27 +02:00
|
|
|
]
|
|
|
|
|
2019-12-11 19:00:58 +01:00
|
|
|
// off64_t/time64_t support on LP32.
|
2015-09-17 01:33:27 +02:00
|
|
|
// ========================================================
|
|
|
|
libc_common_src_files_32 = [
|
|
|
|
"bionic/legacy_32_bit_support.cpp",
|
|
|
|
"bionic/time64.c",
|
|
|
|
]
|
|
|
|
|
2016-08-09 22:06:41 +02:00
|
|
|
libc_common_flags = [
|
|
|
|
"-D_LIBC=1",
|
2018-02-13 00:48:01 +01:00
|
|
|
"-D__BIONIC_LP32_USE_STAT64",
|
2016-08-09 22:06:41 +02:00
|
|
|
"-Wall",
|
|
|
|
"-Wextra",
|
|
|
|
"-Wunused",
|
2018-01-20 02:58:07 +01:00
|
|
|
"-Wno-char-subscripts",
|
2016-08-09 22:06:41 +02:00
|
|
|
"-Wno-deprecated-declarations",
|
2017-07-25 01:53:11 +02:00
|
|
|
"-Wno-gcc-compat",
|
2016-08-17 00:57:47 +02:00
|
|
|
"-Wframe-larger-than=2048",
|
2023-09-12 20:06:29 +02:00
|
|
|
"-Wno-reorder-init-list",
|
2016-08-09 22:06:41 +02:00
|
|
|
|
|
|
|
// Try to catch typical 32-bit assumptions that break with 64-bit pointers.
|
|
|
|
"-Werror=pointer-to-int-cast",
|
|
|
|
"-Werror=int-to-pointer-cast",
|
|
|
|
"-Werror=type-limits",
|
|
|
|
"-Werror",
|
2018-02-21 02:09:05 +01:00
|
|
|
|
|
|
|
// Clang's exit-time destructor registration hides __dso_handle, but
|
|
|
|
// __dso_handle needs to have default visibility on ARM32. See b/73485611.
|
|
|
|
"-Wexit-time-destructors",
|
2020-02-01 04:57:04 +01:00
|
|
|
|
2021-12-02 23:42:16 +01:00
|
|
|
// We know clang does a lot of harm by rewriting what we've said, and sadly
|
|
|
|
// never see any good it does, so let's just ask it to do what we say...
|
|
|
|
// (The specific motivating example was clang turning a loop that would only
|
|
|
|
// ever touch 0, 1, or 2 bytes into a call to memset, which was never going
|
|
|
|
// to amortize.)
|
|
|
|
"-fno-builtin",
|
2016-08-09 22:06:41 +02:00
|
|
|
]
|
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
// Define some common cflags
|
|
|
|
// ========================================================
|
2015-11-01 07:03:05 +01:00
|
|
|
cc_defaults {
|
|
|
|
name: "libc_defaults",
|
2016-11-29 02:02:25 +01:00
|
|
|
defaults: ["linux_bionic_supported"],
|
2016-08-09 22:06:41 +02:00
|
|
|
cflags: libc_common_flags,
|
|
|
|
asflags: libc_common_flags,
|
2015-11-01 07:03:05 +01:00
|
|
|
conlyflags: ["-std=gnu99"],
|
|
|
|
cppflags: [],
|
2017-04-25 02:48:32 +02:00
|
|
|
include_dirs: [
|
|
|
|
"bionic/libc/async_safe/include",
|
2020-09-12 00:05:17 +02:00
|
|
|
"bionic/libc/platform",
|
2020-09-17 18:36:25 +02:00
|
|
|
// For android_filesystem_config.h.
|
|
|
|
"system/core/libcutils/include",
|
2017-04-25 02:48:32 +02:00
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
|
2020-04-06 21:32:09 +02:00
|
|
|
header_libs: [
|
|
|
|
"libc_headers",
|
2024-01-19 20:05:36 +01:00
|
|
|
"liblog_headers", // needed by bionic/libc/async_safe/include
|
2020-04-06 21:32:09 +02:00
|
|
|
],
|
|
|
|
export_header_lib_headers: [
|
|
|
|
"libc_headers",
|
|
|
|
],
|
2020-02-01 04:57:04 +01:00
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
stl: "none",
|
|
|
|
system_shared_libs: [],
|
2016-04-07 22:27:24 +02:00
|
|
|
sanitize: {
|
2018-08-14 01:46:15 +02:00
|
|
|
address: false,
|
|
|
|
integer_overflow: false,
|
2019-05-01 23:26:13 +02:00
|
|
|
// TODO(b/132640749): Fix broken fuzzer support.
|
|
|
|
fuzzer: false,
|
2016-04-07 22:27:24 +02:00
|
|
|
},
|
2020-01-22 01:43:56 +01:00
|
|
|
ramdisk_available: true,
|
2020-10-22 03:36:36 +02:00
|
|
|
vendor_ramdisk_available: true,
|
2018-04-27 14:53:11 +02:00
|
|
|
recovery_available: true,
|
2019-05-03 15:57:34 +02:00
|
|
|
native_bridge_supported: true,
|
2018-11-27 16:56:17 +01:00
|
|
|
|
2019-02-20 23:28:56 +01:00
|
|
|
// lld complains about duplicate symbols in libcrt and libgcc. Suppress the
|
|
|
|
// warning since this is intended right now.
|
|
|
|
ldflags: ["-Wl,-z,muldefs"],
|
2019-11-01 23:37:00 +01:00
|
|
|
|
|
|
|
product_variables: {
|
2020-04-29 23:59:44 +02:00
|
|
|
malloc_zero_contents: {
|
|
|
|
cflags: ["-DSCUDO_ZERO_CONTENTS"],
|
|
|
|
},
|
|
|
|
malloc_pattern_fill_contents: {
|
|
|
|
cflags: ["-DSCUDO_PATTERN_FILL_CONTENTS"],
|
|
|
|
},
|
2020-07-31 02:18:38 +02:00
|
|
|
malloc_not_svelte: {
|
|
|
|
cflags: ["-DUSE_SCUDO"],
|
|
|
|
},
|
2019-11-01 23:37:00 +01:00
|
|
|
},
|
2021-10-28 20:43:22 +02:00
|
|
|
|
|
|
|
lto: {
|
|
|
|
never: true,
|
|
|
|
},
|
2023-07-20 22:24:09 +02:00
|
|
|
|
|
|
|
apex_available: ["com.android.runtime"],
|
2023-10-28 00:40:32 +02:00
|
|
|
|
|
|
|
tidy_disabled_srcs: ["upstream-*/**/*.c"],
|
2015-11-01 07:03:05 +01:00
|
|
|
}
|
2015-09-17 01:33:27 +02:00
|
|
|
|
2020-01-25 03:06:42 +01:00
|
|
|
libc_scudo_product_variables = {
|
|
|
|
malloc_not_svelte: {
|
|
|
|
cflags: ["-DUSE_SCUDO"],
|
|
|
|
whole_static_libs: ["libscudo"],
|
|
|
|
exclude_static_libs: [
|
|
|
|
"libjemalloc5",
|
|
|
|
"libc_jemalloc_wrapper",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2019-10-02 02:54:42 +02:00
|
|
|
// Defaults for native allocator libs/includes to make it
|
|
|
|
// easier to change.
|
2020-02-01 07:40:45 +01:00
|
|
|
// To disable scudo for the non-svelte config remove the line:
|
2020-01-25 03:06:42 +01:00
|
|
|
// product_variables: libc_scudo_product_variables,
|
2020-02-01 07:40:45 +01:00
|
|
|
// in the cc_defaults below.
|
2019-10-02 02:54:42 +02:00
|
|
|
// ========================================================
|
|
|
|
cc_defaults {
|
|
|
|
name: "libc_native_allocator_defaults",
|
|
|
|
|
|
|
|
whole_static_libs: [
|
|
|
|
"libjemalloc5",
|
|
|
|
"libc_jemalloc_wrapper",
|
|
|
|
],
|
2020-02-01 04:57:04 +01:00
|
|
|
header_libs: ["gwp_asan_headers"],
|
2020-02-01 07:40:45 +01:00
|
|
|
product_variables: libc_scudo_product_variables,
|
2019-10-02 02:54:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Functions not implemented by jemalloc directly, or that need to
|
|
|
|
// be modified for Android.
|
|
|
|
cc_library_static {
|
|
|
|
name: "libc_jemalloc_wrapper",
|
|
|
|
defaults: ["libc_defaults"],
|
|
|
|
srcs: ["bionic/jemalloc_wrapper.cpp"],
|
|
|
|
cflags: ["-fvisibility=hidden"],
|
|
|
|
|
2020-01-25 03:06:42 +01:00
|
|
|
// Used to pull in the jemalloc include directory so that if the
|
|
|
|
// library is removed, the include directory is also removed.
|
|
|
|
static_libs: ["libjemalloc5"],
|
2019-10-02 02:54:42 +02:00
|
|
|
}
|
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
// ========================================================
|
2019-11-02 01:18:28 +01:00
|
|
|
// libc_bootstrap.a - -fno-stack-protector and -ffreestanding
|
2015-09-17 01:33:27 +02:00
|
|
|
// ========================================================
|
|
|
|
//
|
2019-11-02 01:18:28 +01:00
|
|
|
// Code that implements the stack protector (or that runs before TLS has been set up) needs to be
|
|
|
|
// compiled with -fno-stack-protector, since it accesses the stack canary TLS slot. In the linker,
|
|
|
|
// some of this code runs before ifunc resolvers have made string.h functions work, so compile with
|
|
|
|
// -ffreestanding.
|
2015-09-17 01:33:27 +02:00
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
|
2016-01-11 22:20:55 +01:00
|
|
|
srcs: [
|
|
|
|
"bionic/__libc_init_main_thread.cpp",
|
|
|
|
"bionic/__stack_chk_fail.cpp",
|
2019-11-02 01:18:28 +01:00
|
|
|
"bionic/bionic_call_ifunc_resolver.cpp",
|
|
|
|
"bionic/getauxval.cpp",
|
2016-01-11 22:20:55 +01:00
|
|
|
],
|
|
|
|
arch: {
|
|
|
|
arm64: {
|
|
|
|
srcs: ["arch-arm64/bionic/__set_tls.c"],
|
|
|
|
},
|
2022-10-15 01:25:36 +02:00
|
|
|
riscv64: {
|
|
|
|
srcs: ["arch-riscv64/bionic/__set_tls.c"],
|
|
|
|
},
|
2016-01-11 22:20:55 +01:00
|
|
|
x86: {
|
2018-05-18 02:14:18 +02:00
|
|
|
srcs: [
|
|
|
|
"arch-x86/bionic/__libc_init_sysinfo.cpp",
|
2021-02-13 00:09:49 +01:00
|
|
|
"arch-x86/bionic/__libc_int0x80.S",
|
2018-05-18 02:14:18 +02:00
|
|
|
"arch-x86/bionic/__set_tls.cpp",
|
|
|
|
],
|
2016-01-11 22:20:55 +01:00
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
srcs: ["arch-x86_64/bionic/__set_tls.c"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["libc_defaults"],
|
2024-01-19 20:05:36 +01:00
|
|
|
cflags: [
|
|
|
|
"-fno-stack-protector",
|
|
|
|
"-ffreestanding",
|
|
|
|
],
|
2019-11-02 01:18:28 +01:00
|
|
|
name: "libc_bootstrap",
|
2015-09-17 01:33:27 +02:00
|
|
|
}
|
|
|
|
|
2019-11-02 01:18:28 +01:00
|
|
|
// libc_init_static.cpp and libc_init_dynamic.cpp need to be built without stack protector.
|
|
|
|
// libc_init_static.cpp sets up TLS for static executables, and libc_init_dynamic.cpp initializes
|
|
|
|
// the stack protector global variable.
|
2016-01-11 22:20:55 +01:00
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
name: "libc_init_static",
|
|
|
|
defaults: ["libc_defaults"],
|
|
|
|
srcs: ["bionic/libc_init_static.cpp"],
|
2019-11-02 01:18:28 +01:00
|
|
|
cflags: [
|
|
|
|
"-fno-stack-protector",
|
|
|
|
|
|
|
|
// Compile libc_init_static.cpp with -ffreestanding, because some of its code is called
|
|
|
|
// from the linker before ifunc resolvers have made string.h functions available.
|
|
|
|
"-ffreestanding",
|
|
|
|
],
|
2016-01-11 22:20:55 +01:00
|
|
|
}
|
|
|
|
|
2017-05-09 23:27:43 +02:00
|
|
|
cc_library_static {
|
|
|
|
name: "libc_init_dynamic",
|
|
|
|
defaults: ["libc_defaults"],
|
|
|
|
srcs: ["bionic/libc_init_dynamic.cpp"],
|
|
|
|
cflags: ["-fno-stack-protector"],
|
|
|
|
}
|
2016-01-11 22:20:55 +01:00
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
// ========================================================
|
|
|
|
// libc_tzcode.a - upstream 'tzcode' code
|
|
|
|
// ========================================================
|
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["libc_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
srcs: [
|
2016-01-16 01:00:57 +01:00
|
|
|
"tzcode/**/*.c",
|
2017-04-11 23:44:51 +02:00
|
|
|
"tzcode/bionic.cpp",
|
Expose tzalloc()/localtime_rz()/mktime_z()/tzfree().
* Rationale
The question often comes up of how to use multiple time zones in C code.
If you're single-threaded, you can just use setenv() to manipulate $TZ.
toybox does this, for example. But that's not thread-safe in two
distinct ways: firstly, getenv() is not thread-safe with respect to
modifications to the environment (and between the way putenv() is
specified and the existence of environ, it's not obvious how to fully
fix that), and secondly the _caller_ needs to ensure that no other
threads are using tzset() or any function that behaves "as if" tzset()
was called (which is neither easy to determine nor easy to ensure).
This isn't a bigger problem because most of the time the right answer
is to stop pretending that libc is at all suitable for any i18n, and
switch to icu4c instead. (The NDK icu4c headers do not include ucal_*,
so this is not a realistic option for most applications.)
But what if you're somewhere in between? Like the rust chrono library,
for example? What then?
Currently their "least worst" option is to reinvent the entire wheel and
read our tzdata files. Which isn't a great solution for anyone, for
obvious maintainability reasons.
So it's probably time we broke the catch-22 here and joined NetBSD in
offering a less broken API than standard C has for the last 40 years.
Sure, any would-be caller will have to have a separate "is this
Android?" and even "is this API level >= 35?" path, but that will fix
itself sometime in the 2030s when developers can just assume "yes, it
is", whereas if we keep putting off exposing anything, this problem
never gets solved.
(No-one's bothered to try to implement the std::chrono::time_zone
functionality in libc++ yet, but they'll face a similar problem if/when
they do.)
* Implementation
The good news is that tzcode already implements these functions, so
there's relatively little here.
I've chosen not to expose `struct state` because `struct __timezone_t`
makes for clearer error messages, given that compiler diagnostics will
show the underlying type name (`struct __timezone_t*`) rather than the
typedef name (`timezone_t`) that's used in calling code.
I've moved us over to FreeBSD's wcsftime() rather than keep the OpenBSD
one building --- I've long wanted to only have one implementation here,
and FreeBSD is already doing the "convert back and forth, calling the
non-wide function in the middle" dance that I'd hoped to get round to
doing myself someday. This should mean that our strftime() and
wcsftime() behaviors can't easily diverge in future, plus macOS/iOS are
mostly FreeBSD, so any bugs will likely be interoperable with the other
major mobile operating system, so there's something nice for everyone
there!
The FreeBSD wcsftime() implementation includes a wcsftime_l()
implementation, so that's one stub we can remove. The flip side of that
is that it uses mbsrtowcs_l() and wcsrtombs_l() which we didn't
previously have. So expose those as aliases of mbsrtowcs() and
wcsrtombs().
Bug: https://github.com/chronotope/chrono/issues/499
Test: treehugger
Change-Id: Iee1b9d763ead15eef3d2c33666b3403b68940c3c
2023-06-15 22:17:08 +02:00
|
|
|
// tzcode doesn't include strptime, so we use a fork of the
|
|
|
|
// OpenBSD code which needs this global data.
|
2022-12-06 23:24:27 +01:00
|
|
|
"upstream-openbsd/lib/libc/locale/_def_time.c",
|
Expose tzalloc()/localtime_rz()/mktime_z()/tzfree().
* Rationale
The question often comes up of how to use multiple time zones in C code.
If you're single-threaded, you can just use setenv() to manipulate $TZ.
toybox does this, for example. But that's not thread-safe in two
distinct ways: firstly, getenv() is not thread-safe with respect to
modifications to the environment (and between the way putenv() is
specified and the existence of environ, it's not obvious how to fully
fix that), and secondly the _caller_ needs to ensure that no other
threads are using tzset() or any function that behaves "as if" tzset()
was called (which is neither easy to determine nor easy to ensure).
This isn't a bigger problem because most of the time the right answer
is to stop pretending that libc is at all suitable for any i18n, and
switch to icu4c instead. (The NDK icu4c headers do not include ucal_*,
so this is not a realistic option for most applications.)
But what if you're somewhere in between? Like the rust chrono library,
for example? What then?
Currently their "least worst" option is to reinvent the entire wheel and
read our tzdata files. Which isn't a great solution for anyone, for
obvious maintainability reasons.
So it's probably time we broke the catch-22 here and joined NetBSD in
offering a less broken API than standard C has for the last 40 years.
Sure, any would-be caller will have to have a separate "is this
Android?" and even "is this API level >= 35?" path, but that will fix
itself sometime in the 2030s when developers can just assume "yes, it
is", whereas if we keep putting off exposing anything, this problem
never gets solved.
(No-one's bothered to try to implement the std::chrono::time_zone
functionality in libc++ yet, but they'll face a similar problem if/when
they do.)
* Implementation
The good news is that tzcode already implements these functions, so
there's relatively little here.
I've chosen not to expose `struct state` because `struct __timezone_t`
makes for clearer error messages, given that compiler diagnostics will
show the underlying type name (`struct __timezone_t*`) rather than the
typedef name (`timezone_t`) that's used in calling code.
I've moved us over to FreeBSD's wcsftime() rather than keep the OpenBSD
one building --- I've long wanted to only have one implementation here,
and FreeBSD is already doing the "convert back and forth, calling the
non-wide function in the middle" dance that I'd hoped to get round to
doing myself someday. This should mean that our strftime() and
wcsftime() behaviors can't easily diverge in future, plus macOS/iOS are
mostly FreeBSD, so any bugs will likely be interoperable with the other
major mobile operating system, so there's something nice for everyone
there!
The FreeBSD wcsftime() implementation includes a wcsftime_l()
implementation, so that's one stub we can remove. The flip side of that
is that it uses mbsrtowcs_l() and wcsrtombs_l() which we didn't
previously have. So expose those as aliases of mbsrtowcs() and
wcsrtombs().
Bug: https://github.com/chronotope/chrono/issues/499
Test: treehugger
Change-Id: Iee1b9d763ead15eef3d2c33666b3403b68940c3c
2023-06-15 22:17:08 +02:00
|
|
|
// tzcode doesn't include wcsftime, so we use the FreeBSD code.
|
|
|
|
"upstream-freebsd/lib/libc/locale/wcsftime.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
],
|
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
cflags: [
|
2015-10-15 23:49:45 +02:00
|
|
|
"-Wno-unused-parameter",
|
2015-09-17 01:33:27 +02:00
|
|
|
// Don't use ridiculous amounts of stack.
|
|
|
|
"-DALL_STATE",
|
|
|
|
// Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
|
|
|
|
"-DSTD_INSPIRED",
|
2015-11-19 22:32:49 +01:00
|
|
|
// Obviously, we want to be thread-safe.
|
2022-02-11 13:27:12 +01:00
|
|
|
"-DTHREAD_SAFE=1",
|
2015-09-17 01:33:27 +02:00
|
|
|
// The name of the tm_gmtoff field in our struct tm.
|
|
|
|
"-DTM_GMTOFF=tm_gmtoff",
|
2023-06-21 00:36:11 +02:00
|
|
|
// Android uses a system property instead of /etc/localtime, so make callers crash.
|
2022-02-28 17:55:50 +01:00
|
|
|
"-DTZDEFAULT=NULL",
|
2015-09-17 01:33:27 +02:00
|
|
|
// Where we store our tzdata.
|
2016-09-29 23:08:13 +02:00
|
|
|
"-DTZDIR=\"/system/usr/share/zoneinfo\"",
|
2016-07-29 23:04:17 +02:00
|
|
|
// Include `tzname`, `timezone`, and `daylight` globals.
|
|
|
|
"-DHAVE_POSIX_DECLS=0",
|
2022-02-11 13:27:12 +01:00
|
|
|
"-DUSG_COMPAT=2",
|
|
|
|
"-DHAVE_TZNAME=2",
|
|
|
|
// stdbool.h is available
|
|
|
|
"-DHAVE_STDBOOL_H",
|
2015-11-19 22:32:49 +01:00
|
|
|
// Use the empty string (instead of " ") as the timezone abbreviation
|
|
|
|
// fallback.
|
2016-09-29 23:08:13 +02:00
|
|
|
"-DWILDABBR=\"\"",
|
2015-09-17 01:33:27 +02:00
|
|
|
"-Dlint",
|
|
|
|
],
|
|
|
|
|
Expose tzalloc()/localtime_rz()/mktime_z()/tzfree().
* Rationale
The question often comes up of how to use multiple time zones in C code.
If you're single-threaded, you can just use setenv() to manipulate $TZ.
toybox does this, for example. But that's not thread-safe in two
distinct ways: firstly, getenv() is not thread-safe with respect to
modifications to the environment (and between the way putenv() is
specified and the existence of environ, it's not obvious how to fully
fix that), and secondly the _caller_ needs to ensure that no other
threads are using tzset() or any function that behaves "as if" tzset()
was called (which is neither easy to determine nor easy to ensure).
This isn't a bigger problem because most of the time the right answer
is to stop pretending that libc is at all suitable for any i18n, and
switch to icu4c instead. (The NDK icu4c headers do not include ucal_*,
so this is not a realistic option for most applications.)
But what if you're somewhere in between? Like the rust chrono library,
for example? What then?
Currently their "least worst" option is to reinvent the entire wheel and
read our tzdata files. Which isn't a great solution for anyone, for
obvious maintainability reasons.
So it's probably time we broke the catch-22 here and joined NetBSD in
offering a less broken API than standard C has for the last 40 years.
Sure, any would-be caller will have to have a separate "is this
Android?" and even "is this API level >= 35?" path, but that will fix
itself sometime in the 2030s when developers can just assume "yes, it
is", whereas if we keep putting off exposing anything, this problem
never gets solved.
(No-one's bothered to try to implement the std::chrono::time_zone
functionality in libc++ yet, but they'll face a similar problem if/when
they do.)
* Implementation
The good news is that tzcode already implements these functions, so
there's relatively little here.
I've chosen not to expose `struct state` because `struct __timezone_t`
makes for clearer error messages, given that compiler diagnostics will
show the underlying type name (`struct __timezone_t*`) rather than the
typedef name (`timezone_t`) that's used in calling code.
I've moved us over to FreeBSD's wcsftime() rather than keep the OpenBSD
one building --- I've long wanted to only have one implementation here,
and FreeBSD is already doing the "convert back and forth, calling the
non-wide function in the middle" dance that I'd hoped to get round to
doing myself someday. This should mean that our strftime() and
wcsftime() behaviors can't easily diverge in future, plus macOS/iOS are
mostly FreeBSD, so any bugs will likely be interoperable with the other
major mobile operating system, so there's something nice for everyone
there!
The FreeBSD wcsftime() implementation includes a wcsftime_l()
implementation, so that's one stub we can remove. The flip side of that
is that it uses mbsrtowcs_l() and wcsrtombs_l() which we didn't
previously have. So expose those as aliases of mbsrtowcs() and
wcsrtombs().
Bug: https://github.com/chronotope/chrono/issues/499
Test: treehugger
Change-Id: Iee1b9d763ead15eef3d2c33666b3403b68940c3c
2023-06-15 22:17:08 +02:00
|
|
|
local_include_dirs: [
|
|
|
|
"tzcode/",
|
|
|
|
"upstream-freebsd/android/include",
|
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
name: "libc_tzcode",
|
|
|
|
}
|
|
|
|
|
|
|
|
// ========================================================
|
|
|
|
// libc_dns.a - modified NetBSD DNS code
|
|
|
|
// ========================================================
|
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["libc_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
srcs: [
|
2021-04-08 20:58:51 +02:00
|
|
|
"dns/**/*.c*",
|
2015-09-17 01:33:27 +02:00
|
|
|
|
|
|
|
"upstream-netbsd/lib/libc/isc/ev_streams.c",
|
|
|
|
"upstream-netbsd/lib/libc/isc/ev_timers.c",
|
|
|
|
],
|
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
cflags: [
|
2015-09-17 01:33:27 +02:00
|
|
|
"-DANDROID_CHANGES",
|
|
|
|
"-DINET6",
|
|
|
|
"-Wno-unused-parameter",
|
|
|
|
"-include netbsd-compat.h",
|
2016-08-17 00:57:47 +02:00
|
|
|
"-Wframe-larger-than=66000",
|
2021-01-11 20:51:29 +01:00
|
|
|
"-include private/bsd_sys_param.h",
|
2015-09-17 01:33:27 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
local_include_dirs: [
|
|
|
|
"dns/include",
|
|
|
|
"private",
|
|
|
|
"upstream-netbsd/lib/libc/include",
|
|
|
|
"upstream-netbsd/android/include",
|
|
|
|
],
|
|
|
|
|
|
|
|
name: "libc_dns",
|
|
|
|
}
|
|
|
|
|
|
|
|
// ========================================================
|
|
|
|
// libc_freebsd.a - upstream FreeBSD C library code
|
|
|
|
// ========================================================
|
|
|
|
//
|
|
|
|
// These files are built with the freebsd-compat.h header file
|
|
|
|
// automatically included.
|
|
|
|
|
2023-07-20 22:24:09 +02:00
|
|
|
cc_library_static {
|
|
|
|
name: "libc_freebsd_ldexp",
|
|
|
|
defaults: ["libc_defaults"],
|
|
|
|
cflags: ["-Dscalbn=ldexp"],
|
|
|
|
srcs: [":libc_ldexp_srcs"],
|
|
|
|
}
|
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
cc_library_static {
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["libc_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
srcs: [
|
|
|
|
"upstream-freebsd/lib/libc/stdlib/getopt_long.c",
|
2017-09-01 02:27:05 +02:00
|
|
|
"upstream-freebsd/lib/libc/stdlib/hcreate.c",
|
|
|
|
"upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
|
|
|
|
"upstream-freebsd/lib/libc/stdlib/hdestroy_r.c",
|
|
|
|
"upstream-freebsd/lib/libc/stdlib/hsearch_r.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-freebsd/lib/libc/stdlib/qsort.c",
|
|
|
|
"upstream-freebsd/lib/libc/stdlib/quick_exit.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcpcpy.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcpncpy.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcscasecmp.c",
|
2015-10-15 23:49:45 +02:00
|
|
|
"upstream-freebsd/lib/libc/string/wcscat.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcschr.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcscmp.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcscpy.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-freebsd/lib/libc/string/wcscspn.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcsdup.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcslcat.c",
|
2015-10-15 23:49:45 +02:00
|
|
|
"upstream-freebsd/lib/libc/string/wcslen.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-freebsd/lib/libc/string/wcsncasecmp.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcsncat.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcsncmp.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcsncpy.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcsnlen.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcspbrk.c",
|
2015-10-15 23:49:45 +02:00
|
|
|
"upstream-freebsd/lib/libc/string/wcsrchr.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-freebsd/lib/libc/string/wcsspn.c",
|
2017-07-13 18:45:00 +02:00
|
|
|
"upstream-freebsd/lib/libc/string/wcsstr.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-freebsd/lib/libc/string/wcstok.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wmemchr.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wmemcmp.c",
|
2017-07-13 18:45:00 +02:00
|
|
|
"upstream-freebsd/lib/libc/string/wmemcpy.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-freebsd/lib/libc/string/wmemmove.c",
|
2016-01-16 01:00:57 +01:00
|
|
|
"upstream-freebsd/lib/libc/string/wmemset.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
],
|
|
|
|
arch: {
|
|
|
|
x86: {
|
|
|
|
exclude_srcs: [
|
|
|
|
"upstream-freebsd/lib/libc/string/wcschr.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcscmp.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcslen.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcsrchr.c",
|
2018-08-11 19:12:13 +02:00
|
|
|
"upstream-freebsd/lib/libc/string/wmemcmp.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcscat.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wcscpy.c",
|
|
|
|
"upstream-freebsd/lib/libc/string/wmemcmp.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
cflags: [
|
2015-09-17 01:33:27 +02:00
|
|
|
"-Wno-sign-compare",
|
2017-09-01 02:27:05 +02:00
|
|
|
"-Wno-unused-parameter",
|
2015-09-17 01:33:27 +02:00
|
|
|
"-include freebsd-compat.h",
|
|
|
|
],
|
|
|
|
|
|
|
|
local_include_dirs: [
|
|
|
|
"upstream-freebsd/android/include",
|
|
|
|
],
|
|
|
|
|
|
|
|
name: "libc_freebsd",
|
|
|
|
}
|
|
|
|
|
2016-08-17 00:57:47 +02:00
|
|
|
cc_library_static {
|
|
|
|
defaults: ["libc_defaults"],
|
|
|
|
srcs: [
|
2017-09-27 02:09:07 +02:00
|
|
|
"upstream-freebsd/lib/libc/gen/glob.c",
|
2016-08-17 00:57:47 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-Wno-sign-compare",
|
|
|
|
"-include freebsd-compat.h",
|
2017-09-27 02:09:07 +02:00
|
|
|
"-Wframe-larger-than=66000",
|
2016-08-17 00:57:47 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
local_include_dirs: [
|
|
|
|
"upstream-freebsd/android/include",
|
|
|
|
],
|
|
|
|
|
|
|
|
name: "libc_freebsd_large_stack",
|
|
|
|
}
|
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
// ========================================================
|
|
|
|
// libc_netbsd.a - upstream NetBSD C library code
|
|
|
|
// ========================================================
|
|
|
|
//
|
|
|
|
// These files are built with the netbsd-compat.h header file
|
|
|
|
// automatically included.
|
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["libc_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
srcs: [
|
|
|
|
"upstream-netbsd/common/lib/libc/stdlib/random.c",
|
|
|
|
"upstream-netbsd/lib/libc/gen/nice.c",
|
|
|
|
"upstream-netbsd/lib/libc/gen/psignal.c",
|
|
|
|
"upstream-netbsd/lib/libc/gen/utime.c",
|
|
|
|
"upstream-netbsd/lib/libc/inet/nsap_addr.c",
|
|
|
|
"upstream-netbsd/lib/libc/regex/regcomp.c",
|
|
|
|
"upstream-netbsd/lib/libc/regex/regerror.c",
|
|
|
|
"upstream-netbsd/lib/libc/regex/regexec.c",
|
|
|
|
"upstream-netbsd/lib/libc/regex/regfree.c",
|
|
|
|
"upstream-netbsd/lib/libc/stdlib/bsearch.c",
|
|
|
|
"upstream-netbsd/lib/libc/stdlib/drand48.c",
|
|
|
|
"upstream-netbsd/lib/libc/stdlib/erand48.c",
|
|
|
|
"upstream-netbsd/lib/libc/stdlib/jrand48.c",
|
|
|
|
"upstream-netbsd/lib/libc/stdlib/lcong48.c",
|
|
|
|
"upstream-netbsd/lib/libc/stdlib/lrand48.c",
|
|
|
|
"upstream-netbsd/lib/libc/stdlib/mrand48.c",
|
|
|
|
"upstream-netbsd/lib/libc/stdlib/nrand48.c",
|
|
|
|
"upstream-netbsd/lib/libc/stdlib/_rand48.c",
|
|
|
|
"upstream-netbsd/lib/libc/stdlib/rand_r.c",
|
|
|
|
"upstream-netbsd/lib/libc/stdlib/reallocarr.c",
|
|
|
|
"upstream-netbsd/lib/libc/stdlib/seed48.c",
|
|
|
|
"upstream-netbsd/lib/libc/stdlib/srand48.c",
|
|
|
|
],
|
|
|
|
multilib: {
|
|
|
|
lib32: {
|
|
|
|
// LP32 cruft
|
|
|
|
srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"],
|
|
|
|
},
|
|
|
|
},
|
2015-11-01 07:03:05 +01:00
|
|
|
cflags: [
|
2015-09-17 01:33:27 +02:00
|
|
|
"-Wno-sign-compare",
|
2016-02-29 19:37:56 +01:00
|
|
|
"-Wno-unused-parameter",
|
2015-09-17 01:33:27 +02:00
|
|
|
"-DPOSIX_MISTAKE",
|
|
|
|
"-include netbsd-compat.h",
|
|
|
|
],
|
|
|
|
|
|
|
|
local_include_dirs: [
|
|
|
|
"upstream-netbsd/android/include",
|
|
|
|
"upstream-netbsd/lib/libc/include",
|
|
|
|
],
|
|
|
|
|
|
|
|
name: "libc_netbsd",
|
|
|
|
}
|
|
|
|
|
|
|
|
// ========================================================
|
|
|
|
// libc_openbsd_ndk.a - upstream OpenBSD C library code
|
|
|
|
// that can be safely included in the libc_ndk.a (doesn't
|
|
|
|
// contain any troublesome global data or constructors).
|
|
|
|
// ========================================================
|
|
|
|
//
|
|
|
|
// These files are built with the openbsd-compat.h header file
|
|
|
|
// automatically included.
|
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
name: "libc_openbsd_ndk",
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["libc_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
srcs: [
|
|
|
|
"upstream-openbsd/lib/libc/gen/alarm.c",
|
|
|
|
"upstream-openbsd/lib/libc/gen/ctype_.c",
|
|
|
|
"upstream-openbsd/lib/libc/gen/daemon.c",
|
|
|
|
"upstream-openbsd/lib/libc/gen/err.c",
|
|
|
|
"upstream-openbsd/lib/libc/gen/errx.c",
|
|
|
|
"upstream-openbsd/lib/libc/gen/fnmatch.c",
|
|
|
|
"upstream-openbsd/lib/libc/gen/ftok.c",
|
|
|
|
"upstream-openbsd/lib/libc/gen/getprogname.c",
|
|
|
|
"upstream-openbsd/lib/libc/gen/setprogname.c",
|
|
|
|
"upstream-openbsd/lib/libc/gen/verr.c",
|
|
|
|
"upstream-openbsd/lib/libc/gen/verrx.c",
|
|
|
|
"upstream-openbsd/lib/libc/gen/vwarn.c",
|
|
|
|
"upstream-openbsd/lib/libc/gen/vwarnx.c",
|
|
|
|
"upstream-openbsd/lib/libc/gen/warn.c",
|
|
|
|
"upstream-openbsd/lib/libc/gen/warnx.c",
|
|
|
|
"upstream-openbsd/lib/libc/locale/btowc.c",
|
|
|
|
"upstream-openbsd/lib/libc/locale/mbrlen.c",
|
|
|
|
"upstream-openbsd/lib/libc/locale/mbstowcs.c",
|
|
|
|
"upstream-openbsd/lib/libc/locale/mbtowc.c",
|
|
|
|
"upstream-openbsd/lib/libc/locale/wcscoll.c",
|
|
|
|
"upstream-openbsd/lib/libc/locale/wcstombs.c",
|
|
|
|
"upstream-openbsd/lib/libc/locale/wcsxfrm.c",
|
|
|
|
"upstream-openbsd/lib/libc/locale/wctob.c",
|
|
|
|
"upstream-openbsd/lib/libc/locale/wctomb.c",
|
2016-04-06 20:56:41 +02:00
|
|
|
"upstream-openbsd/lib/libc/net/base64.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-openbsd/lib/libc/net/htonl.c",
|
|
|
|
"upstream-openbsd/lib/libc/net/htons.c",
|
|
|
|
"upstream-openbsd/lib/libc/net/inet_lnaof.c",
|
|
|
|
"upstream-openbsd/lib/libc/net/inet_makeaddr.c",
|
|
|
|
"upstream-openbsd/lib/libc/net/inet_netof.c",
|
|
|
|
"upstream-openbsd/lib/libc/net/inet_ntoa.c",
|
|
|
|
"upstream-openbsd/lib/libc/net/inet_ntop.c",
|
|
|
|
"upstream-openbsd/lib/libc/net/inet_pton.c",
|
|
|
|
"upstream-openbsd/lib/libc/net/ntohl.c",
|
|
|
|
"upstream-openbsd/lib/libc/net/ntohs.c",
|
2016-01-19 21:50:20 +01:00
|
|
|
"upstream-openbsd/lib/libc/net/res_random.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-openbsd/lib/libc/stdio/fgetln.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/fgetwc.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/fgetws.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/flags.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/fpurge.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/fputwc.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/fputws.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/fvwrite.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/fwide.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/getdelim.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/gets.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/makebuf.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/mktemp.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/open_memstream.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/open_wmemstream.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/rget.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/setvbuf.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/ungetc.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/ungetwc.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/vasprintf.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/vdprintf.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/vsscanf.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/vswprintf.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/vswscanf.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/wbuf.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdio/wsetup.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdlib/abs.c",
|
2019-02-06 01:48:22 +01:00
|
|
|
"upstream-openbsd/lib/libc/stdlib/div.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-openbsd/lib/libc/stdlib/getenv.c",
|
2016-04-07 22:24:50 +02:00
|
|
|
"upstream-openbsd/lib/libc/stdlib/getsubopt.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-openbsd/lib/libc/stdlib/insque.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdlib/imaxabs.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdlib/labs.c",
|
2019-02-06 01:48:22 +01:00
|
|
|
"upstream-openbsd/lib/libc/stdlib/ldiv.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-openbsd/lib/libc/stdlib/llabs.c",
|
2019-02-06 01:48:22 +01:00
|
|
|
"upstream-openbsd/lib/libc/stdlib/lldiv.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-openbsd/lib/libc/stdlib/lsearch.c",
|
2020-07-31 20:00:10 +02:00
|
|
|
"upstream-openbsd/lib/libc/stdlib/recallocarray.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-openbsd/lib/libc/stdlib/remque.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdlib/setenv.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdlib/tfind.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdlib/tsearch.c",
|
2019-02-05 01:46:24 +01:00
|
|
|
"upstream-openbsd/lib/libc/string/memccpy.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-openbsd/lib/libc/string/strcasecmp.c",
|
2019-02-05 01:46:24 +01:00
|
|
|
"upstream-openbsd/lib/libc/string/strcasestr.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strcoll.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-openbsd/lib/libc/string/strcspn.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strdup.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strndup.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strpbrk.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strsep.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strspn.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strtok.c",
|
2019-02-05 01:46:24 +01:00
|
|
|
"upstream-openbsd/lib/libc/string/strxfrm.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-openbsd/lib/libc/string/wcslcpy.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/wcswidth.c",
|
2021-09-08 22:24:16 +02:00
|
|
|
|
|
|
|
// This file is originally from OpenBSD, and benefits from
|
|
|
|
// being compiled with openbsd-compat.h.
|
|
|
|
"bionic/fts.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
],
|
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
cflags: [
|
2015-09-17 01:33:27 +02:00
|
|
|
"-Wno-sign-compare",
|
|
|
|
"-Wno-unused-parameter",
|
|
|
|
"-include openbsd-compat.h",
|
|
|
|
],
|
|
|
|
|
|
|
|
local_include_dirs: [
|
|
|
|
"private",
|
|
|
|
"stdio",
|
|
|
|
"upstream-openbsd/android/include",
|
|
|
|
"upstream-openbsd/lib/libc/include",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2016-08-17 00:57:47 +02:00
|
|
|
cc_library_static {
|
|
|
|
name: "libc_openbsd_large_stack",
|
|
|
|
defaults: ["libc_defaults"],
|
|
|
|
srcs: [
|
2017-11-01 21:54:47 +01:00
|
|
|
"stdio/vfprintf.cpp",
|
|
|
|
"stdio/vfwprintf.cpp",
|
2020-08-06 23:32:43 +02:00
|
|
|
"upstream-openbsd/lib/libc/string/memmem.c",
|
2019-11-22 20:15:42 +01:00
|
|
|
"upstream-openbsd/lib/libc/string/strstr.c",
|
2016-08-17 00:57:47 +02:00
|
|
|
],
|
|
|
|
cflags: [
|
|
|
|
"-include openbsd-compat.h",
|
|
|
|
"-Wno-sign-compare",
|
|
|
|
"-Wframe-larger-than=5000",
|
|
|
|
],
|
|
|
|
|
|
|
|
local_include_dirs: [
|
2021-01-11 20:51:29 +01:00
|
|
|
"private",
|
2017-10-30 19:43:58 +01:00
|
|
|
"upstream-openbsd/android/include/",
|
|
|
|
"upstream-openbsd/lib/libc/include/",
|
2016-08-17 00:57:47 +02:00
|
|
|
"upstream-openbsd/lib/libc/gdtoa/",
|
2017-10-30 19:43:58 +01:00
|
|
|
"upstream-openbsd/lib/libc/stdio/",
|
2016-08-17 00:57:47 +02:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
// ========================================================
|
|
|
|
// libc_openbsd.a - upstream OpenBSD C library code
|
|
|
|
// ========================================================
|
|
|
|
//
|
|
|
|
// These files are built with the openbsd-compat.h header file
|
|
|
|
// automatically included.
|
|
|
|
cc_library_static {
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["libc_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
srcs: [
|
2018-02-03 00:10:32 +01:00
|
|
|
// These two depend on getentropy, which isn't in libc_ndk.a.
|
2015-09-17 01:33:27 +02:00
|
|
|
"upstream-openbsd/lib/libc/crypt/arc4random.c",
|
|
|
|
"upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
|
|
|
|
],
|
|
|
|
|
2023-10-28 00:40:32 +02:00
|
|
|
// Each architecture has optimized versions of some routines,
|
|
|
|
// and only includes the portable C versions of ones it's missing.
|
2015-09-17 01:33:27 +02:00
|
|
|
arch: {
|
|
|
|
arm: {
|
2023-10-28 00:40:32 +02:00
|
|
|
srcs: [
|
2015-11-23 23:12:15 +01:00
|
|
|
"upstream-openbsd/lib/libc/string/memchr.c",
|
2020-06-04 01:55:37 +02:00
|
|
|
"upstream-openbsd/lib/libc/string/memrchr.c",
|
2023-10-28 00:40:32 +02:00
|
|
|
"upstream-openbsd/lib/libc/string/stpncpy.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strlcat.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strlcpy.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strncat.c",
|
2015-11-23 23:12:15 +01:00
|
|
|
"upstream-openbsd/lib/libc/string/strncmp.c",
|
2023-10-28 00:40:32 +02:00
|
|
|
"upstream-openbsd/lib/libc/string/strncpy.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
],
|
|
|
|
},
|
2023-10-28 00:40:32 +02:00
|
|
|
arm64: {
|
2022-10-15 01:25:36 +02:00
|
|
|
srcs: [
|
2023-10-28 00:40:32 +02:00
|
|
|
"upstream-openbsd/lib/libc/string/strcat.c",
|
2023-11-08 21:04:41 +01:00
|
|
|
"upstream-openbsd/lib/libc/string/stpncpy.c",
|
2023-10-28 00:40:32 +02:00
|
|
|
"upstream-openbsd/lib/libc/string/strlcat.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strlcpy.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strncat.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strncpy.c",
|
2022-10-15 01:25:36 +02:00
|
|
|
],
|
|
|
|
},
|
2023-10-28 00:40:32 +02:00
|
|
|
riscv64: {
|
|
|
|
srcs: [
|
2015-11-23 23:12:15 +01:00
|
|
|
"upstream-openbsd/lib/libc/string/memrchr.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/stpncpy.c",
|
2018-08-11 19:12:13 +02:00
|
|
|
"upstream-openbsd/lib/libc/string/strlcat.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strlcpy.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
],
|
|
|
|
},
|
2023-10-28 00:40:32 +02:00
|
|
|
x86: {
|
2023-11-08 21:04:41 +01:00
|
|
|
srcs: [
|
|
|
|
// x86 has custom implementations of all of these.
|
|
|
|
],
|
2023-10-28 00:40:32 +02:00
|
|
|
},
|
2015-11-23 23:12:15 +01:00
|
|
|
x86_64: {
|
2023-10-28 00:40:32 +02:00
|
|
|
srcs: [
|
|
|
|
"upstream-openbsd/lib/libc/string/memchr.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/memrchr.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strlcat.c",
|
|
|
|
"upstream-openbsd/lib/libc/string/strlcpy.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
cflags: [
|
2015-09-17 01:33:27 +02:00
|
|
|
"-Wno-sign-compare",
|
|
|
|
"-Wno-unused-parameter",
|
|
|
|
"-include openbsd-compat.h",
|
|
|
|
],
|
|
|
|
|
|
|
|
local_include_dirs: [
|
|
|
|
"private",
|
|
|
|
"upstream-openbsd/android/include",
|
|
|
|
],
|
|
|
|
|
|
|
|
name: "libc_openbsd",
|
|
|
|
}
|
|
|
|
|
|
|
|
// ========================================================
|
|
|
|
// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
|
|
|
|
// ========================================================
|
|
|
|
//
|
|
|
|
// These files are built with the openbsd-compat.h header file
|
|
|
|
// automatically included.
|
|
|
|
|
|
|
|
cc_library_static {
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["libc_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
srcs: [
|
|
|
|
"upstream-openbsd/android/gdtoa_support.cpp",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/dmisc.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/dtoa.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/gethex.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/gmisc.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/hd_init.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/hexnan.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/misc.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/smisc.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/strtod.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/strtodg.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/strtof.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/strtord.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/sum.c",
|
|
|
|
"upstream-openbsd/lib/libc/gdtoa/ulp.c",
|
|
|
|
],
|
|
|
|
multilib: {
|
|
|
|
lib64: {
|
2015-11-23 23:12:15 +01:00
|
|
|
srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
cflags: [
|
2015-09-17 01:33:27 +02:00
|
|
|
"-Wno-sign-compare",
|
|
|
|
"-include openbsd-compat.h",
|
|
|
|
],
|
|
|
|
|
|
|
|
local_include_dirs: [
|
|
|
|
"private",
|
|
|
|
"upstream-openbsd/android/include",
|
|
|
|
"upstream-openbsd/lib/libc/include",
|
|
|
|
],
|
|
|
|
|
|
|
|
name: "libc_gdtoa",
|
|
|
|
}
|
|
|
|
|
2017-07-21 22:28:42 +02:00
|
|
|
// ========================================================
|
2023-02-01 14:44:43 +01:00
|
|
|
// libc_fortify.a - container for our FORTIFY
|
2017-07-21 22:28:42 +02:00
|
|
|
// implementation details
|
|
|
|
// ========================================================
|
|
|
|
cc_library_static {
|
|
|
|
defaults: ["libc_defaults"],
|
2017-07-25 20:43:39 +02:00
|
|
|
srcs: ["bionic/fortify.cpp"],
|
2017-07-21 22:28:42 +02:00
|
|
|
|
|
|
|
name: "libc_fortify",
|
|
|
|
|
|
|
|
// Disable FORTIFY for the compilation of these, so we don't end up having
|
|
|
|
// FORTIFY silently call itself.
|
2018-02-06 02:30:57 +01:00
|
|
|
cflags: [
|
|
|
|
"-U_FORTIFY_SOURCE",
|
|
|
|
"-D__BIONIC_DECLARE_FORTIFY_HELPERS",
|
|
|
|
],
|
2017-07-21 22:28:42 +02:00
|
|
|
|
|
|
|
arch: {
|
|
|
|
arm: {
|
2018-11-28 00:38:47 +01:00
|
|
|
cflags: [
|
|
|
|
"-DRENAME___STRCAT_CHK",
|
|
|
|
"-DRENAME___STRCPY_CHK",
|
|
|
|
],
|
2017-07-21 22:28:42 +02:00
|
|
|
srcs: [
|
|
|
|
"arch-arm/generic/bionic/__memcpy_chk.S",
|
2018-11-28 00:38:47 +01:00
|
|
|
|
|
|
|
"arch-arm/cortex-a15/bionic/__strcat_chk.S",
|
|
|
|
"arch-arm/cortex-a15/bionic/__strcpy_chk.S",
|
|
|
|
|
|
|
|
"arch-arm/cortex-a7/bionic/__strcat_chk.S",
|
|
|
|
"arch-arm/cortex-a7/bionic/__strcpy_chk.S",
|
|
|
|
|
|
|
|
"arch-arm/cortex-a9/bionic/__strcat_chk.S",
|
|
|
|
"arch-arm/cortex-a9/bionic/__strcpy_chk.S",
|
|
|
|
|
|
|
|
"arch-arm/krait/bionic/__strcat_chk.S",
|
|
|
|
"arch-arm/krait/bionic/__strcpy_chk.S",
|
|
|
|
|
|
|
|
"arch-arm/cortex-a53/bionic/__strcat_chk.S",
|
|
|
|
"arch-arm/cortex-a53/bionic/__strcpy_chk.S",
|
|
|
|
|
2018-12-04 00:05:16 +01:00
|
|
|
"arch-arm/cortex-a55/bionic/__strcat_chk.S",
|
|
|
|
"arch-arm/cortex-a55/bionic/__strcpy_chk.S",
|
2017-07-21 22:28:42 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
arm64: {
|
|
|
|
srcs: [
|
2022-11-17 20:27:02 +01:00
|
|
|
"arch-arm64/string/__memcpy_chk.S",
|
|
|
|
"arch-arm64/string/__memset_chk.S",
|
2017-07-21 22:28:42 +02:00
|
|
|
],
|
|
|
|
},
|
2023-03-06 07:57:55 +01:00
|
|
|
riscv64: {
|
|
|
|
srcs: [
|
2024-01-19 20:05:36 +01:00
|
|
|
"arch-riscv64/string/__memset_chk.S",
|
|
|
|
"arch-riscv64/string/__memcpy_chk.S",
|
2023-03-06 07:57:55 +01:00
|
|
|
],
|
|
|
|
},
|
2017-07-21 22:28:42 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
// ========================================================
|
|
|
|
// libc_bionic.a - home-grown C library code
|
|
|
|
// ========================================================
|
|
|
|
|
|
|
|
cc_library_static {
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["libc_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
srcs: [
|
2018-02-03 00:10:32 +01:00
|
|
|
// These require getauxval, which isn't available on older platforms.
|
2015-09-17 01:33:27 +02:00
|
|
|
"bionic/sysconf.cpp",
|
|
|
|
"bionic/vdso.cpp",
|
2015-09-18 00:28:45 +02:00
|
|
|
"bionic/setjmp_cookie.cpp",
|
2015-09-17 01:33:27 +02:00
|
|
|
|
2017-04-04 00:13:29 +02:00
|
|
|
// The following must not be statically linked into libc_ndk.a, because
|
|
|
|
// debuggerd will look for the abort message in libc.so's copy.
|
|
|
|
"bionic/android_set_abort_message.cpp",
|
2015-09-17 01:33:27 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
arch: {
|
|
|
|
arm: {
|
2019-06-04 19:38:34 +02:00
|
|
|
asflags: libc_common_flags + ["-mno-restrict-it"],
|
2015-09-17 01:33:27 +02:00
|
|
|
srcs: [
|
2018-12-31 06:10:26 +01:00
|
|
|
"arch-arm/bionic/__aeabi_read_tp.S",
|
2015-09-17 01:33:27 +02:00
|
|
|
"arch-arm/bionic/__bionic_clone.S",
|
2019-04-23 01:00:46 +02:00
|
|
|
"arch-arm/bionic/__restore.S",
|
2015-09-17 01:33:27 +02:00
|
|
|
"arch-arm/bionic/_exit_with_stack_teardown.S",
|
2019-04-23 01:00:46 +02:00
|
|
|
"arch-arm/bionic/atomics_arm.c",
|
|
|
|
"arch-arm/bionic/bpabi.c",
|
2019-02-13 23:10:10 +01:00
|
|
|
"arch-arm/bionic/libcrt_compat.c",
|
2015-09-17 01:33:27 +02:00
|
|
|
"arch-arm/bionic/popcount_tab.c",
|
|
|
|
"arch-arm/bionic/setjmp.S",
|
|
|
|
"arch-arm/bionic/syscall.S",
|
|
|
|
"arch-arm/bionic/vfork.S",
|
2018-11-19 15:14:41 +01:00
|
|
|
|
2023-11-08 21:04:41 +01:00
|
|
|
"arch-arm/cortex-a7/bionic/memcpy.S",
|
|
|
|
"arch-arm/cortex-a7/bionic/memset.S",
|
2023-10-28 00:40:32 +02:00
|
|
|
|
2023-11-08 21:04:41 +01:00
|
|
|
"arch-arm/cortex-a9/bionic/memcpy.S",
|
|
|
|
"arch-arm/cortex-a9/bionic/memset.S",
|
|
|
|
"arch-arm/cortex-a9/bionic/stpcpy.S",
|
|
|
|
"arch-arm/cortex-a9/bionic/strcat.S",
|
|
|
|
"arch-arm/cortex-a9/bionic/strcpy.S",
|
|
|
|
"arch-arm/cortex-a9/bionic/strlen.S",
|
2023-10-28 00:40:32 +02:00
|
|
|
|
2018-11-19 20:00:32 +01:00
|
|
|
"arch-arm/cortex-a15/bionic/memcpy.S",
|
|
|
|
"arch-arm/cortex-a15/bionic/memmove.S",
|
|
|
|
"arch-arm/cortex-a15/bionic/memset.S",
|
|
|
|
"arch-arm/cortex-a15/bionic/stpcpy.S",
|
|
|
|
"arch-arm/cortex-a15/bionic/strcat.S",
|
|
|
|
"arch-arm/cortex-a15/bionic/strcmp.S",
|
|
|
|
"arch-arm/cortex-a15/bionic/strcpy.S",
|
|
|
|
"arch-arm/cortex-a15/bionic/strlen.S",
|
|
|
|
|
2023-11-08 21:04:41 +01:00
|
|
|
"arch-arm/cortex-a53/bionic/memcpy.S",
|
2018-11-19 20:00:32 +01:00
|
|
|
|
2023-11-08 21:04:41 +01:00
|
|
|
"arch-arm/cortex-a55/bionic/memcpy.S",
|
|
|
|
|
|
|
|
"arch-arm/generic/bionic/memcmp.S",
|
|
|
|
"arch-arm/generic/bionic/memmove.S",
|
|
|
|
"arch-arm/generic/bionic/memset.S",
|
|
|
|
"arch-arm/generic/bionic/stpcpy.c",
|
|
|
|
"arch-arm/generic/bionic/strcat.c",
|
|
|
|
"arch-arm/generic/bionic/strcmp.S",
|
|
|
|
"arch-arm/generic/bionic/strcpy.S",
|
|
|
|
"arch-arm/generic/bionic/strlen.c",
|
2018-11-19 20:00:32 +01:00
|
|
|
|
|
|
|
"arch-arm/krait/bionic/memcpy.S",
|
|
|
|
"arch-arm/krait/bionic/memset.S",
|
|
|
|
|
|
|
|
"arch-arm/kryo/bionic/memcpy.S",
|
2023-11-08 21:04:41 +01:00
|
|
|
|
|
|
|
"bionic/strchr.cpp",
|
|
|
|
"bionic/strchrnul.cpp",
|
|
|
|
"bionic/strnlen.cpp",
|
|
|
|
"bionic/strrchr.cpp",
|
2018-11-19 20:00:32 +01:00
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
|
|
|
arm64: {
|
|
|
|
srcs: [
|
2016-02-04 06:48:08 +01:00
|
|
|
"arch-arm64/bionic/__bionic_clone.S",
|
|
|
|
"arch-arm64/bionic/_exit_with_stack_teardown.S",
|
|
|
|
"arch-arm64/bionic/setjmp.S",
|
|
|
|
"arch-arm64/bionic/syscall.S",
|
|
|
|
"arch-arm64/bionic/vfork.S",
|
2015-09-17 01:33:27 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
|
2022-10-15 01:25:36 +02:00
|
|
|
riscv64: {
|
|
|
|
srcs: [
|
|
|
|
"arch-riscv64/bionic/__bionic_clone.S",
|
|
|
|
"arch-riscv64/bionic/_exit_with_stack_teardown.S",
|
2022-10-18 01:23:36 +02:00
|
|
|
"arch-riscv64/bionic/setjmp.S",
|
2022-10-15 01:25:36 +02:00
|
|
|
"arch-riscv64/bionic/syscall.S",
|
|
|
|
"arch-riscv64/bionic/vfork.S",
|
2023-05-26 04:10:40 +02:00
|
|
|
|
2023-11-08 21:04:41 +01:00
|
|
|
"arch-riscv64/string/memchr_v.S",
|
|
|
|
"arch-riscv64/string/memcmp_v.S",
|
|
|
|
"arch-riscv64/string/memcpy_v.S",
|
|
|
|
"arch-riscv64/string/memmove_v.S",
|
|
|
|
"arch-riscv64/string/memset_v.S",
|
|
|
|
"arch-riscv64/string/stpcpy_v.S",
|
|
|
|
"arch-riscv64/string/strcat_v.S",
|
|
|
|
"arch-riscv64/string/strchr_v.S",
|
|
|
|
"arch-riscv64/string/strcmp_v.S",
|
|
|
|
"arch-riscv64/string/strcpy_v.S",
|
|
|
|
"arch-riscv64/string/strlen_v.S",
|
|
|
|
"arch-riscv64/string/strncat_v.S",
|
|
|
|
"arch-riscv64/string/strncmp_v.S",
|
|
|
|
"arch-riscv64/string/strncpy_v.S",
|
|
|
|
"arch-riscv64/string/strnlen_v.S",
|
|
|
|
|
|
|
|
"arch-riscv64/string/memchr.c",
|
|
|
|
"arch-riscv64/string/memcmp.c",
|
|
|
|
"arch-riscv64/string/memcpy.c",
|
|
|
|
"arch-riscv64/string/memmove.c",
|
|
|
|
"arch-riscv64/string/memset.c",
|
|
|
|
"arch-riscv64/string/stpcpy.c",
|
|
|
|
"arch-riscv64/string/strcat.c",
|
|
|
|
"arch-riscv64/string/strchr.c",
|
|
|
|
"arch-riscv64/string/strcmp.c",
|
|
|
|
"arch-riscv64/string/strcpy.c",
|
|
|
|
"arch-riscv64/string/strlen.c",
|
|
|
|
"arch-riscv64/string/strncat.c",
|
|
|
|
"arch-riscv64/string/strncmp.c",
|
|
|
|
"arch-riscv64/string/strncpy.c",
|
|
|
|
"arch-riscv64/string/strnlen.c",
|
2023-10-31 01:35:19 +01:00
|
|
|
|
2023-10-28 00:40:32 +02:00
|
|
|
"bionic/strchrnul.cpp",
|
|
|
|
"bionic/strrchr.cpp",
|
2022-10-15 01:25:36 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
x86: {
|
|
|
|
srcs: [
|
2023-10-28 00:40:32 +02:00
|
|
|
"arch-x86/bionic/__bionic_clone.S",
|
|
|
|
"arch-x86/bionic/_exit_with_stack_teardown.S",
|
|
|
|
"arch-x86/bionic/libcrt_compat.c",
|
|
|
|
"arch-x86/bionic/setjmp.S",
|
|
|
|
"arch-x86/bionic/syscall.S",
|
|
|
|
"arch-x86/bionic/vfork.S",
|
|
|
|
"arch-x86/bionic/__x86.get_pc_thunk.S",
|
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
"arch-x86/generic/string/memcmp.S",
|
|
|
|
"arch-x86/generic/string/strcmp.S",
|
|
|
|
"arch-x86/generic/string/strncmp.S",
|
|
|
|
"arch-x86/generic/string/strcat.S",
|
2018-08-11 19:12:13 +02:00
|
|
|
|
|
|
|
"arch-x86/generic/string/strlcat.c",
|
|
|
|
"arch-x86/generic/string/strlcpy.c",
|
|
|
|
"arch-x86/generic/string/strncat.c",
|
|
|
|
"arch-x86/generic/string/wcscat.c",
|
|
|
|
"arch-x86/generic/string/wcscpy.c",
|
|
|
|
"arch-x86/generic/string/wmemcmp.c",
|
|
|
|
|
2022-07-25 18:25:11 +02:00
|
|
|
"arch-x86/string/sse2-memchr-atom.S",
|
|
|
|
"arch-x86/string/sse2-memmove-slm.S",
|
|
|
|
"arch-x86/string/sse2-memrchr-atom.S",
|
|
|
|
"arch-x86/string/sse2-memset-atom.S",
|
|
|
|
"arch-x86/string/sse2-memset-slm.S",
|
|
|
|
"arch-x86/string/sse2-stpcpy-slm.S",
|
|
|
|
"arch-x86/string/sse2-stpncpy-slm.S",
|
|
|
|
"arch-x86/string/sse2-strchr-atom.S",
|
|
|
|
"arch-x86/string/sse2-strcpy-slm.S",
|
|
|
|
"arch-x86/string/sse2-strlen-slm.S",
|
|
|
|
"arch-x86/string/sse2-strncpy-slm.S",
|
|
|
|
"arch-x86/string/sse2-strnlen-atom.S",
|
|
|
|
"arch-x86/string/sse2-strrchr-atom.S",
|
|
|
|
"arch-x86/string/sse2-wcschr-atom.S",
|
|
|
|
"arch-x86/string/sse2-wcsrchr-atom.S",
|
|
|
|
"arch-x86/string/sse2-wcslen-atom.S",
|
|
|
|
"arch-x86/string/sse2-wcscmp-atom.S",
|
|
|
|
"arch-x86/string/sse2-strlen-atom.S",
|
|
|
|
|
|
|
|
"arch-x86/string/ssse3-memcmp-atom.S",
|
|
|
|
"arch-x86/string/ssse3-memmove-atom.S",
|
|
|
|
"arch-x86/string/ssse3-strcat-atom.S",
|
|
|
|
"arch-x86/string/ssse3-strcmp-atom.S",
|
|
|
|
"arch-x86/string/ssse3-strcpy-atom.S",
|
|
|
|
"arch-x86/string/ssse3-strlcat-atom.S",
|
|
|
|
"arch-x86/string/ssse3-strlcpy-atom.S",
|
|
|
|
"arch-x86/string/ssse3-strncat-atom.S",
|
|
|
|
"arch-x86/string/ssse3-strncmp-atom.S",
|
|
|
|
"arch-x86/string/ssse3-strncpy-atom.S",
|
|
|
|
"arch-x86/string/ssse3-wcscat-atom.S",
|
|
|
|
"arch-x86/string/ssse3-wcscpy-atom.S",
|
|
|
|
"arch-x86/string/ssse3-wmemcmp-atom.S",
|
|
|
|
|
|
|
|
"arch-x86/string/sse4-memcmp-slm.S",
|
|
|
|
"arch-x86/string/sse4-wmemcmp-slm.S",
|
2023-11-08 21:04:41 +01:00
|
|
|
|
|
|
|
"bionic/strchrnul.cpp",
|
2015-09-17 01:33:27 +02:00
|
|
|
],
|
2023-10-28 00:40:32 +02:00
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
srcs: [
|
|
|
|
"arch-x86_64/bionic/__bionic_clone.S",
|
|
|
|
"arch-x86_64/bionic/_exit_with_stack_teardown.S",
|
|
|
|
"arch-x86_64/bionic/__restore_rt.S",
|
|
|
|
"arch-x86_64/bionic/setjmp.S",
|
|
|
|
"arch-x86_64/bionic/syscall.S",
|
|
|
|
"arch-x86_64/bionic/vfork.S",
|
2015-10-15 23:49:45 +02:00
|
|
|
|
2022-06-10 03:41:14 +02:00
|
|
|
"arch-x86_64/string/avx2-memset-kbl.S",
|
2015-09-17 01:33:27 +02:00
|
|
|
"arch-x86_64/string/sse2-memmove-slm.S",
|
|
|
|
"arch-x86_64/string/sse2-memset-slm.S",
|
|
|
|
"arch-x86_64/string/sse2-stpcpy-slm.S",
|
|
|
|
"arch-x86_64/string/sse2-stpncpy-slm.S",
|
|
|
|
"arch-x86_64/string/sse2-strcat-slm.S",
|
|
|
|
"arch-x86_64/string/sse2-strcpy-slm.S",
|
|
|
|
"arch-x86_64/string/sse2-strlen-slm.S",
|
|
|
|
"arch-x86_64/string/sse2-strncat-slm.S",
|
|
|
|
"arch-x86_64/string/sse2-strncpy-slm.S",
|
|
|
|
"arch-x86_64/string/sse4-memcmp-slm.S",
|
|
|
|
"arch-x86_64/string/ssse3-strcmp-slm.S",
|
|
|
|
"arch-x86_64/string/ssse3-strncmp-slm.S",
|
2023-11-08 21:04:41 +01:00
|
|
|
|
|
|
|
"bionic/strchr.cpp",
|
|
|
|
"bionic/strchrnul.cpp",
|
|
|
|
"bionic/strnlen.cpp",
|
|
|
|
"bionic/strrchr.cpp",
|
2015-09-17 01:33:27 +02:00
|
|
|
],
|
|
|
|
},
|
2015-10-15 23:49:45 +02:00
|
|
|
},
|
2015-09-17 01:33:27 +02:00
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
cppflags: ["-Wold-style-cast"],
|
2015-10-15 23:49:45 +02:00
|
|
|
include_dirs: ["bionic/libstdc++/include"],
|
|
|
|
name: "libc_bionic",
|
|
|
|
}
|
|
|
|
|
2016-12-14 00:47:25 +01:00
|
|
|
genrule {
|
|
|
|
name: "generated_android_ids",
|
2017-01-18 03:16:07 +01:00
|
|
|
out: ["generated_android_ids.h"],
|
|
|
|
srcs: [":android_filesystem_config_header"],
|
2023-11-29 02:51:16 +01:00
|
|
|
tools: ["fs_config_generator"],
|
|
|
|
cmd: "$(location fs_config_generator) aidarray $(in) > $(out)",
|
2016-12-14 00:47:25 +01:00
|
|
|
}
|
|
|
|
|
2015-10-15 23:49:45 +02:00
|
|
|
// ========================================================
|
|
|
|
// libc_bionic_ndk.a- The portions of libc_bionic that can
|
|
|
|
// be safely used in libc_ndk.a (no troublesome global data
|
|
|
|
// or constructors).
|
|
|
|
// ========================================================
|
|
|
|
cc_library_static {
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["libc_defaults"],
|
2015-10-15 23:49:45 +02:00
|
|
|
srcs: [
|
2017-07-11 23:27:07 +02:00
|
|
|
"bionic/NetdClientDispatch.cpp",
|
2017-08-21 21:17:19 +02:00
|
|
|
"bionic/__bionic_get_shell_path.cpp",
|
2017-07-11 23:27:07 +02:00
|
|
|
"bionic/__cmsg_nxthdr.cpp",
|
|
|
|
"bionic/__errno.cpp",
|
|
|
|
"bionic/__gnu_basename.cpp",
|
|
|
|
"bionic/__libc_current_sigrtmax.cpp",
|
|
|
|
"bionic/__libc_current_sigrtmin.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/abort.cpp",
|
|
|
|
"bionic/accept.cpp",
|
|
|
|
"bionic/access.cpp",
|
|
|
|
"bionic/arpa_inet.cpp",
|
|
|
|
"bionic/assert.cpp",
|
|
|
|
"bionic/atof.cpp",
|
2019-01-24 22:47:13 +01:00
|
|
|
"bionic/bionic_allocator.cpp",
|
2016-11-11 01:08:29 +01:00
|
|
|
"bionic/bionic_arc4random.cpp",
|
2017-08-17 22:18:52 +02:00
|
|
|
"bionic/bionic_futex.cpp",
|
2016-01-19 21:50:20 +01:00
|
|
|
"bionic/bionic_netlink.cpp",
|
2024-01-25 23:45:24 +01:00
|
|
|
"bionic/bionic_systrace.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/bionic_time_conversions.cpp",
|
|
|
|
"bionic/brk.cpp",
|
|
|
|
"bionic/c16rtomb.cpp",
|
|
|
|
"bionic/c32rtomb.cpp",
|
|
|
|
"bionic/chmod.cpp",
|
|
|
|
"bionic/chown.cpp",
|
|
|
|
"bionic/clearenv.cpp",
|
|
|
|
"bionic/clock.cpp",
|
|
|
|
"bionic/clock_getcpuclockid.cpp",
|
|
|
|
"bionic/clock_nanosleep.cpp",
|
|
|
|
"bionic/clone.cpp",
|
|
|
|
"bionic/ctype.cpp",
|
|
|
|
"bionic/dirent.cpp",
|
2019-11-06 22:15:00 +01:00
|
|
|
"bionic/dup.cpp",
|
2017-07-10 21:15:37 +02:00
|
|
|
"bionic/environ.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/error.cpp",
|
2020-04-30 02:08:46 +02:00
|
|
|
"bionic/eventfd.cpp",
|
2016-08-26 18:15:57 +02:00
|
|
|
"bionic/exec.cpp",
|
2021-10-15 00:44:47 +02:00
|
|
|
"bionic/execinfo.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/faccessat.cpp",
|
|
|
|
"bionic/fchmod.cpp",
|
|
|
|
"bionic/fchmodat.cpp",
|
2019-11-06 22:15:00 +01:00
|
|
|
"bionic/fcntl.cpp",
|
2018-06-02 00:30:54 +02:00
|
|
|
"bionic/fdsan.cpp",
|
2019-11-06 22:15:00 +01:00
|
|
|
"bionic/fdtrack.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/ffs.cpp",
|
|
|
|
"bionic/fgetxattr.cpp",
|
|
|
|
"bionic/flistxattr.cpp",
|
|
|
|
"bionic/fpclassify.cpp",
|
|
|
|
"bionic/fsetxattr.cpp",
|
|
|
|
"bionic/ftruncate.cpp",
|
2016-04-16 02:40:33 +02:00
|
|
|
"bionic/ftw.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/futimens.cpp",
|
|
|
|
"bionic/getcwd.cpp",
|
2016-03-30 00:21:38 +02:00
|
|
|
"bionic/getdomainname.cpp",
|
2018-02-03 00:10:32 +01:00
|
|
|
"bionic/getentropy.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/gethostname.cpp",
|
2018-10-23 20:23:00 +02:00
|
|
|
"bionic/getloadavg.cpp",
|
2016-04-06 17:34:58 +02:00
|
|
|
"bionic/getpagesize.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/getpgrp.cpp",
|
|
|
|
"bionic/getpid.cpp",
|
2016-11-30 00:10:29 +01:00
|
|
|
"bionic/getpriority.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/gettid.cpp",
|
2018-09-06 22:26:08 +02:00
|
|
|
"bionic/get_device_api_level.cpp",
|
2016-04-05 18:09:46 +02:00
|
|
|
"bionic/grp_pwd.cpp",
|
2018-02-03 01:10:07 +01:00
|
|
|
"bionic/grp_pwd_file.cpp",
|
2021-01-21 01:03:27 +01:00
|
|
|
"bionic/heap_zero_init.cpp",
|
2017-08-16 08:16:48 +02:00
|
|
|
"bionic/iconv.cpp",
|
2017-07-28 02:08:08 +02:00
|
|
|
"bionic/icu_wrappers.cpp",
|
2016-01-05 23:32:06 +01:00
|
|
|
"bionic/ifaddrs.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/inotify_init.cpp",
|
2015-11-09 23:03:46 +01:00
|
|
|
"bionic/ioctl.cpp",
|
2017-07-12 00:00:17 +02:00
|
|
|
"bionic/killpg.cpp",
|
2016-11-19 01:27:29 +01:00
|
|
|
"bionic/langinfo.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/lchown.cpp",
|
|
|
|
"bionic/lfs64_support.cpp",
|
|
|
|
"bionic/libc_init_common.cpp",
|
|
|
|
"bionic/libgen.cpp",
|
|
|
|
"bionic/link.cpp",
|
|
|
|
"bionic/locale.cpp",
|
2016-02-04 06:48:08 +01:00
|
|
|
"bionic/lockf.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/lstat.cpp",
|
2016-04-29 23:06:07 +02:00
|
|
|
"bionic/mblen.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/mbrtoc16.cpp",
|
|
|
|
"bionic/mbrtoc32.cpp",
|
|
|
|
"bionic/mempcpy.cpp",
|
2022-08-11 01:35:03 +02:00
|
|
|
"bionic/memset_explicit.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/mkdir.cpp",
|
|
|
|
"bionic/mkfifo.cpp",
|
|
|
|
"bionic/mknod.cpp",
|
|
|
|
"bionic/mntent.cpp",
|
2015-11-09 23:03:46 +01:00
|
|
|
"bionic/mremap.cpp",
|
2016-01-19 21:50:20 +01:00
|
|
|
"bionic/net_if.cpp",
|
2017-07-11 23:27:07 +02:00
|
|
|
"bionic/netdb.cpp",
|
2016-02-04 06:48:08 +01:00
|
|
|
"bionic/netinet_in.cpp",
|
2016-04-07 02:14:45 +02:00
|
|
|
"bionic/nl_types.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/open.cpp",
|
|
|
|
"bionic/pathconf.cpp",
|
|
|
|
"bionic/pause.cpp",
|
2021-02-23 03:09:48 +01:00
|
|
|
"bionic/pidfd.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/pipe.cpp",
|
|
|
|
"bionic/poll.cpp",
|
|
|
|
"bionic/posix_fadvise.cpp",
|
|
|
|
"bionic/posix_fallocate.cpp",
|
|
|
|
"bionic/posix_madvise.cpp",
|
|
|
|
"bionic/posix_timers.cpp",
|
2021-10-14 03:25:21 +02:00
|
|
|
"bionic/preadv_pwritev.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/ptrace.cpp",
|
|
|
|
"bionic/pty.cpp",
|
|
|
|
"bionic/raise.cpp",
|
|
|
|
"bionic/rand.cpp",
|
|
|
|
"bionic/readlink.cpp",
|
2019-11-01 16:07:25 +01:00
|
|
|
"bionic/realpath.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/reboot.cpp",
|
|
|
|
"bionic/recv.cpp",
|
2019-11-06 22:15:00 +01:00
|
|
|
"bionic/recvmsg.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/rename.cpp",
|
|
|
|
"bionic/rmdir.cpp",
|
|
|
|
"bionic/scandir.cpp",
|
|
|
|
"bionic/sched_getaffinity.cpp",
|
|
|
|
"bionic/sched_getcpu.cpp",
|
|
|
|
"bionic/semaphore.cpp",
|
|
|
|
"bionic/send.cpp",
|
|
|
|
"bionic/setegid.cpp",
|
|
|
|
"bionic/seteuid.cpp",
|
|
|
|
"bionic/setpgrp.cpp",
|
|
|
|
"bionic/sigaction.cpp",
|
|
|
|
"bionic/signal.cpp",
|
2018-02-27 01:49:43 +01:00
|
|
|
"bionic/sigprocmask.cpp",
|
2019-10-28 23:59:38 +01:00
|
|
|
"bionic/sleep.cpp",
|
2020-04-30 02:17:56 +02:00
|
|
|
"bionic/socketpair.cpp",
|
2017-10-07 01:58:36 +02:00
|
|
|
"bionic/spawn.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/stat.cpp",
|
2017-07-11 23:27:07 +02:00
|
|
|
"bionic/stdlib_l.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/strerror.cpp",
|
2017-07-11 23:27:07 +02:00
|
|
|
"bionic/string_l.cpp",
|
|
|
|
"bionic/strings_l.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/strsignal.cpp",
|
2017-12-19 19:27:27 +01:00
|
|
|
"bionic/strtol.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/strtold.cpp",
|
2017-10-18 22:34:32 +02:00
|
|
|
"bionic/swab.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/symlink.cpp",
|
2016-04-11 23:51:38 +02:00
|
|
|
"bionic/sync_file_range.cpp",
|
2018-01-31 00:09:51 +01:00
|
|
|
"bionic/sys_epoll.cpp",
|
2016-08-17 03:14:26 +02:00
|
|
|
"bionic/sys_msg.cpp",
|
|
|
|
"bionic/sys_sem.cpp",
|
|
|
|
"bionic/sys_shm.cpp",
|
2018-01-27 02:47:56 +01:00
|
|
|
"bionic/sys_signalfd.cpp",
|
2019-08-30 05:45:14 +02:00
|
|
|
"bionic/sys_statfs.cpp",
|
|
|
|
"bionic/sys_statvfs.cpp",
|
2016-06-09 04:51:20 +02:00
|
|
|
"bionic/sys_time.cpp",
|
2017-07-11 23:27:07 +02:00
|
|
|
"bionic/sysinfo.cpp",
|
|
|
|
"bionic/syslog.cpp",
|
2018-02-07 21:44:45 +01:00
|
|
|
"bionic/system.cpp",
|
2017-12-12 08:31:33 +01:00
|
|
|
"bionic/system_property_api.cpp",
|
|
|
|
"bionic/system_property_set.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/tdestroy.cpp",
|
|
|
|
"bionic/termios.cpp",
|
|
|
|
"bionic/thread_private.cpp",
|
2019-04-18 23:27:24 +02:00
|
|
|
"bionic/threads.cpp",
|
2023-04-25 02:04:49 +02:00
|
|
|
"bionic/time.cpp",
|
2022-12-06 23:24:27 +01:00
|
|
|
"bionic/time_l.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/tmpfile.cpp",
|
|
|
|
"bionic/umount.cpp",
|
|
|
|
"bionic/unlink.cpp",
|
2019-10-28 23:59:38 +01:00
|
|
|
"bionic/usleep.cpp",
|
2020-08-08 00:55:02 +02:00
|
|
|
"bionic/utmp.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/wait.cpp",
|
|
|
|
"bionic/wchar.cpp",
|
2017-07-11 23:27:07 +02:00
|
|
|
"bionic/wchar_l.cpp",
|
2016-08-27 01:17:17 +02:00
|
|
|
"bionic/wcstod.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/wctype.cpp",
|
2017-07-28 02:08:08 +02:00
|
|
|
"bionic/wcwidth.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
"bionic/wmempcpy.cpp",
|
2017-10-12 22:34:42 +02:00
|
|
|
|
|
|
|
// This contains a weak stub implementation of __find_icu_symbol for wctype.cpp,
|
|
|
|
// which will be overridden by the actual one in libc.so.
|
|
|
|
"bionic/icu_static.cpp",
|
2015-10-15 23:49:45 +02:00
|
|
|
],
|
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
multilib: {
|
|
|
|
lib32: {
|
|
|
|
// LP32 cruft
|
2015-11-23 23:12:15 +01:00
|
|
|
srcs: ["bionic/mmap.cpp"],
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
|
|
|
},
|
2017-09-02 01:29:44 +02:00
|
|
|
product_variables: {
|
2017-12-13 23:11:26 +01:00
|
|
|
treble_linker_namespaces: {
|
|
|
|
cflags: ["-DTREBLE_LINKER_NAMESPACES"],
|
2017-09-02 01:29:44 +02:00
|
|
|
},
|
|
|
|
},
|
2020-07-24 11:29:52 +02:00
|
|
|
whole_static_libs: [
|
|
|
|
"libsystemproperties",
|
|
|
|
],
|
2015-11-01 07:03:05 +01:00
|
|
|
cppflags: ["-Wold-style-cast"],
|
2015-09-17 01:33:27 +02:00
|
|
|
local_include_dirs: ["stdio"],
|
|
|
|
include_dirs: ["bionic/libstdc++/include"],
|
|
|
|
name: "libc_bionic_ndk",
|
2016-12-14 00:47:25 +01:00
|
|
|
generated_headers: ["generated_android_ids"],
|
2015-09-17 01:33:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ========================================================
|
|
|
|
// libc_pthread.a - pthreads parts that previously lived in
|
|
|
|
// libc_bionic.a. Relocated to their own library because
|
2019-10-02 02:54:42 +02:00
|
|
|
// they can't be included in libc_ndk.a (as the layout of
|
2015-09-17 01:33:27 +02:00
|
|
|
// pthread_t has changed over the years and has ABI
|
|
|
|
// compatibility issues).
|
|
|
|
// ========================================================
|
|
|
|
|
|
|
|
cc_library_static {
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["libc_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
srcs: [
|
Reorganize static TLS memory for ELF TLS
For ELF TLS "local-exec" accesses, the static linker assumes that an
executable's TLS segment is located at a statically-known offset from the
thread pointer (i.e. "variant 1" for ARM and "variant 2" for x86).
Because these layouts are incompatible, Bionic generally needs to allocate
its TLS slots differently between different architectures.
To allow per-architecture TLS slots:
- Replace the TLS_SLOT_xxx enumerators with macros. New ARM slots are
generally negative, while new x86 slots are generally positive.
- Define a bionic_tcb struct that provides two things:
- a void* raw_slots_storage[BIONIC_TLS_SLOTS] field
- an inline accessor function: void*& tls_slot(size_t tpindex);
For ELF TLS, it's necessary to allocate a temporary TCB (i.e. TLS slots),
because the runtime linker doesn't know how large the static TLS area is
until after it has loaded all of the initial solibs.
To accommodate Golang, it's necessary to allocate the pthread keys at a
fixed, small, positive offset from the thread pointer.
This CL moves the pthread keys into bionic_tls, then allocates a single
mapping per thread that looks like so:
- stack guard
- stack [omitted for main thread and with pthread_attr_setstack]
- static TLS:
- bionic_tcb [exec TLS will either precede or succeed the TCB]
- bionic_tls [prefixed by the pthread keys]
- [solib TLS segments will be placed here]
- guard page
As before, if the new mapping includes a stack, the pthread_internal_t
is allocated on it.
At startup, Bionic allocates a temporary bionic_tcb object on the stack,
then allocates a temporary bionic_tls object using mmap. This mmap is
delayed because the linker can't currently call async_safe_fatal() before
relocating itself.
Later, Bionic allocates a stack-less thread mapping for the main thread,
and copies slots from the temporary TCB to the new TCB.
(See *::copy_from_bootstrap methods.)
Bug: http://b/78026329
Test: bionic unit tests
Test: verify that a Golang app still works
Test: verify that a Golang app crashes if bionic_{tls,tcb} are swapped
Merged-In: I6543063752f4ec8ef6dc9c7f2a06ce2a18fc5af3
Change-Id: I6543063752f4ec8ef6dc9c7f2a06ce2a18fc5af3
(cherry picked from commit 1e660b70da625fcbf1e43dfae09b7b4817fa1660)
2019-01-03 11:51:30 +01:00
|
|
|
"bionic/bionic_elf_tls.cpp",
|
2015-09-17 01:33:27 +02:00
|
|
|
"bionic/pthread_atfork.cpp",
|
|
|
|
"bionic/pthread_attr.cpp",
|
2015-11-19 22:32:49 +01:00
|
|
|
"bionic/pthread_barrier.cpp",
|
2015-09-17 01:33:27 +02:00
|
|
|
"bionic/pthread_cond.cpp",
|
|
|
|
"bionic/pthread_create.cpp",
|
|
|
|
"bionic/pthread_detach.cpp",
|
|
|
|
"bionic/pthread_equal.cpp",
|
|
|
|
"bionic/pthread_exit.cpp",
|
|
|
|
"bionic/pthread_getcpuclockid.cpp",
|
|
|
|
"bionic/pthread_getschedparam.cpp",
|
|
|
|
"bionic/pthread_gettid_np.cpp",
|
2017-02-02 03:41:38 +01:00
|
|
|
"bionic/pthread_internal.cpp",
|
2015-09-17 01:33:27 +02:00
|
|
|
"bionic/pthread_join.cpp",
|
|
|
|
"bionic/pthread_key.cpp",
|
|
|
|
"bionic/pthread_kill.cpp",
|
|
|
|
"bionic/pthread_mutex.cpp",
|
|
|
|
"bionic/pthread_once.cpp",
|
|
|
|
"bionic/pthread_rwlock.cpp",
|
2018-08-28 01:00:58 +02:00
|
|
|
"bionic/pthread_sigqueue.cpp",
|
2015-09-17 01:33:27 +02:00
|
|
|
"bionic/pthread_self.cpp",
|
|
|
|
"bionic/pthread_setname_np.cpp",
|
|
|
|
"bionic/pthread_setschedparam.cpp",
|
2015-11-19 22:32:49 +01:00
|
|
|
"bionic/pthread_spinlock.cpp",
|
2020-07-14 23:37:04 +02:00
|
|
|
"bionic/sys_thread_properties.cpp",
|
2017-10-12 22:34:42 +02:00
|
|
|
|
|
|
|
// The following implementations depend on pthread data or implementation,
|
|
|
|
// so we can't include them in libc_ndk.a.
|
|
|
|
"bionic/__cxa_thread_atexit_impl.cpp",
|
2020-01-15 02:59:41 +01:00
|
|
|
"bionic/android_unsafe_frame_pointer_chase.cpp",
|
2020-02-05 00:46:15 +01:00
|
|
|
"bionic/atexit.cpp",
|
2017-10-12 22:34:42 +02:00
|
|
|
"bionic/fork.cpp",
|
2015-09-17 01:33:27 +02:00
|
|
|
],
|
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
cppflags: ["-Wold-style-cast"],
|
2015-09-17 01:33:27 +02:00
|
|
|
include_dirs: ["bionic/libstdc++/include"],
|
2020-01-15 02:59:41 +01:00
|
|
|
header_libs: ["bionic_libc_platform_headers"],
|
2015-09-17 01:33:27 +02:00
|
|
|
name: "libc_pthread",
|
|
|
|
}
|
|
|
|
|
|
|
|
// ========================================================
|
|
|
|
// libc_syscalls.a
|
|
|
|
// ========================================================
|
|
|
|
|
2019-04-16 21:31:00 +02:00
|
|
|
genrule {
|
2023-04-12 00:20:19 +02:00
|
|
|
name: "syscalls-arm",
|
2019-04-16 21:31:00 +02:00
|
|
|
out: ["syscalls-arm.S"],
|
|
|
|
srcs: ["SYSCALLS.TXT"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["gensyscalls"],
|
|
|
|
cmd: "$(location gensyscalls) arm $(in) > $(out)",
|
2019-04-16 21:31:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
2023-04-12 00:20:19 +02:00
|
|
|
name: "syscalls-arm64",
|
2019-04-16 21:31:00 +02:00
|
|
|
out: ["syscalls-arm64.S"],
|
|
|
|
srcs: ["SYSCALLS.TXT"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["gensyscalls"],
|
|
|
|
cmd: "$(location gensyscalls) arm64 $(in) > $(out)",
|
2019-04-16 21:31:00 +02:00
|
|
|
}
|
|
|
|
|
2022-10-10 19:06:43 +02:00
|
|
|
genrule {
|
2023-04-12 00:20:19 +02:00
|
|
|
name: "syscalls-riscv64",
|
2022-10-10 19:06:43 +02:00
|
|
|
out: ["syscalls-riscv64.S"],
|
|
|
|
srcs: ["SYSCALLS.TXT"],
|
|
|
|
tools: ["gensyscalls"],
|
|
|
|
cmd: "$(location gensyscalls) riscv64 $(in) > $(out)",
|
|
|
|
}
|
|
|
|
|
2019-04-16 21:31:00 +02:00
|
|
|
genrule {
|
2023-04-12 00:20:19 +02:00
|
|
|
name: "syscalls-x86",
|
2019-04-16 21:31:00 +02:00
|
|
|
out: ["syscalls-x86.S"],
|
|
|
|
srcs: ["SYSCALLS.TXT"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["gensyscalls"],
|
|
|
|
cmd: "$(location gensyscalls) x86 $(in) > $(out)",
|
2019-04-16 21:31:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
2023-04-12 00:20:19 +02:00
|
|
|
name: "syscalls-x86_64",
|
2019-04-16 21:31:00 +02:00
|
|
|
out: ["syscalls-x86_64.S"],
|
|
|
|
srcs: ["SYSCALLS.TXT"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["gensyscalls"],
|
|
|
|
cmd: "$(location gensyscalls) x86_64 $(in) > $(out)",
|
2019-04-16 21:31:00 +02:00
|
|
|
}
|
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
cc_library_static {
|
2016-04-07 22:27:24 +02:00
|
|
|
defaults: ["libc_defaults"],
|
2017-10-12 22:34:42 +02:00
|
|
|
srcs: ["bionic/__set_errno.cpp"],
|
2015-09-17 01:33:27 +02:00
|
|
|
arch: {
|
|
|
|
arm: {
|
2023-04-12 00:20:19 +02:00
|
|
|
srcs: [":syscalls-arm"],
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
|
|
|
arm64: {
|
2023-04-12 00:20:19 +02:00
|
|
|
srcs: [":syscalls-arm64"],
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
2022-10-10 19:06:43 +02:00
|
|
|
riscv64: {
|
2023-04-12 00:20:19 +02:00
|
|
|
srcs: [":syscalls-riscv64"],
|
2022-10-10 19:06:43 +02:00
|
|
|
},
|
2015-09-17 01:33:27 +02:00
|
|
|
x86: {
|
2023-04-12 00:20:19 +02:00
|
|
|
srcs: [":syscalls-x86"],
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
|
|
|
x86_64: {
|
2023-04-12 00:20:19 +02:00
|
|
|
srcs: [":syscalls-x86_64"],
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
name: "libc_syscalls",
|
|
|
|
}
|
|
|
|
|
|
|
|
// ========================================================
|
|
|
|
// libc_aeabi.a
|
|
|
|
// This is an LP32 ARM-only library that needs to be built with -fno-builtin
|
|
|
|
// to avoid infinite recursion. For the other architectures we just build an
|
|
|
|
// empty library to keep this makefile simple.
|
|
|
|
// ========================================================
|
|
|
|
|
|
|
|
cc_library_static {
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["libc_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
arch: {
|
|
|
|
arm: {
|
|
|
|
srcs: ["arch-arm/bionic/__aeabi.c"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
name: "libc_aeabi",
|
2015-11-01 07:03:05 +01:00
|
|
|
cflags: ["-fno-builtin"],
|
2015-09-17 01:33:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ========================================================
|
|
|
|
// libc_ndk.a
|
|
|
|
// Compatibility library for the NDK. This library contains
|
|
|
|
// all the parts of libc that are safe to statically link.
|
|
|
|
// We can't safely statically link things that can only run
|
|
|
|
// on a certain version of the OS. Examples include
|
|
|
|
// anything that talks to netd (a large portion of the DNS
|
|
|
|
// code) and anything that is dependent on the layout of a
|
|
|
|
// data structure that has changed across releases (such as
|
|
|
|
// pthread_t).
|
|
|
|
// ========================================================
|
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
name: "libc_ndk",
|
2019-10-02 02:54:42 +02:00
|
|
|
defaults: [
|
|
|
|
"libc_defaults",
|
|
|
|
"libc_native_allocator_defaults",
|
|
|
|
],
|
2020-01-22 01:43:56 +01:00
|
|
|
ramdisk_available: false,
|
2020-10-22 03:36:36 +02:00
|
|
|
vendor_ramdisk_available: false,
|
2019-02-09 02:30:58 +01:00
|
|
|
srcs: libc_common_src_files + [
|
2020-02-01 04:57:04 +01:00
|
|
|
"bionic/gwp_asan_wrappers.cpp",
|
2020-01-09 19:48:22 +01:00
|
|
|
"bionic/heap_tagging.cpp",
|
2019-02-09 02:30:58 +01:00
|
|
|
"bionic/malloc_common.cpp",
|
2019-02-16 03:06:15 +01:00
|
|
|
"bionic/malloc_limit.cpp",
|
2019-02-09 02:30:58 +01:00
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
multilib: {
|
|
|
|
lib32: {
|
|
|
|
srcs: libc_common_src_files_32,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
arch: {
|
|
|
|
arm: {
|
|
|
|
srcs: [
|
|
|
|
"arch-arm/bionic/exidx_dynamic.c",
|
|
|
|
"arch-common/bionic/crtbegin_so.c",
|
|
|
|
"arch-arm/bionic/atexit_legacy.c",
|
|
|
|
"arch-common/bionic/crtend_so.S",
|
|
|
|
],
|
|
|
|
whole_static_libs: ["libc_aeabi"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
cflags: [
|
2015-09-17 01:33:27 +02:00
|
|
|
"-fvisibility=hidden",
|
|
|
|
"-DLIBC_STATIC",
|
|
|
|
],
|
|
|
|
|
|
|
|
whole_static_libs: [
|
2020-02-01 04:57:04 +01:00
|
|
|
"gwp_asan",
|
Add the recoverable GWP-ASan feature.
GWP-ASan's recoverable mode was landed upstream in
https://reviews.llvm.org/D140173.
This mode allows for a use-after-free or a buffer-overflow bug to be
detected by GWP-ASan, a crash report dumped, but then GWP-ASan (through
the preCrashReport() and postCrashReportRecoverableOnly() hooks) will
patch up the memory so that the process can continue, in spite of the
memory safety bug.
This is desirable, as it allows us to consider migrating non-system apps
from opt-in GWP-ASan to opt-out GWP-ASan. The major concern was "if we
make it opt-out, then bad apps will start crashing". If we don't crash,
problem solved :). Obviously, we'll need to do this with an amount of
process sampling to mitigate against the 70KiB memory overhead.
The biggest problem is that the debuggerd signal handler isn't the first
signal handler for apps, it's the sigchain handler inside of libart.
Clearly, the sigchain handler needs to ask us whether the crash is
GWP-ASan's fault, and if so, please patch up the allocator. Because of
linker namespace restrictions, libart can't directly ask the linker
(which is where debuggerd lies), so we provide a proxy function in libc.
Test: Build the platform, run sanitizer-status and various test apps
with recoverable gwp-asan. Assert that it doesn't crash, and we get a
debuggerd report.
Bug: 247012630
Change-Id: I86d5e27a9ca5531c8942e62647fd377c3cd36dfd
2023-01-19 21:47:22 +01:00
|
|
|
"gwp_asan_crash_handler",
|
2020-02-21 21:11:02 +01:00
|
|
|
"libarm-optimized-routines-string",
|
2021-03-16 07:39:19 +01:00
|
|
|
"libasync_safe",
|
2015-09-17 01:33:27 +02:00
|
|
|
"libc_bionic_ndk",
|
2019-11-02 01:18:28 +01:00
|
|
|
"libc_bootstrap",
|
2017-07-21 22:28:42 +02:00
|
|
|
"libc_fortify",
|
2015-09-17 01:33:27 +02:00
|
|
|
"libc_freebsd",
|
2016-08-17 00:57:47 +02:00
|
|
|
"libc_freebsd_large_stack",
|
2023-07-20 22:24:09 +02:00
|
|
|
"libc_freebsd_ldexp",
|
2015-09-17 01:33:27 +02:00
|
|
|
"libc_gdtoa",
|
|
|
|
"libc_netbsd",
|
2016-08-17 00:57:47 +02:00
|
|
|
"libc_openbsd_large_stack",
|
2015-09-17 01:33:27 +02:00
|
|
|
"libc_openbsd_ndk",
|
|
|
|
"libc_syscalls",
|
|
|
|
"libc_tzcode",
|
|
|
|
"libm",
|
2016-05-28 02:57:46 +02:00
|
|
|
"libstdc++",
|
2015-09-17 01:33:27 +02:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
// ========================================================
|
2017-10-12 22:34:42 +02:00
|
|
|
// libc_nopthread.a
|
2015-09-17 01:33:27 +02:00
|
|
|
// ========================================================
|
|
|
|
cc_library_static {
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["libc_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
srcs: libc_common_src_files,
|
|
|
|
multilib: {
|
|
|
|
lib32: {
|
|
|
|
srcs: libc_common_src_files_32,
|
|
|
|
},
|
|
|
|
},
|
2017-10-12 22:34:42 +02:00
|
|
|
name: "libc_nopthread",
|
2015-09-17 01:33:27 +02:00
|
|
|
|
|
|
|
whole_static_libs: [
|
2020-02-21 21:11:02 +01:00
|
|
|
"libarm-optimized-routines-string",
|
2021-03-16 07:39:19 +01:00
|
|
|
"libasync_safe",
|
2015-09-17 01:33:27 +02:00
|
|
|
"libc_bionic",
|
|
|
|
"libc_bionic_ndk",
|
2019-11-02 01:18:28 +01:00
|
|
|
"libc_bootstrap",
|
2015-09-17 01:33:27 +02:00
|
|
|
"libc_dns",
|
2017-07-21 22:28:42 +02:00
|
|
|
"libc_fortify",
|
2015-09-17 01:33:27 +02:00
|
|
|
"libc_freebsd",
|
2016-08-17 00:57:47 +02:00
|
|
|
"libc_freebsd_large_stack",
|
2023-07-20 22:24:09 +02:00
|
|
|
"libc_freebsd_ldexp",
|
2015-09-17 01:33:27 +02:00
|
|
|
"libc_gdtoa",
|
|
|
|
"libc_netbsd",
|
|
|
|
"libc_openbsd",
|
2016-08-17 00:57:47 +02:00
|
|
|
"libc_openbsd_large_stack",
|
2015-09-17 01:33:27 +02:00
|
|
|
"libc_openbsd_ndk",
|
|
|
|
"libc_syscalls",
|
|
|
|
"libc_tzcode",
|
2016-05-28 02:57:46 +02:00
|
|
|
"libstdc++",
|
2015-09-17 01:33:27 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
arch: {
|
|
|
|
arm: {
|
|
|
|
whole_static_libs: ["libc_aeabi"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2017-10-12 22:34:42 +02:00
|
|
|
// ========================================================
|
|
|
|
// libc_common.a
|
|
|
|
// ========================================================
|
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
defaults: ["libc_defaults"],
|
|
|
|
name: "libc_common",
|
|
|
|
|
|
|
|
whole_static_libs: [
|
|
|
|
"libc_nopthread",
|
|
|
|
"libc_pthread",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2018-11-12 19:06:56 +01:00
|
|
|
// ========================================================
|
2019-11-02 01:18:28 +01:00
|
|
|
// libc_static_dispatch.a
|
2018-11-12 19:06:56 +01:00
|
|
|
// ========================================================
|
|
|
|
cc_library_static {
|
|
|
|
defaults: ["libc_defaults"],
|
2019-11-02 01:18:28 +01:00
|
|
|
name: "libc_static_dispatch",
|
2018-11-12 19:06:56 +01:00
|
|
|
|
2018-08-11 19:12:13 +02:00
|
|
|
arch: {
|
2022-06-10 03:41:14 +02:00
|
|
|
x86_64: {
|
|
|
|
srcs: ["arch-x86_64/static_function_dispatch.S"],
|
|
|
|
},
|
2018-08-11 19:12:13 +02:00
|
|
|
x86: {
|
|
|
|
srcs: ["arch-x86/static_function_dispatch.S"],
|
|
|
|
},
|
2018-11-19 20:00:32 +01:00
|
|
|
arm: {
|
|
|
|
srcs: ["arch-arm/static_function_dispatch.S"],
|
|
|
|
},
|
2019-10-28 21:11:00 +01:00
|
|
|
arm64: {
|
|
|
|
srcs: ["arch-arm64/static_function_dispatch.S"],
|
|
|
|
},
|
2023-11-08 21:04:41 +01:00
|
|
|
riscv64: {
|
2024-01-19 20:05:36 +01:00
|
|
|
srcs: ["arch-riscv64/static_function_dispatch.S"],
|
2023-11-08 21:04:41 +01:00
|
|
|
},
|
2018-08-11 19:12:13 +02:00
|
|
|
},
|
2018-11-12 19:06:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ========================================================
|
2019-11-02 01:18:28 +01:00
|
|
|
// libc_dynamic_dispatch.a
|
2018-11-12 19:06:56 +01:00
|
|
|
// ========================================================
|
|
|
|
cc_library_static {
|
|
|
|
defaults: ["libc_defaults"],
|
2019-11-02 01:18:28 +01:00
|
|
|
name: "libc_dynamic_dispatch",
|
2018-11-12 19:06:56 +01:00
|
|
|
|
2018-08-11 19:12:13 +02:00
|
|
|
cflags: [
|
2019-11-01 01:11:54 +01:00
|
|
|
"-ffreestanding",
|
2018-08-11 19:12:13 +02:00
|
|
|
"-fno-stack-protector",
|
|
|
|
"-fno-jump-tables",
|
|
|
|
],
|
|
|
|
arch: {
|
2022-06-10 03:41:14 +02:00
|
|
|
x86_64: {
|
|
|
|
srcs: ["arch-x86_64/dynamic_function_dispatch.cpp"],
|
|
|
|
},
|
2018-08-11 19:12:13 +02:00
|
|
|
x86: {
|
|
|
|
srcs: ["arch-x86/dynamic_function_dispatch.cpp"],
|
|
|
|
},
|
2018-11-19 20:00:32 +01:00
|
|
|
arm: {
|
2019-01-31 23:29:22 +01:00
|
|
|
srcs: ["arch-arm/dynamic_function_dispatch.cpp"],
|
2018-11-19 20:00:32 +01:00
|
|
|
},
|
2019-10-28 21:11:00 +01:00
|
|
|
arm64: {
|
|
|
|
srcs: ["arch-arm64/dynamic_function_dispatch.cpp"],
|
|
|
|
},
|
2023-11-08 21:04:41 +01:00
|
|
|
riscv64: {
|
2024-01-19 20:05:36 +01:00
|
|
|
srcs: ["arch-riscv64/dynamic_function_dispatch.cpp"],
|
2023-11-08 21:04:41 +01:00
|
|
|
},
|
2018-08-11 19:12:13 +02:00
|
|
|
},
|
2019-11-02 01:18:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ========================================================
|
|
|
|
// libc_common_static.a For static binaries.
|
|
|
|
// ========================================================
|
|
|
|
cc_library_static {
|
|
|
|
defaults: ["libc_defaults"],
|
|
|
|
name: "libc_common_static",
|
2018-08-11 19:12:13 +02:00
|
|
|
|
2018-11-12 19:06:56 +01:00
|
|
|
whole_static_libs: [
|
|
|
|
"libc_common",
|
2019-11-02 01:18:28 +01:00
|
|
|
"libc_static_dispatch",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
// ========================================================
|
|
|
|
// libc_common_shared.a For shared libraries.
|
|
|
|
// ========================================================
|
|
|
|
cc_library_static {
|
|
|
|
defaults: ["libc_defaults"],
|
|
|
|
name: "libc_common_shared",
|
|
|
|
|
|
|
|
whole_static_libs: [
|
|
|
|
"libc_common",
|
|
|
|
"libc_dynamic_dispatch",
|
2018-11-12 19:06:56 +01:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
Move dl_unwind_find_exidx from libdl.a to libc.a
arm32 has two special APIs to find exidx exception handling info,
dl_unwind_find_exidx and __gnu_Unwind_Find_exdix. The two functions have
identical behavior and function prototypes. libgcc's arm32 unwinder calls
__gnu_Unwind_Find_exdix, whereas LLVM's libunwind previously called
__gnu_Unwind_Find_exdix, but switched to dl_unwind_find_exidx as a result
of three patches (D30306, D30681, D39468).
In Bionic, for dynamic linking, __gnu_Unwind_Find_exdix in libc.so calls
dl_unwind_find_exidx in libdl.so.
For static executables, though, __gnu_Unwind_Find_exdix in libc.a used the
__exidx_* symbols, while dl_unwind_find_exidx in libdl.a(libdl_static.o)
was a return-0 no-op.
To fix the LLVM unwinder, replace the no-op dl_unwind_find_exidx in
libdl.a with a real function in libc.a(exidx_static.o), and have the GNU
function call the dl function for more consistency with dynamic linking.
dl_iterate_phdr follows a similar pattern, where the function exists in
libc.a and libdl.so (not libc.so or libdl.a).
This change makes unwinding work with an updated libunwind_llvm on arm32,
and it helps to allow unwinding in static executables without libdl.a.
Bug: https://github.com/android/ndk/issues/1094
Bug: http://b/141485154
Test: NDK tests, bionic unit tests
Change-Id: Ieeeb9b39a0e28544e21f9afe6fe51ef10d7c828c
2019-10-11 08:59:30 +02:00
|
|
|
// Versions of dl_iterate_phdr and similar APIs used to lookup unwinding information in a static
|
|
|
|
// executable.
|
|
|
|
cc_library_static {
|
|
|
|
name: "libc_unwind_static",
|
|
|
|
defaults: ["libc_defaults"],
|
|
|
|
cflags: ["-DLIBC_STATIC"],
|
|
|
|
|
|
|
|
srcs: ["bionic/dl_iterate_phdr_static.cpp"],
|
|
|
|
arch: {
|
|
|
|
// arm32-specific dl_unwind_find_exidx and __gnu_Unwind_Find_exidx APIs
|
|
|
|
arm: {
|
|
|
|
srcs: ["arch-arm/bionic/exidx_static.c"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
// ========================================================
|
|
|
|
// libc_nomalloc.a
|
|
|
|
// ========================================================
|
|
|
|
//
|
2019-11-02 01:18:28 +01:00
|
|
|
// This is a version of the static C library used by the dynamic linker that exclude malloc. It also
|
|
|
|
// excludes functions selected using ifunc's (e.g. for string.h). Link in either
|
|
|
|
// libc_static_dispatch or libc_dynamic_dispatch to provide those functions.
|
2015-09-17 01:33:27 +02:00
|
|
|
|
|
|
|
cc_library_static {
|
2016-12-06 20:10:09 +01:00
|
|
|
name: "libc_nomalloc",
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["libc_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
|
2016-01-11 22:20:55 +01:00
|
|
|
whole_static_libs: [
|
2019-11-02 01:18:28 +01:00
|
|
|
"libc_common",
|
2016-01-11 22:20:55 +01:00
|
|
|
"libc_init_static",
|
Move dl_unwind_find_exidx from libdl.a to libc.a
arm32 has two special APIs to find exidx exception handling info,
dl_unwind_find_exidx and __gnu_Unwind_Find_exdix. The two functions have
identical behavior and function prototypes. libgcc's arm32 unwinder calls
__gnu_Unwind_Find_exdix, whereas LLVM's libunwind previously called
__gnu_Unwind_Find_exdix, but switched to dl_unwind_find_exidx as a result
of three patches (D30306, D30681, D39468).
In Bionic, for dynamic linking, __gnu_Unwind_Find_exdix in libc.so calls
dl_unwind_find_exidx in libdl.so.
For static executables, though, __gnu_Unwind_Find_exdix in libc.a used the
__exidx_* symbols, while dl_unwind_find_exidx in libdl.a(libdl_static.o)
was a return-0 no-op.
To fix the LLVM unwinder, replace the no-op dl_unwind_find_exidx in
libdl.a with a real function in libc.a(exidx_static.o), and have the GNU
function call the dl function for more consistency with dynamic linking.
dl_iterate_phdr follows a similar pattern, where the function exists in
libc.a and libdl.so (not libc.so or libdl.a).
This change makes unwinding work with an updated libunwind_llvm on arm32,
and it helps to allow unwinding in static executables without libdl.a.
Bug: https://github.com/android/ndk/issues/1094
Bug: http://b/141485154
Test: NDK tests, bionic unit tests
Change-Id: Ieeeb9b39a0e28544e21f9afe6fe51ef10d7c828c
2019-10-11 08:59:30 +02:00
|
|
|
"libc_unwind_static",
|
2016-01-11 22:20:55 +01:00
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
}
|
|
|
|
|
2018-12-05 16:33:52 +01:00
|
|
|
filegroup {
|
|
|
|
name: "libc_sources_shared",
|
|
|
|
srcs: [
|
|
|
|
"arch-common/bionic/crtbegin_so.c",
|
|
|
|
"arch-common/bionic/crtbrand.S",
|
2020-02-01 04:57:04 +01:00
|
|
|
"bionic/gwp_asan_wrappers.cpp",
|
2020-01-09 19:48:22 +01:00
|
|
|
"bionic/heap_tagging.cpp",
|
2018-12-05 16:33:52 +01:00
|
|
|
"bionic/icu.cpp",
|
|
|
|
"bionic/malloc_common.cpp",
|
2019-02-09 02:30:58 +01:00
|
|
|
"bionic/malloc_common_dynamic.cpp",
|
2020-01-02 20:54:57 +01:00
|
|
|
"bionic/android_profiling_dynamic.cpp",
|
2019-02-09 02:30:58 +01:00
|
|
|
"bionic/malloc_heapprofd.cpp",
|
2019-02-16 03:06:15 +01:00
|
|
|
"bionic/malloc_limit.cpp",
|
2019-12-11 19:00:58 +01:00
|
|
|
"bionic/ndk_cruft.cpp",
|
|
|
|
"bionic/ndk_cruft_data.cpp",
|
2018-12-05 16:33:52 +01:00
|
|
|
"bionic/NetdClient.cpp",
|
|
|
|
"arch-common/bionic/crtend_so.S",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
filegroup {
|
|
|
|
name: "libc_sources_static",
|
|
|
|
srcs: [
|
2020-02-01 04:57:04 +01:00
|
|
|
"bionic/gwp_asan_wrappers.cpp",
|
2020-01-09 19:48:22 +01:00
|
|
|
"bionic/heap_tagging.cpp",
|
2018-12-05 16:33:52 +01:00
|
|
|
"bionic/malloc_common.cpp",
|
2019-02-16 03:06:15 +01:00
|
|
|
"bionic/malloc_limit.cpp",
|
2018-12-05 16:33:52 +01:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
filegroup {
|
|
|
|
name: "libc_sources_shared_arm",
|
|
|
|
srcs: [
|
|
|
|
"arch-arm/bionic/exidx_dynamic.c",
|
|
|
|
"arch-arm/bionic/atexit_legacy.c",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
// ========================================================
|
|
|
|
// libc.a + libc.so
|
|
|
|
// ========================================================
|
2023-03-23 00:12:49 +01:00
|
|
|
cc_defaults {
|
2019-10-02 02:54:42 +02:00
|
|
|
defaults: [
|
|
|
|
"libc_defaults",
|
|
|
|
"libc_native_allocator_defaults",
|
|
|
|
],
|
2023-03-23 00:12:49 +01:00
|
|
|
name: "libc_library_defaults",
|
2015-11-01 07:03:05 +01:00
|
|
|
product_variables: {
|
2015-09-17 01:33:27 +02:00
|
|
|
platform_sdk_version: {
|
|
|
|
asflags: ["-DPLATFORM_SDK_VERSION=%d"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
static: {
|
2024-01-19 20:05:36 +01:00
|
|
|
srcs: [":libc_sources_static"],
|
2015-09-17 01:33:27 +02:00
|
|
|
cflags: ["-DLIBC_STATIC"],
|
2018-11-12 19:06:56 +01:00
|
|
|
whole_static_libs: [
|
2020-02-01 04:57:04 +01:00
|
|
|
"gwp_asan",
|
Add the recoverable GWP-ASan feature.
GWP-ASan's recoverable mode was landed upstream in
https://reviews.llvm.org/D140173.
This mode allows for a use-after-free or a buffer-overflow bug to be
detected by GWP-ASan, a crash report dumped, but then GWP-ASan (through
the preCrashReport() and postCrashReportRecoverableOnly() hooks) will
patch up the memory so that the process can continue, in spite of the
memory safety bug.
This is desirable, as it allows us to consider migrating non-system apps
from opt-in GWP-ASan to opt-out GWP-ASan. The major concern was "if we
make it opt-out, then bad apps will start crashing". If we don't crash,
problem solved :). Obviously, we'll need to do this with an amount of
process sampling to mitigate against the 70KiB memory overhead.
The biggest problem is that the debuggerd signal handler isn't the first
signal handler for apps, it's the sigchain handler inside of libart.
Clearly, the sigchain handler needs to ask us whether the crash is
GWP-ASan's fault, and if so, please patch up the allocator. Because of
linker namespace restrictions, libart can't directly ask the linker
(which is where debuggerd lies), so we provide a proxy function in libc.
Test: Build the platform, run sanitizer-status and various test apps
with recoverable gwp-asan. Assert that it doesn't crash, and we get a
debuggerd report.
Bug: 247012630
Change-Id: I86d5e27a9ca5531c8942e62647fd377c3cd36dfd
2023-01-19 21:47:22 +01:00
|
|
|
"gwp_asan_crash_handler",
|
2018-11-12 19:06:56 +01:00
|
|
|
"libc_init_static",
|
|
|
|
"libc_common_static",
|
Move dl_unwind_find_exidx from libdl.a to libc.a
arm32 has two special APIs to find exidx exception handling info,
dl_unwind_find_exidx and __gnu_Unwind_Find_exdix. The two functions have
identical behavior and function prototypes. libgcc's arm32 unwinder calls
__gnu_Unwind_Find_exdix, whereas LLVM's libunwind previously called
__gnu_Unwind_Find_exdix, but switched to dl_unwind_find_exidx as a result
of three patches (D30306, D30681, D39468).
In Bionic, for dynamic linking, __gnu_Unwind_Find_exdix in libc.so calls
dl_unwind_find_exidx in libdl.so.
For static executables, though, __gnu_Unwind_Find_exdix in libc.a used the
__exidx_* symbols, while dl_unwind_find_exidx in libdl.a(libdl_static.o)
was a return-0 no-op.
To fix the LLVM unwinder, replace the no-op dl_unwind_find_exidx in
libdl.a with a real function in libc.a(exidx_static.o), and have the GNU
function call the dl function for more consistency with dynamic linking.
dl_iterate_phdr follows a similar pattern, where the function exists in
libc.a and libdl.so (not libc.so or libdl.a).
This change makes unwinding work with an updated libunwind_llvm on arm32,
and it helps to allow unwinding in static executables without libdl.a.
Bug: https://github.com/android/ndk/issues/1094
Bug: http://b/141485154
Test: NDK tests, bionic unit tests
Change-Id: Ieeeb9b39a0e28544e21f9afe6fe51ef10d7c828c
2019-10-11 08:59:30 +02:00
|
|
|
"libc_unwind_static",
|
2018-11-12 19:06:56 +01:00
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
|
|
|
shared: {
|
2024-01-19 20:05:36 +01:00
|
|
|
srcs: [":libc_sources_shared"],
|
2018-11-12 19:06:56 +01:00
|
|
|
whole_static_libs: [
|
2020-02-01 04:57:04 +01:00
|
|
|
"gwp_asan",
|
Add the recoverable GWP-ASan feature.
GWP-ASan's recoverable mode was landed upstream in
https://reviews.llvm.org/D140173.
This mode allows for a use-after-free or a buffer-overflow bug to be
detected by GWP-ASan, a crash report dumped, but then GWP-ASan (through
the preCrashReport() and postCrashReportRecoverableOnly() hooks) will
patch up the memory so that the process can continue, in spite of the
memory safety bug.
This is desirable, as it allows us to consider migrating non-system apps
from opt-in GWP-ASan to opt-out GWP-ASan. The major concern was "if we
make it opt-out, then bad apps will start crashing". If we don't crash,
problem solved :). Obviously, we'll need to do this with an amount of
process sampling to mitigate against the 70KiB memory overhead.
The biggest problem is that the debuggerd signal handler isn't the first
signal handler for apps, it's the sigchain handler inside of libart.
Clearly, the sigchain handler needs to ask us whether the crash is
GWP-ASan's fault, and if so, please patch up the allocator. Because of
linker namespace restrictions, libart can't directly ask the linker
(which is where debuggerd lies), so we provide a proxy function in libc.
Test: Build the platform, run sanitizer-status and various test apps
with recoverable gwp-asan. Assert that it doesn't crash, and we get a
debuggerd report.
Bug: 247012630
Change-Id: I86d5e27a9ca5531c8942e62647fd377c3cd36dfd
2023-01-19 21:47:22 +01:00
|
|
|
"gwp_asan_crash_handler",
|
2018-11-12 19:06:56 +01:00
|
|
|
"libc_init_dynamic",
|
|
|
|
"libc_common_shared",
|
2020-12-16 12:37:22 +01:00
|
|
|
"libunwind-exported",
|
2018-11-12 19:06:56 +01:00
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
|
|
|
|
2019-04-25 10:28:27 +02:00
|
|
|
required: [
|
2022-06-28 22:14:58 +02:00
|
|
|
"tzdata_prebuilt",
|
|
|
|
"tz_version_prebuilt", // Version metadata for tzdata to help debugging.
|
2019-04-25 10:28:27 +02:00
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
|
2016-11-15 22:15:43 +01:00
|
|
|
// Do not pack libc.so relocations; see http://b/20645321 for details.
|
|
|
|
pack_relocations: false,
|
|
|
|
|
2018-01-05 11:39:28 +01:00
|
|
|
// WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so!
|
|
|
|
// If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the
|
|
|
|
// LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into
|
|
|
|
// those new libraries from libgcc.a are not declared external; if that were the case,
|
|
|
|
// then libc would not pull those symbols from libgcc.a as it should, instead relying
|
|
|
|
// on the external symbols from the dependent libraries. That would create a "cloaked"
|
|
|
|
// dependency on libgcc.a in libc though the libraries, which is not what you wanted!
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"ld-android",
|
|
|
|
"libdl",
|
|
|
|
],
|
2019-04-02 16:04:52 +02:00
|
|
|
static_libs: [
|
|
|
|
"libdl_android",
|
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
|
|
|
|
nocrt: true,
|
|
|
|
|
|
|
|
arch: {
|
|
|
|
arm: {
|
2018-09-07 01:04:08 +02:00
|
|
|
// TODO: This is to work around b/24465209. Remove after root cause is fixed.
|
2018-05-24 03:45:53 +02:00
|
|
|
pack_relocations: false,
|
2023-11-10 20:19:11 +01:00
|
|
|
ldflags: [
|
|
|
|
"-Wl,--hash-style=both",
|
|
|
|
// Since we are preserving the debug_frame, do not compress
|
|
|
|
// in this case to make unwinds as fast as possible.
|
|
|
|
"-Wl,--compress-debug-sections=none",
|
|
|
|
],
|
2018-01-19 01:26:19 +01:00
|
|
|
|
2018-09-07 01:04:08 +02:00
|
|
|
version_script: ":libc.arm.map",
|
2021-01-28 02:27:31 +01:00
|
|
|
no_libcrt: true,
|
2015-11-03 23:30:57 +01:00
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
shared: {
|
2018-12-05 16:33:52 +01:00
|
|
|
srcs: [":libc_sources_shared_arm"],
|
2016-05-12 10:43:07 +02:00
|
|
|
// special for arm
|
|
|
|
cflags: ["-DCRT_LEGACY_WORKAROUND"],
|
2021-01-28 02:27:31 +01:00
|
|
|
// For backwards-compatibility, some arm32 builtins are exported from libc.so.
|
2022-02-10 20:37:28 +01:00
|
|
|
static_libs: ["libclang_rt.builtins-exported"],
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
2019-05-18 01:22:56 +02:00
|
|
|
|
|
|
|
// Arm 32 bit does not produce complete exidx unwind information
|
|
|
|
// so keep the .debug_frame which is relatively small and does
|
|
|
|
// include needed unwind information.
|
|
|
|
// See b/132992102 for details.
|
|
|
|
strip: {
|
|
|
|
keep_symbols_and_debug_frame: true,
|
|
|
|
},
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
2015-11-03 23:30:57 +01:00
|
|
|
arm64: {
|
2018-09-07 01:04:08 +02:00
|
|
|
version_script: ":libc.arm64.map",
|
2019-05-18 01:22:56 +02:00
|
|
|
|
|
|
|
// Leave the symbols in the shared library so that stack unwinders can produce
|
|
|
|
// meaningful name resolution.
|
|
|
|
strip: {
|
|
|
|
keep_symbols: true,
|
|
|
|
},
|
2015-11-03 23:30:57 +01:00
|
|
|
},
|
2022-10-17 21:58:22 +02:00
|
|
|
riscv64: {
|
|
|
|
version_script: ":libc.riscv64.map",
|
|
|
|
|
|
|
|
// Leave the symbols in the shared library so that stack unwinders can produce
|
|
|
|
// meaningful name resolution.
|
|
|
|
strip: {
|
|
|
|
keep_symbols: true,
|
|
|
|
},
|
|
|
|
},
|
2015-09-17 01:33:27 +02:00
|
|
|
x86: {
|
2018-09-07 01:04:08 +02:00
|
|
|
// TODO: This is to work around b/24465209. Remove after root cause is fixed.
|
2018-05-24 03:45:53 +02:00
|
|
|
pack_relocations: false,
|
2018-01-19 01:26:19 +01:00
|
|
|
ldflags: ["-Wl,--hash-style=both"],
|
|
|
|
|
2018-09-07 01:04:08 +02:00
|
|
|
version_script: ":libc.x86.map",
|
2021-01-28 02:27:31 +01:00
|
|
|
no_libcrt: true,
|
|
|
|
|
|
|
|
shared: {
|
|
|
|
// For backwards-compatibility, some x86 builtins are exported from libc.so.
|
2022-02-10 20:37:28 +01:00
|
|
|
static_libs: ["libclang_rt.builtins-exported"],
|
2021-01-28 02:27:31 +01:00
|
|
|
},
|
2019-05-18 01:22:56 +02:00
|
|
|
|
|
|
|
// Leave the symbols in the shared library so that stack unwinders can produce
|
|
|
|
// meaningful name resolution.
|
|
|
|
strip: {
|
|
|
|
keep_symbols: true,
|
|
|
|
},
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
|
|
|
x86_64: {
|
2018-09-07 01:04:08 +02:00
|
|
|
version_script: ":libc.x86_64.map",
|
2019-05-18 01:22:56 +02:00
|
|
|
|
|
|
|
// Leave the symbols in the shared library so that stack unwinders can produce
|
|
|
|
// meaningful name resolution.
|
|
|
|
strip: {
|
|
|
|
keep_symbols: true,
|
|
|
|
},
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
|
|
|
},
|
2018-12-13 10:26:48 +01:00
|
|
|
|
2023-03-23 00:12:49 +01:00
|
|
|
apex_available: [
|
|
|
|
"//apex_available:platform",
|
|
|
|
"com.android.runtime",
|
|
|
|
],
|
|
|
|
|
|
|
|
target: {
|
|
|
|
native_bridge: {
|
|
|
|
shared: {
|
|
|
|
installable: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_library {
|
|
|
|
name: "libc",
|
2024-01-19 20:05:36 +01:00
|
|
|
defaults: [
|
2023-03-23 00:12:49 +01:00
|
|
|
"libc_library_defaults",
|
|
|
|
],
|
2018-12-13 10:26:48 +01:00
|
|
|
stubs: {
|
|
|
|
symbol_file: "libc.map.txt",
|
2020-02-27 10:33:25 +01:00
|
|
|
versions: [
|
|
|
|
"29",
|
2020-03-30 06:18:44 +02:00
|
|
|
"R",
|
2020-07-27 22:28:56 +02:00
|
|
|
"current",
|
2020-02-27 10:33:25 +01:00
|
|
|
],
|
2018-12-13 10:26:48 +01:00
|
|
|
},
|
2023-03-23 00:12:49 +01:00
|
|
|
static_ndk_lib: true,
|
2021-03-02 19:23:04 +01:00
|
|
|
llndk: {
|
|
|
|
symbol_file: "libc.map.txt",
|
|
|
|
export_headers_as_system: true,
|
|
|
|
export_preprocessed_headers: ["include"],
|
|
|
|
export_llndk_headers: ["libc_llndk_headers"],
|
|
|
|
},
|
2023-03-23 00:12:49 +01:00
|
|
|
}
|
2019-10-02 10:09:33 +02:00
|
|
|
|
2023-03-23 00:12:49 +01:00
|
|
|
cc_library {
|
|
|
|
name: "libc_hwasan",
|
2024-01-19 20:05:36 +01:00
|
|
|
defaults: [
|
2023-03-23 00:12:49 +01:00
|
|
|
"libc_library_defaults",
|
|
|
|
],
|
|
|
|
sanitize: {
|
|
|
|
hwaddress: true,
|
|
|
|
},
|
|
|
|
enabled: false,
|
2023-04-15 02:38:53 +02:00
|
|
|
target: {
|
|
|
|
android_arm64: {
|
2023-03-23 00:12:49 +01:00
|
|
|
enabled: true,
|
2021-10-28 22:20:35 +02:00
|
|
|
},
|
|
|
|
},
|
2023-03-23 00:12:49 +01:00
|
|
|
stem: "libc",
|
|
|
|
relative_install_path: "hwasan",
|
|
|
|
// We don't really need the stubs, but this needs to stay to trigger the
|
|
|
|
// symlink logic in soong.
|
|
|
|
stubs: {
|
|
|
|
symbol_file: "libc.map.txt",
|
|
|
|
},
|
|
|
|
native_bridge_supported: false,
|
|
|
|
// It is never correct to depend on this directly. This is only
|
|
|
|
// needed for the runtime apex, and in base_system.mk.
|
|
|
|
visibility: ["//bionic/apex"],
|
2015-09-17 01:33:27 +02:00
|
|
|
}
|
|
|
|
|
2018-09-07 01:04:08 +02:00
|
|
|
genrule {
|
|
|
|
name: "libc.arm.map",
|
2023-04-12 00:20:19 +02:00
|
|
|
out: ["libc.arm.map.txt"],
|
2018-09-07 01:04:08 +02:00
|
|
|
srcs: ["libc.map.txt"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["generate-version-script"],
|
|
|
|
cmd: "$(location generate-version-script) arm $(in) $(out)",
|
2018-09-07 01:04:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "libc.arm64.map",
|
2023-04-12 00:20:19 +02:00
|
|
|
out: ["libc.arm64.map.txt"],
|
2018-09-07 01:04:08 +02:00
|
|
|
srcs: ["libc.map.txt"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["generate-version-script"],
|
|
|
|
cmd: "$(location generate-version-script) arm64 $(in) $(out)",
|
2018-09-07 01:04:08 +02:00
|
|
|
}
|
|
|
|
|
2022-10-17 21:58:22 +02:00
|
|
|
genrule {
|
|
|
|
name: "libc.riscv64.map",
|
2023-04-12 00:20:19 +02:00
|
|
|
out: ["libc.riscv64.map.txt"],
|
2022-10-17 21:58:22 +02:00
|
|
|
srcs: ["libc.map.txt"],
|
|
|
|
tools: ["generate-version-script"],
|
|
|
|
cmd: "$(location generate-version-script) riscv64 $(in) $(out)",
|
|
|
|
}
|
|
|
|
|
2018-09-07 01:04:08 +02:00
|
|
|
genrule {
|
|
|
|
name: "libc.x86.map",
|
2023-04-12 00:20:19 +02:00
|
|
|
out: ["libc.x86.map.txt"],
|
2018-09-07 01:04:08 +02:00
|
|
|
srcs: ["libc.map.txt"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["generate-version-script"],
|
|
|
|
cmd: "$(location generate-version-script) x86 $(in) $(out)",
|
2018-09-07 01:04:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "libc.x86_64.map",
|
2023-04-12 00:20:19 +02:00
|
|
|
out: ["libc.x86_64.map.txt"],
|
2018-09-07 01:04:08 +02:00
|
|
|
srcs: ["libc.map.txt"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["generate-version-script"],
|
|
|
|
cmd: "$(location generate-version-script) x86_64 $(in) $(out)",
|
2018-09-07 01:04:08 +02:00
|
|
|
}
|
|
|
|
|
2019-09-12 04:05:29 +02:00
|
|
|
// Headers that only other parts of the platform can include.
|
|
|
|
cc_library_headers {
|
|
|
|
name: "bionic_libc_platform_headers",
|
2020-04-23 17:47:19 +02:00
|
|
|
defaults: ["linux_bionic_supported"],
|
2019-09-12 04:05:29 +02:00
|
|
|
visibility: [
|
2019-09-26 02:50:36 +02:00
|
|
|
"//art:__subpackages__",
|
2019-11-06 22:15:00 +01:00
|
|
|
"//bionic:__subpackages__",
|
2019-09-26 02:50:36 +02:00
|
|
|
"//frameworks:__subpackages__",
|
2020-05-07 23:58:30 +02:00
|
|
|
"//device/generic/goldfish-opengl:__subpackages__",
|
2020-03-25 23:05:48 +01:00
|
|
|
"//external/gwp_asan:__subpackages__",
|
2019-09-12 04:05:29 +02:00
|
|
|
"//external/perfetto:__subpackages__",
|
2019-09-26 02:50:36 +02:00
|
|
|
"//external/scudo:__subpackages__",
|
2019-12-13 22:55:53 +01:00
|
|
|
"//system/core/debuggerd:__subpackages__",
|
2022-09-13 22:58:30 +02:00
|
|
|
"//system/core/init:__subpackages__",
|
2020-10-05 23:55:26 +02:00
|
|
|
"//system/core/libcutils:__subpackages__",
|
2020-01-13 19:39:33 +01:00
|
|
|
"//system/memory/libmemunreachable:__subpackages__",
|
2020-10-15 06:49:00 +02:00
|
|
|
"//system/unwinding/libunwindstack:__subpackages__",
|
2020-05-13 01:02:50 +02:00
|
|
|
"//tools/security/sanitizer-status:__subpackages__",
|
2019-09-12 04:05:29 +02:00
|
|
|
],
|
2020-01-13 19:39:33 +01:00
|
|
|
vendor_available: true,
|
2020-11-11 07:16:11 +01:00
|
|
|
product_available: true,
|
2020-01-22 01:43:56 +01:00
|
|
|
ramdisk_available: true,
|
2020-10-22 03:36:36 +02:00
|
|
|
vendor_ramdisk_available: true,
|
2019-09-26 02:50:36 +02:00
|
|
|
recovery_available: true,
|
|
|
|
native_bridge_supported: true,
|
2019-09-12 04:05:29 +02:00
|
|
|
export_include_dirs: [
|
|
|
|
"platform",
|
|
|
|
],
|
2019-10-02 02:54:42 +02:00
|
|
|
system_shared_libs: [],
|
|
|
|
stl: "none",
|
2019-09-12 04:05:29 +02:00
|
|
|
sdk_version: "current",
|
2020-04-28 11:21:08 +02:00
|
|
|
|
2020-10-05 23:55:26 +02:00
|
|
|
min_sdk_version: "29",
|
2020-04-28 11:21:08 +02:00
|
|
|
apex_available: [
|
|
|
|
"//apex_available:platform",
|
2020-10-05 23:55:26 +02:00
|
|
|
"//apex_available:anyapex",
|
2020-04-28 11:21:08 +02:00
|
|
|
],
|
2019-09-12 04:05:29 +02:00
|
|
|
}
|
|
|
|
|
2019-01-15 14:19:56 +01:00
|
|
|
cc_library_headers {
|
2021-03-02 19:23:04 +01:00
|
|
|
name: "libc_llndk_headers",
|
2021-06-29 20:35:29 +02:00
|
|
|
visibility: [
|
|
|
|
"//external/musl",
|
|
|
|
],
|
2021-03-02 19:23:04 +01:00
|
|
|
llndk: {
|
|
|
|
llndk_headers: true,
|
|
|
|
},
|
2019-01-15 14:19:56 +01:00
|
|
|
host_supported: true,
|
|
|
|
vendor_available: true,
|
2020-11-11 07:16:11 +01:00
|
|
|
product_available: true,
|
2020-01-22 01:43:56 +01:00
|
|
|
ramdisk_available: true,
|
2020-10-22 03:36:36 +02:00
|
|
|
vendor_ramdisk_available: true,
|
2019-01-15 14:19:56 +01:00
|
|
|
recovery_available: true,
|
2019-05-03 15:57:34 +02:00
|
|
|
native_bridge_supported: true,
|
2020-03-07 09:35:02 +01:00
|
|
|
apex_available: [
|
|
|
|
"//apex_available:platform",
|
2020-03-30 11:36:07 +02:00
|
|
|
"//apex_available:anyapex",
|
|
|
|
],
|
2020-04-16 11:26:45 +02:00
|
|
|
// used by most APEXes indirectly via libunwind_llvm
|
|
|
|
min_sdk_version: "apex_inherit",
|
2019-01-15 14:19:56 +01:00
|
|
|
|
|
|
|
no_libcrt: true,
|
|
|
|
stl: "none",
|
|
|
|
system_shared_libs: [],
|
|
|
|
|
2019-12-11 02:41:16 +01:00
|
|
|
// The build system generally requires that any dependencies of a target
|
|
|
|
// with an sdk_version must have a lower sdk_version. By setting sdk_version
|
|
|
|
// to 1 we let targets with an sdk_version that need to depend on the libc
|
|
|
|
// headers but cannot depend on libc itself due to circular dependencies
|
|
|
|
// (such as libunwind_llvm) depend on the headers. Setting sdk_version to 1
|
|
|
|
// is correct because the headers can support any sdk_version.
|
|
|
|
sdk_version: "1",
|
|
|
|
|
2020-04-06 21:32:09 +02:00
|
|
|
export_system_include_dirs: [
|
2019-01-15 14:19:56 +01:00
|
|
|
"kernel/uapi",
|
2020-04-06 21:32:09 +02:00
|
|
|
"kernel/android/scsi",
|
2019-01-15 14:19:56 +01:00
|
|
|
"kernel/android/uapi",
|
|
|
|
],
|
|
|
|
|
|
|
|
arch: {
|
|
|
|
arm: {
|
2020-04-06 21:32:09 +02:00
|
|
|
export_system_include_dirs: ["kernel/uapi/asm-arm"],
|
2019-01-15 14:19:56 +01:00
|
|
|
},
|
|
|
|
arm64: {
|
2020-04-06 21:32:09 +02:00
|
|
|
export_system_include_dirs: ["kernel/uapi/asm-arm64"],
|
2019-01-15 14:19:56 +01:00
|
|
|
},
|
2022-10-07 22:39:25 +02:00
|
|
|
riscv64: {
|
|
|
|
export_system_include_dirs: ["kernel/uapi/asm-riscv"],
|
|
|
|
},
|
2019-01-15 14:19:56 +01:00
|
|
|
x86: {
|
2020-04-06 21:32:09 +02:00
|
|
|
export_system_include_dirs: ["kernel/uapi/asm-x86"],
|
2019-01-15 14:19:56 +01:00
|
|
|
},
|
|
|
|
x86_64: {
|
2020-04-06 21:32:09 +02:00
|
|
|
export_system_include_dirs: ["kernel/uapi/asm-x86"],
|
2019-01-15 14:19:56 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2020-04-06 21:32:09 +02:00
|
|
|
cc_library_headers {
|
|
|
|
name: "libc_headers",
|
|
|
|
host_supported: true,
|
|
|
|
native_bridge_supported: true,
|
|
|
|
vendor_available: true,
|
2020-11-11 07:16:11 +01:00
|
|
|
product_available: true,
|
2020-04-06 21:32:09 +02:00
|
|
|
ramdisk_available: true,
|
2020-10-22 03:36:36 +02:00
|
|
|
vendor_ramdisk_available: true,
|
2020-04-06 21:32:09 +02:00
|
|
|
recovery_available: true,
|
|
|
|
sdk_version: "1",
|
|
|
|
|
|
|
|
apex_available: [
|
|
|
|
"//apex_available:platform",
|
|
|
|
"//apex_available:anyapex",
|
|
|
|
],
|
|
|
|
// used by most APEXes indirectly via libunwind_llvm
|
|
|
|
min_sdk_version: "apex_inherit",
|
|
|
|
visibility: [
|
|
|
|
"//bionic:__subpackages__", // visible to bionic
|
|
|
|
// ... and only to these places (b/152668052)
|
|
|
|
"//external/arm-optimized-routines",
|
|
|
|
"//external/gwp_asan",
|
|
|
|
"//external/jemalloc_new",
|
|
|
|
"//external/libunwind_llvm",
|
|
|
|
"//external/scudo",
|
|
|
|
"//system/core/property_service/libpropertyinfoparser",
|
|
|
|
"//system/extras/toolchain-extras",
|
|
|
|
],
|
|
|
|
|
|
|
|
stl: "none",
|
|
|
|
no_libcrt: true,
|
|
|
|
system_shared_libs: [],
|
|
|
|
|
|
|
|
target: {
|
|
|
|
android: {
|
2021-03-02 19:23:04 +01:00
|
|
|
export_system_include_dirs: ["include"],
|
|
|
|
header_libs: ["libc_llndk_headers"],
|
|
|
|
export_header_lib_headers: ["libc_llndk_headers"],
|
2020-04-06 21:32:09 +02:00
|
|
|
},
|
|
|
|
linux_bionic: {
|
2021-03-02 19:23:04 +01:00
|
|
|
export_system_include_dirs: ["include"],
|
|
|
|
header_libs: ["libc_llndk_headers"],
|
|
|
|
export_header_lib_headers: ["libc_llndk_headers"],
|
2020-04-06 21:32:09 +02:00
|
|
|
},
|
2021-02-16 04:27:05 +01:00
|
|
|
},
|
2020-04-06 21:32:09 +02:00
|
|
|
}
|
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
// ========================================================
|
2018-09-07 01:04:08 +02:00
|
|
|
// libstdc++.so and libstdc++.a.
|
2015-09-17 01:33:27 +02:00
|
|
|
// ========================================================
|
2018-09-07 01:04:08 +02:00
|
|
|
|
2015-09-17 01:33:27 +02:00
|
|
|
cc_library {
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["libc_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
include_dirs: ["bionic/libstdc++/include"],
|
|
|
|
srcs: [
|
|
|
|
"bionic/__cxa_guard.cpp",
|
|
|
|
"bionic/__cxa_pure_virtual.cpp",
|
|
|
|
"bionic/new.cpp",
|
|
|
|
],
|
|
|
|
name: "libstdc++",
|
2017-10-27 20:21:20 +02:00
|
|
|
static_ndk_lib: true,
|
Optimize libc for generic armv7/armv8 neon cores
If (2nd) arch is "arm", (2nd) arch variant is "armv7-a-neon" or
"armv8-a", and (2nd) cpu variant is "generic", current Android.bp only
uses generic ARM assmebly or C code, even though they all have NEON.
This change use functions optimized for cortex-a15 (for these generic
cores), which are a reasonable balance for most ARM cores with Neon.
Also build script for specific armv7/armv8 cores are refactored to
take advantage of the common part (mostly cortex-a15 code), so more
than 150 repeated lines are removed.
Bug: 66064745
Test: For armv7-a-neon/armv8-a "generic" core
- boot with GSI on sailfish
- related cortex-a15 function are built and linked.
All libc.a/libc.so built are identical for the following cores:
- cortex-a7, cortex-a8, cortex-a9, cortex-a15, krait
- cortex-a53, cortex-a53.a57, cortex-a73, denver, kryo
$ lunch aosp_arm64 # with TARGET_2ND_CPU_VARIANT unset
# For each $core listed above
$ TARGET_2ND_CPU_VARIANT=$core m -e -j libc
Change-Id: Ia565d3ea09e034adcd014e7467a5b791cff908cb
2017-09-20 08:44:42 +02:00
|
|
|
static_libs: ["libasync_safe"],
|
2023-07-20 22:24:09 +02:00
|
|
|
apex_available: [
|
|
|
|
"//apex_available:platform",
|
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
|
2018-12-03 22:57:20 +01:00
|
|
|
static: {
|
|
|
|
system_shared_libs: [],
|
|
|
|
},
|
2021-07-14 01:26:28 +02:00
|
|
|
target: {
|
|
|
|
bionic: {
|
|
|
|
shared: {
|
|
|
|
system_shared_libs: ["libc"],
|
|
|
|
},
|
|
|
|
},
|
2018-12-03 22:57:20 +01:00
|
|
|
},
|
|
|
|
|
2018-01-19 01:26:19 +01:00
|
|
|
//TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
|
2015-09-17 01:33:27 +02:00
|
|
|
arch: {
|
|
|
|
arm: {
|
2018-09-07 01:04:08 +02:00
|
|
|
// TODO: This is to work around b/24465209. Remove after root cause is fixed.
|
2018-05-24 03:45:53 +02:00
|
|
|
pack_relocations: false,
|
2018-01-19 01:26:19 +01:00
|
|
|
ldflags: ["-Wl,--hash-style=both"],
|
2018-09-07 01:04:08 +02:00
|
|
|
version_script: ":libstdc++.arm.map",
|
2016-07-28 22:52:17 +02:00
|
|
|
},
|
|
|
|
arm64: {
|
2018-09-07 01:04:08 +02:00
|
|
|
version_script: ":libstdc++.arm64.map",
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
2022-10-17 21:58:22 +02:00
|
|
|
riscv64: {
|
|
|
|
version_script: ":libstdc++.riscv64.map",
|
|
|
|
},
|
2015-09-17 01:33:27 +02:00
|
|
|
x86: {
|
2018-05-24 03:45:53 +02:00
|
|
|
pack_relocations: false,
|
2018-01-19 01:26:19 +01:00
|
|
|
ldflags: ["-Wl,--hash-style=both"],
|
2018-09-07 01:04:08 +02:00
|
|
|
version_script: ":libstdc++.x86.map",
|
2016-07-28 22:52:17 +02:00
|
|
|
},
|
|
|
|
x86_64: {
|
2018-09-07 01:04:08 +02:00
|
|
|
version_script: ":libstdc++.x86_64.map",
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2018-09-07 01:04:08 +02:00
|
|
|
genrule {
|
|
|
|
name: "libstdc++.arm.map",
|
2023-04-12 00:20:19 +02:00
|
|
|
out: ["libstdc++.arm.map.txt"],
|
2018-09-07 01:04:08 +02:00
|
|
|
srcs: ["libstdc++.map.txt"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["generate-version-script"],
|
|
|
|
cmd: "$(location generate-version-script) arm $(in) $(out)",
|
2018-09-07 01:04:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "libstdc++.arm64.map",
|
2023-04-12 00:20:19 +02:00
|
|
|
out: ["libstdc++.arm64.map.txt"],
|
2018-09-07 01:04:08 +02:00
|
|
|
srcs: ["libstdc++.map.txt"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["generate-version-script"],
|
|
|
|
cmd: "$(location generate-version-script) arm64 $(in) $(out)",
|
2018-09-07 01:04:08 +02:00
|
|
|
}
|
|
|
|
|
2022-10-17 21:58:22 +02:00
|
|
|
genrule {
|
|
|
|
name: "libstdc++.riscv64.map",
|
2023-04-12 00:20:19 +02:00
|
|
|
out: ["libstdc++.riscv64.map.txt"],
|
2022-10-17 21:58:22 +02:00
|
|
|
srcs: ["libstdc++.map.txt"],
|
|
|
|
tools: ["generate-version-script"],
|
|
|
|
cmd: "$(location generate-version-script) riscv64 $(in) $(out)",
|
|
|
|
}
|
|
|
|
|
2018-09-07 01:04:08 +02:00
|
|
|
genrule {
|
|
|
|
name: "libstdc++.x86.map",
|
2023-04-12 00:20:19 +02:00
|
|
|
out: ["libstdc++.x86.map.txt"],
|
2018-09-07 01:04:08 +02:00
|
|
|
srcs: ["libstdc++.map.txt"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["generate-version-script"],
|
|
|
|
cmd: "$(location generate-version-script) x86 $(in) $(out)",
|
2018-09-07 01:04:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "libstdc++.x86_64.map",
|
2023-04-12 00:20:19 +02:00
|
|
|
out: ["libstdc++.x86_64.map.txt"],
|
2018-09-07 01:04:08 +02:00
|
|
|
srcs: ["libstdc++.map.txt"],
|
2022-07-01 01:35:11 +02:00
|
|
|
tools: ["generate-version-script"],
|
|
|
|
cmd: "$(location generate-version-script) x86_64 $(in) $(out)",
|
2018-09-07 01:04:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ========================================================
|
|
|
|
// crt object files.
|
|
|
|
// ========================================================
|
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
cc_defaults {
|
2021-06-22 22:25:46 +02:00
|
|
|
name: "crt_and_memtag_defaults",
|
2016-11-29 02:02:25 +01:00
|
|
|
defaults: ["linux_bionic_supported"],
|
2017-04-07 23:09:05 +02:00
|
|
|
vendor_available: true,
|
2020-11-11 07:16:11 +01:00
|
|
|
product_available: true,
|
2020-01-22 01:43:56 +01:00
|
|
|
ramdisk_available: true,
|
2020-10-22 03:36:36 +02:00
|
|
|
vendor_ramdisk_available: true,
|
2018-04-27 14:53:11 +02:00
|
|
|
recovery_available: true,
|
2019-05-03 15:57:34 +02:00
|
|
|
native_bridge_supported: true,
|
2020-03-07 09:35:02 +01:00
|
|
|
apex_available: [
|
|
|
|
"//apex_available:platform",
|
|
|
|
"//apex_available:anyapex",
|
|
|
|
],
|
2020-07-16 02:22:18 +02:00
|
|
|
// Generate NDK variants of the CRT objects for every supported API level.
|
|
|
|
min_sdk_version: "16",
|
|
|
|
stl: "none",
|
|
|
|
crt: true,
|
2018-02-06 02:30:57 +01:00
|
|
|
cflags: [
|
|
|
|
"-Wno-gcc-compat",
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
],
|
2019-09-26 21:16:06 +02:00
|
|
|
sanitize: {
|
|
|
|
never: true,
|
|
|
|
},
|
2015-09-17 01:33:27 +02:00
|
|
|
}
|
|
|
|
|
2021-06-22 22:25:46 +02:00
|
|
|
cc_defaults {
|
|
|
|
name: "crt_defaults",
|
|
|
|
defaults: ["crt_and_memtag_defaults"],
|
2021-07-22 21:02:10 +02:00
|
|
|
system_shared_libs: [],
|
2021-06-22 22:25:46 +02:00
|
|
|
}
|
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
cc_defaults {
|
|
|
|
name: "crt_so_defaults",
|
2017-11-03 21:38:40 +01:00
|
|
|
defaults: ["crt_defaults"],
|
2015-11-01 07:03:05 +01:00
|
|
|
|
|
|
|
arch: {
|
|
|
|
x86: {
|
|
|
|
cflags: ["-fPIC"],
|
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
cflags: ["-fPIC"],
|
|
|
|
},
|
2015-09-17 01:33:27 +02:00
|
|
|
},
|
2018-09-27 20:03:22 +02:00
|
|
|
stl: "none",
|
2015-09-17 01:33:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_object {
|
|
|
|
name: "crtbrand",
|
2017-04-05 00:51:26 +02:00
|
|
|
// crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
|
2021-02-23 06:43:01 +01:00
|
|
|
local_include_dirs: [
|
|
|
|
"include",
|
|
|
|
"private", // crtbrand.S depends on private/bionic_asm_note.h
|
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
product_variables: {
|
|
|
|
platform_sdk_version: {
|
|
|
|
asflags: ["-DPLATFORM_SDK_VERSION=%d"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
srcs: ["arch-common/bionic/crtbrand.S"],
|
|
|
|
|
2017-11-03 21:38:40 +01:00
|
|
|
defaults: ["crt_so_defaults"],
|
2023-04-05 01:27:52 +02:00
|
|
|
// crtbrand is an intermediate artifact, not a final CRT object.
|
|
|
|
exclude_from_ndk_sysroot: true,
|
2015-09-17 01:33:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_object {
|
2021-03-09 21:00:06 +01:00
|
|
|
name: "crtbegin_so",
|
2015-09-17 01:33:27 +02:00
|
|
|
local_include_dirs: ["include"],
|
|
|
|
srcs: ["arch-common/bionic/crtbegin_so.c"],
|
|
|
|
|
2017-11-03 21:38:40 +01:00
|
|
|
defaults: ["crt_so_defaults"],
|
2016-04-11 23:34:18 +02:00
|
|
|
objs: [
|
2015-09-17 01:33:27 +02:00
|
|
|
"crtbrand",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_object {
|
|
|
|
name: "crtend_so",
|
2021-03-15 23:03:24 +01:00
|
|
|
local_include_dirs: [
|
|
|
|
"include",
|
2024-01-19 20:05:36 +01:00
|
|
|
"private", // crtend_so.S depends on private/bionic_asm_arm64.h
|
2021-03-15 23:03:24 +01:00
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
srcs: ["arch-common/bionic/crtend_so.S"],
|
|
|
|
|
2017-11-03 21:38:40 +01:00
|
|
|
defaults: ["crt_so_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_object {
|
2021-03-09 21:00:06 +01:00
|
|
|
name: "crtbegin_static",
|
|
|
|
|
2021-02-19 05:22:03 +01:00
|
|
|
local_include_dirs: [
|
|
|
|
"include",
|
|
|
|
"bionic", // crtbegin.c includes bionic/libc_init_common.h
|
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
|
2024-01-19 20:05:36 +01:00
|
|
|
cflags: ["-DCRTBEGIN_STATIC"],
|
2023-08-24 22:20:23 +02:00
|
|
|
|
2021-03-09 21:00:06 +01:00
|
|
|
srcs: ["arch-common/bionic/crtbegin.c"],
|
2016-04-11 23:34:18 +02:00
|
|
|
objs: [
|
2015-09-17 01:33:27 +02:00
|
|
|
"crtbrand",
|
|
|
|
],
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["crt_defaults"],
|
2021-01-12 15:14:37 +01:00
|
|
|
// When using libc.a, we're using the latest library regardless of target API level.
|
|
|
|
min_sdk_version: "current",
|
2015-09-17 01:33:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_object {
|
2021-03-09 21:00:06 +01:00
|
|
|
name: "crtbegin_dynamic",
|
|
|
|
|
2021-02-19 05:22:03 +01:00
|
|
|
local_include_dirs: [
|
|
|
|
"include",
|
|
|
|
"bionic", // crtbegin.c includes bionic/libc_init_common.h
|
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
srcs: ["arch-common/bionic/crtbegin.c"],
|
2016-04-11 23:34:18 +02:00
|
|
|
objs: [
|
2015-09-17 01:33:27 +02:00
|
|
|
"crtbrand",
|
|
|
|
],
|
2017-09-19 06:28:14 +02:00
|
|
|
target: {
|
|
|
|
linux_bionic: {
|
|
|
|
generated_sources: ["host_bionic_linker_asm"],
|
|
|
|
objs: [
|
|
|
|
"linker_wrapper",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["crt_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_object {
|
|
|
|
// We rename crtend.o to crtend_android.o to avoid a
|
|
|
|
// name clash between gcc and bionic.
|
|
|
|
name: "crtend_android",
|
2021-03-15 23:03:24 +01:00
|
|
|
local_include_dirs: [
|
|
|
|
"include",
|
2024-01-19 20:05:36 +01:00
|
|
|
"private", // crtend.S depends on private/bionic_asm_arm64.h
|
2021-03-15 23:03:24 +01:00
|
|
|
],
|
2015-09-17 01:33:27 +02:00
|
|
|
srcs: ["arch-common/bionic/crtend.S"],
|
|
|
|
|
2015-11-01 07:03:05 +01:00
|
|
|
defaults: ["crt_defaults"],
|
2015-09-17 01:33:27 +02:00
|
|
|
}
|
2016-07-13 20:15:21 +02:00
|
|
|
|
bionic: Add crt_pad_segment
crt_pad_segment provides a note of type NT_ANDROID_TYPE_PAD_SEGMENT.
It's intended when present is for the loader to pad segment gaps to
reduce kernel slab memory usage (due to additional vm_area_struct's
for gaps). crt_pad_segment.o retains control to the static linker so
that app developers can opt out (build with different flags) it there
are undesireable side effects.
Section Headers:
[Nr] Name Type Address Off Size ES Flg Lk Inf Al
[ 0] NULL 0000000000000000 000000 000000 00 0 0 0
[ 1] .strtab STRTAB 0000000000000000 0000f8 000066 00 0 0 1
[ 2] .text PROGBITS 0000000000000000 000040 000000 00 AX 0 0 4
[ 3] .note.GNU-stack PROGBITS 0000000000000000 000040 000000 00 0 0 1
[ 4] .note.android.pad_segment NOTE 0000000000000000 000040 00001c 00 A 0 0 4
[ 5] .rela.note.android.pad_segment RELA 0000000000000000 0000e0 000018 18 I 7 4 8
[ 6] .debug_line PROGBITS 0000000000000000 00005c 000052 00 0 0 1
[ 7] .symtab SYMTAB 0000000000000000 0000b0 000030 18 1 1 8
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
L (link order), O (extra OS processing required), G (group), T (TLS),
C (compressed), x (unknown), o (OS specific), E (exclude),
D (mbind), l (large), p (processor specific)
Bug: 316403210
Test: m -j50 ndk
Test: find out/soong/ndk -name 'crt_pad_segment.o'
Test: readelf -SW crt_pag_segment.o
Change-Id: I94af5e85fd602e7ba5fd56788ae39277368229d8
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-01-09 22:13:50 +01:00
|
|
|
cc_object {
|
|
|
|
name: "crt_pad_segment",
|
|
|
|
local_include_dirs: [
|
|
|
|
"include",
|
2024-01-19 20:05:36 +01:00
|
|
|
"private", // crt_pad_segment.S depends on private/bionic_asm_note.h
|
bionic: Add crt_pad_segment
crt_pad_segment provides a note of type NT_ANDROID_TYPE_PAD_SEGMENT.
It's intended when present is for the loader to pad segment gaps to
reduce kernel slab memory usage (due to additional vm_area_struct's
for gaps). crt_pad_segment.o retains control to the static linker so
that app developers can opt out (build with different flags) it there
are undesireable side effects.
Section Headers:
[Nr] Name Type Address Off Size ES Flg Lk Inf Al
[ 0] NULL 0000000000000000 000000 000000 00 0 0 0
[ 1] .strtab STRTAB 0000000000000000 0000f8 000066 00 0 0 1
[ 2] .text PROGBITS 0000000000000000 000040 000000 00 AX 0 0 4
[ 3] .note.GNU-stack PROGBITS 0000000000000000 000040 000000 00 0 0 1
[ 4] .note.android.pad_segment NOTE 0000000000000000 000040 00001c 00 A 0 0 4
[ 5] .rela.note.android.pad_segment RELA 0000000000000000 0000e0 000018 18 I 7 4 8
[ 6] .debug_line PROGBITS 0000000000000000 00005c 000052 00 0 0 1
[ 7] .symtab SYMTAB 0000000000000000 0000b0 000030 18 1 1 8
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
L (link order), O (extra OS processing required), G (group), T (TLS),
C (compressed), x (unknown), o (OS specific), E (exclude),
D (mbind), l (large), p (processor specific)
Bug: 316403210
Test: m -j50 ndk
Test: find out/soong/ndk -name 'crt_pad_segment.o'
Test: readelf -SW crt_pag_segment.o
Change-Id: I94af5e85fd602e7ba5fd56788ae39277368229d8
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-01-09 22:13:50 +01:00
|
|
|
],
|
|
|
|
srcs: ["arch-common/bionic/crt_pad_segment.S"],
|
|
|
|
|
|
|
|
defaults: ["crt_defaults"],
|
|
|
|
}
|
|
|
|
|
2020-12-15 22:55:32 +01:00
|
|
|
cc_library_static {
|
|
|
|
name: "note_memtag_heap_async",
|
|
|
|
arch: {
|
2024-01-19 20:05:36 +01:00
|
|
|
arm64: {
|
|
|
|
srcs: ["arch-arm64/bionic/note_memtag_heap_async.S"],
|
|
|
|
},
|
2020-12-15 22:55:32 +01:00
|
|
|
},
|
2021-03-04 00:39:57 +01:00
|
|
|
sdk_version: "minimum",
|
2020-12-15 22:55:32 +01:00
|
|
|
|
2021-06-22 22:25:46 +02:00
|
|
|
defaults: ["crt_and_memtag_defaults"],
|
2020-12-15 22:55:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
name: "note_memtag_heap_sync",
|
|
|
|
arch: {
|
2024-01-19 20:05:36 +01:00
|
|
|
arm64: {
|
|
|
|
srcs: ["arch-arm64/bionic/note_memtag_heap_sync.S"],
|
|
|
|
},
|
2020-12-15 22:55:32 +01:00
|
|
|
},
|
2021-03-04 00:39:57 +01:00
|
|
|
sdk_version: "minimum",
|
2020-12-15 22:55:32 +01:00
|
|
|
|
2021-06-22 22:25:46 +02:00
|
|
|
defaults: ["crt_and_memtag_defaults"],
|
2020-12-15 22:55:32 +01:00
|
|
|
}
|
|
|
|
|
2022-12-09 19:49:29 +01:00
|
|
|
// ========================================================
|
|
|
|
// libc dependencies for baremetal Rust projects.
|
|
|
|
// ========================================================
|
|
|
|
|
2022-12-09 20:00:44 +01:00
|
|
|
// This library contains the following unresolved symbols:
|
|
|
|
// __errno
|
|
|
|
// abort
|
|
|
|
// async_safe_fatal_va_list
|
2023-01-03 18:57:42 +01:00
|
|
|
cc_library_static {
|
|
|
|
name: "librust_baremetal",
|
2022-12-09 19:49:29 +01:00
|
|
|
header_libs: ["libc_headers"],
|
|
|
|
include_dirs: [
|
|
|
|
"bionic/libc/async_safe/include",
|
|
|
|
"bionic/libc/platform",
|
|
|
|
],
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
],
|
2022-12-09 20:00:44 +01:00
|
|
|
srcs: [
|
|
|
|
"bionic/fortify.cpp",
|
2022-11-30 15:33:41 +01:00
|
|
|
"bionic/strtol.cpp",
|
2022-12-09 20:00:44 +01:00
|
|
|
],
|
|
|
|
arch: {
|
|
|
|
arm64: {
|
|
|
|
srcs: [
|
|
|
|
"arch-arm64/string/__memcpy_chk.S",
|
|
|
|
],
|
|
|
|
},
|
2023-03-20 09:24:41 +01:00
|
|
|
riscv64: {
|
|
|
|
srcs: [
|
2024-01-19 20:05:36 +01:00
|
|
|
"arch-riscv64/string/__memcpy_chk.S",
|
2023-03-20 09:24:41 +01:00
|
|
|
],
|
|
|
|
},
|
2022-12-09 20:00:44 +01:00
|
|
|
},
|
2022-12-09 19:49:29 +01:00
|
|
|
whole_static_libs: [
|
|
|
|
"libarm-optimized-routines-mem",
|
2023-02-01 14:44:57 +01:00
|
|
|
"libc_netbsd",
|
2022-12-09 19:49:29 +01:00
|
|
|
],
|
2023-01-03 18:57:42 +01:00
|
|
|
system_shared_libs: [],
|
|
|
|
nocrt: true,
|
|
|
|
stl: "none",
|
2022-12-09 19:49:29 +01:00
|
|
|
visibility: [
|
|
|
|
"//packages/modules/Virtualization/vmbase",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2018-09-07 01:04:08 +02:00
|
|
|
// ========================================================
|
|
|
|
// NDK headers.
|
|
|
|
// ========================================================
|
|
|
|
|
2018-05-24 23:56:46 +02:00
|
|
|
versioned_ndk_headers {
|
2017-03-22 23:28:05 +01:00
|
|
|
name: "common_libc",
|
|
|
|
from: "include",
|
|
|
|
to: "",
|
|
|
|
license: "NOTICE",
|
|
|
|
}
|
2016-06-28 20:18:05 +02:00
|
|
|
|
|
|
|
ndk_headers {
|
2016-11-29 20:09:12 +01:00
|
|
|
name: "libc_uapi",
|
|
|
|
from: "kernel/uapi",
|
|
|
|
to: "",
|
|
|
|
srcs: [
|
|
|
|
"kernel/uapi/asm-generic/**/*.h",
|
|
|
|
"kernel/uapi/drm/**/*.h",
|
|
|
|
"kernel/uapi/linux/**/*.h",
|
|
|
|
"kernel/uapi/misc/**/*.h",
|
|
|
|
"kernel/uapi/mtd/**/*.h",
|
|
|
|
"kernel/uapi/rdma/**/*.h",
|
|
|
|
"kernel/uapi/scsi/**/*.h",
|
|
|
|
"kernel/uapi/sound/**/*.h",
|
|
|
|
"kernel/uapi/video/**/*.h",
|
|
|
|
"kernel/uapi/xen/**/*.h",
|
|
|
|
],
|
2016-10-20 10:42:54 +02:00
|
|
|
license: "NOTICE",
|
2016-06-28 20:18:05 +02:00
|
|
|
}
|
|
|
|
|
2016-09-15 02:15:48 +02:00
|
|
|
ndk_headers {
|
2017-04-28 01:26:55 +02:00
|
|
|
name: "libc_kernel_android_uapi_linux",
|
2016-09-15 02:15:48 +02:00
|
|
|
from: "kernel/android/uapi/linux",
|
|
|
|
to: "linux",
|
|
|
|
srcs: ["kernel/android/uapi/linux/**/*.h"],
|
2016-10-20 10:42:54 +02:00
|
|
|
license: "NOTICE",
|
2016-09-15 02:15:48 +02:00
|
|
|
}
|
|
|
|
|
2017-04-28 01:26:55 +02:00
|
|
|
ndk_headers {
|
|
|
|
name: "libc_kernel_android_scsi",
|
2017-05-26 02:13:32 +02:00
|
|
|
from: "kernel/android/scsi/scsi",
|
2017-04-28 01:26:55 +02:00
|
|
|
to: "scsi",
|
|
|
|
srcs: ["kernel/android/scsi/**/*.h"],
|
|
|
|
license: "NOTICE",
|
|
|
|
}
|
|
|
|
|
2016-06-28 20:18:05 +02:00
|
|
|
ndk_headers {
|
|
|
|
name: "libc_asm_arm",
|
|
|
|
from: "kernel/uapi/asm-arm",
|
|
|
|
to: "arm-linux-androideabi",
|
|
|
|
srcs: ["kernel/uapi/asm-arm/**/*.h"],
|
2016-10-20 10:42:54 +02:00
|
|
|
license: "NOTICE",
|
2016-06-28 20:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ndk_headers {
|
|
|
|
name: "libc_asm_arm64",
|
|
|
|
from: "kernel/uapi/asm-arm64",
|
|
|
|
to: "aarch64-linux-android",
|
|
|
|
srcs: ["kernel/uapi/asm-arm64/**/*.h"],
|
2016-10-20 10:42:54 +02:00
|
|
|
license: "NOTICE",
|
2016-06-28 20:18:05 +02:00
|
|
|
}
|
|
|
|
|
2022-10-20 00:03:14 +02:00
|
|
|
ndk_headers {
|
|
|
|
name: "libc_asm_riscv64",
|
|
|
|
from: "kernel/uapi/asm-riscv",
|
|
|
|
to: "riscv64-linux-android",
|
|
|
|
srcs: ["kernel/uapi/asm-riscv/**/*.h"],
|
|
|
|
license: "NOTICE",
|
|
|
|
}
|
|
|
|
|
2016-06-28 20:18:05 +02:00
|
|
|
ndk_headers {
|
|
|
|
name: "libc_asm_x86",
|
|
|
|
from: "kernel/uapi/asm-x86",
|
|
|
|
to: "i686-linux-android",
|
|
|
|
srcs: ["kernel/uapi/asm-x86/**/*.h"],
|
2016-10-20 10:42:54 +02:00
|
|
|
license: "NOTICE",
|
2016-06-28 20:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ndk_headers {
|
|
|
|
name: "libc_asm_x86_64",
|
|
|
|
from: "kernel/uapi/asm-x86",
|
|
|
|
to: "x86_64-linux-android",
|
|
|
|
srcs: ["kernel/uapi/asm-x86/**/*.h"],
|
2016-10-20 10:42:54 +02:00
|
|
|
license: "NOTICE",
|
2016-06-28 20:18:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ndk_library {
|
2017-04-07 23:09:18 +02:00
|
|
|
name: "libc",
|
2016-06-28 20:18:05 +02:00
|
|
|
symbol_file: "libc.map.txt",
|
|
|
|
first_version: "9",
|
2022-09-09 01:41:42 +02:00
|
|
|
export_header_libs: [
|
|
|
|
"common_libc",
|
|
|
|
"libc_uapi",
|
|
|
|
"libc_kernel_android_uapi_linux",
|
|
|
|
"libc_kernel_android_scsi",
|
|
|
|
"libc_asm_arm",
|
|
|
|
"libc_asm_arm64",
|
2022-10-20 00:03:14 +02:00
|
|
|
"libc_asm_riscv64",
|
2022-09-09 01:41:42 +02:00
|
|
|
"libc_asm_x86",
|
|
|
|
"libc_asm_x86_64",
|
|
|
|
],
|
2016-06-28 20:18:05 +02:00
|
|
|
}
|
|
|
|
|
2016-10-07 00:50:41 +02:00
|
|
|
ndk_library {
|
2017-04-07 23:09:18 +02:00
|
|
|
name: "libstdc++",
|
2016-10-07 00:50:41 +02:00
|
|
|
symbol_file: "libstdc++.map.txt",
|
|
|
|
first_version: "9",
|
|
|
|
}
|
|
|
|
|
2018-01-08 23:00:24 +01:00
|
|
|
// Export these headers for toolbox to process
|
|
|
|
filegroup {
|
|
|
|
name: "kernel_input_headers",
|
|
|
|
srcs: [
|
|
|
|
"kernel/uapi/linux/input.h",
|
|
|
|
"kernel/uapi/linux/input-event-codes.h",
|
|
|
|
],
|
|
|
|
}
|
2018-08-04 05:53:28 +02:00
|
|
|
|
|
|
|
// Generate a syscall name / number mapping. These objects are text files
|
|
|
|
// (thanks to the -dD -E flags) and not binary files. They will then be
|
|
|
|
// consumed by the genseccomp.py script and converted into C++ code.
|
|
|
|
cc_defaults {
|
|
|
|
name: "libseccomp_gen_syscall_nrs_defaults",
|
|
|
|
recovery_available: true,
|
|
|
|
srcs: ["seccomp/gen_syscall_nrs.cpp"],
|
|
|
|
cflags: [
|
|
|
|
"-dD",
|
|
|
|
"-E",
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
"-nostdinc",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_object {
|
|
|
|
name: "libseccomp_gen_syscall_nrs_arm",
|
|
|
|
defaults: ["libseccomp_gen_syscall_nrs_defaults"],
|
|
|
|
local_include_dirs: [
|
|
|
|
"kernel/uapi/asm-arm",
|
|
|
|
"kernel/uapi",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_object {
|
|
|
|
name: "libseccomp_gen_syscall_nrs_arm64",
|
|
|
|
defaults: ["libseccomp_gen_syscall_nrs_defaults"],
|
|
|
|
local_include_dirs: [
|
|
|
|
"kernel/uapi/asm-arm64",
|
|
|
|
"kernel/uapi",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2022-10-10 19:06:43 +02:00
|
|
|
cc_object {
|
|
|
|
name: "libseccomp_gen_syscall_nrs_riscv64",
|
|
|
|
defaults: ["libseccomp_gen_syscall_nrs_defaults"],
|
|
|
|
local_include_dirs: [
|
|
|
|
"kernel/uapi/asm-riscv",
|
|
|
|
"kernel/uapi",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2018-08-04 05:53:28 +02:00
|
|
|
cc_object {
|
|
|
|
name: "libseccomp_gen_syscall_nrs_x86",
|
|
|
|
defaults: ["libseccomp_gen_syscall_nrs_defaults"],
|
|
|
|
srcs: ["seccomp/gen_syscall_nrs_x86.cpp"],
|
|
|
|
exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"],
|
|
|
|
local_include_dirs: [
|
|
|
|
"kernel/uapi/asm-x86",
|
|
|
|
"kernel/uapi",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_object {
|
|
|
|
name: "libseccomp_gen_syscall_nrs_x86_64",
|
|
|
|
defaults: ["libseccomp_gen_syscall_nrs_defaults"],
|
|
|
|
srcs: ["seccomp/gen_syscall_nrs_x86_64.cpp"],
|
|
|
|
exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"],
|
|
|
|
local_include_dirs: [
|
|
|
|
"kernel/uapi/asm-x86",
|
|
|
|
"kernel/uapi",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2021-01-29 11:16:32 +01:00
|
|
|
filegroup {
|
|
|
|
name: "all_kernel_uapi_headers",
|
|
|
|
srcs: ["kernel/uapi/**/*.h"],
|
2018-08-04 05:53:28 +02:00
|
|
|
}
|
|
|
|
|
2019-01-02 12:52:51 +01:00
|
|
|
cc_genrule {
|
|
|
|
name: "func_to_syscall_nrs",
|
|
|
|
recovery_available: true,
|
|
|
|
cmd: "$(location genfunctosyscallnrs) --out-dir=$(genDir) $(in)",
|
|
|
|
|
2024-01-19 20:05:36 +01:00
|
|
|
tools: ["genfunctosyscallnrs"],
|
2019-01-02 12:52:51 +01:00
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"SYSCALLS.TXT",
|
|
|
|
],
|
|
|
|
|
2022-10-10 19:06:43 +02:00
|
|
|
arch: {
|
|
|
|
arm: {
|
|
|
|
srcs: [
|
|
|
|
":libseccomp_gen_syscall_nrs_arm",
|
|
|
|
":libseccomp_gen_syscall_nrs_arm64",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
arm64: {
|
|
|
|
srcs: [
|
|
|
|
":libseccomp_gen_syscall_nrs_arm",
|
|
|
|
":libseccomp_gen_syscall_nrs_arm64",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
riscv64: {
|
|
|
|
srcs: [":libseccomp_gen_syscall_nrs_riscv64"],
|
|
|
|
},
|
|
|
|
x86: {
|
|
|
|
srcs: [
|
|
|
|
":libseccomp_gen_syscall_nrs_x86",
|
|
|
|
":libseccomp_gen_syscall_nrs_x86_64",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
srcs: [
|
|
|
|
":libseccomp_gen_syscall_nrs_x86",
|
|
|
|
":libseccomp_gen_syscall_nrs_x86_64",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2019-01-02 12:52:51 +01:00
|
|
|
out: [
|
|
|
|
"func_to_syscall_nrs.h",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2020-06-15 18:29:07 +02:00
|
|
|
// SECCOMP_BLOCKLIST_APP_ZYGOTE.TXT = SECCOMP_BLOCKLIST_APP.txt - setresgid*
|
2019-01-09 16:19:57 +01:00
|
|
|
genrule {
|
2020-06-15 18:29:07 +02:00
|
|
|
name: "generate_app_zygote_blocklist",
|
|
|
|
out: ["SECCOMP_BLOCKLIST_APP_ZYGOTE.TXT"],
|
|
|
|
srcs: ["SECCOMP_BLOCKLIST_APP.TXT"],
|
2019-01-09 16:19:57 +01:00
|
|
|
cmd: "grep -v '^int[ \t]*setresgid' $(in) > $(out)",
|
|
|
|
}
|
|
|
|
|
2022-10-18 01:36:30 +02:00
|
|
|
filegroup {
|
|
|
|
name: "seccomp_syscalls_sources_zygote",
|
2022-10-18 01:36:30 +02:00
|
|
|
srcs: [
|
|
|
|
"SYSCALLS.TXT",
|
|
|
|
"SECCOMP_ALLOWLIST_COMMON.TXT",
|
2022-10-18 05:02:32 +02:00
|
|
|
"SECCOMP_ALLOWLIST_APP.TXT",
|
2022-10-18 01:36:30 +02:00
|
|
|
"SECCOMP_BLOCKLIST_COMMON.TXT",
|
|
|
|
"SECCOMP_PRIORITY.TXT",
|
2022-10-18 05:02:32 +02:00
|
|
|
":generate_app_zygote_blocklist",
|
2022-10-18 01:36:30 +02:00
|
|
|
],
|
2022-10-18 01:36:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
filegroup {
|
|
|
|
name: "seccomp_syscalls_sources_app",
|
|
|
|
srcs: [
|
|
|
|
"SYSCALLS.TXT",
|
|
|
|
"SECCOMP_ALLOWLIST_COMMON.TXT",
|
|
|
|
"SECCOMP_ALLOWLIST_APP.TXT",
|
|
|
|
"SECCOMP_BLOCKLIST_COMMON.TXT",
|
|
|
|
"SECCOMP_BLOCKLIST_APP.TXT",
|
|
|
|
"SECCOMP_PRIORITY.TXT",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
filegroup {
|
|
|
|
name: "seccomp_syscalls_sources_system",
|
|
|
|
srcs: [
|
|
|
|
"SYSCALLS.TXT",
|
|
|
|
"SECCOMP_ALLOWLIST_COMMON.TXT",
|
|
|
|
"SECCOMP_ALLOWLIST_SYSTEM.TXT",
|
|
|
|
"SECCOMP_BLOCKLIST_COMMON.TXT",
|
|
|
|
"SECCOMP_PRIORITY.TXT",
|
|
|
|
],
|
|
|
|
}
|
2022-10-18 01:36:30 +02:00
|
|
|
|
2022-10-18 01:36:30 +02:00
|
|
|
cc_genrule {
|
|
|
|
name: "libseccomp_policy_app_zygote_sources_x86",
|
|
|
|
recovery_available: true,
|
|
|
|
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)",
|
2024-01-19 20:05:36 +01:00
|
|
|
tools: ["genseccomp"],
|
2022-10-18 01:36:30 +02:00
|
|
|
srcs: [
|
|
|
|
":seccomp_syscalls_sources_zygote",
|
|
|
|
":libseccomp_gen_syscall_nrs_x86",
|
|
|
|
":libseccomp_gen_syscall_nrs_x86_64",
|
|
|
|
],
|
|
|
|
out: [
|
|
|
|
"x86_app_zygote_policy.cpp",
|
|
|
|
"x86_64_app_zygote_policy.cpp",
|
|
|
|
],
|
|
|
|
enabled: false,
|
2022-10-18 05:02:32 +02:00
|
|
|
arch: {
|
2024-01-19 20:05:36 +01:00
|
|
|
x86: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
2022-10-18 05:02:32 +02:00
|
|
|
},
|
2022-10-18 01:36:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_genrule {
|
2022-10-18 01:36:30 +02:00
|
|
|
name: "libseccomp_policy_app_zygote_sources_arm",
|
2022-10-18 01:36:30 +02:00
|
|
|
recovery_available: true,
|
2022-10-18 01:36:30 +02:00
|
|
|
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)",
|
2024-01-19 20:05:36 +01:00
|
|
|
tools: ["genseccomp"],
|
2022-10-18 01:36:30 +02:00
|
|
|
srcs: [
|
|
|
|
":seccomp_syscalls_sources_zygote",
|
|
|
|
":libseccomp_gen_syscall_nrs_arm",
|
|
|
|
":libseccomp_gen_syscall_nrs_arm64",
|
|
|
|
],
|
|
|
|
out: [
|
|
|
|
"arm_app_zygote_policy.cpp",
|
|
|
|
"arm64_app_zygote_policy.cpp",
|
|
|
|
],
|
|
|
|
enabled: false,
|
|
|
|
arch: {
|
2024-01-19 20:05:36 +01:00
|
|
|
arm: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
arm64: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
2022-10-18 01:36:30 +02:00
|
|
|
},
|
|
|
|
}
|
2022-10-18 01:36:30 +02:00
|
|
|
|
2022-10-18 01:36:30 +02:00
|
|
|
cc_genrule {
|
|
|
|
name: "libseccomp_policy_app_zygote_sources_riscv64",
|
|
|
|
recovery_available: true,
|
|
|
|
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)",
|
2024-01-19 20:05:36 +01:00
|
|
|
tools: ["genseccomp"],
|
2022-10-18 01:36:30 +02:00
|
|
|
srcs: [
|
|
|
|
":seccomp_syscalls_sources_zygote",
|
|
|
|
":libseccomp_gen_syscall_nrs_riscv64",
|
|
|
|
],
|
|
|
|
out: [
|
|
|
|
"riscv64_app_zygote_policy.cpp",
|
|
|
|
],
|
|
|
|
enabled: false,
|
|
|
|
arch: {
|
2024-01-19 20:05:36 +01:00
|
|
|
riscv64: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
2022-10-18 01:36:30 +02:00
|
|
|
},
|
|
|
|
}
|
2022-10-18 01:36:30 +02:00
|
|
|
|
2022-10-18 01:36:30 +02:00
|
|
|
cc_genrule {
|
|
|
|
name: "libseccomp_policy_app_sources_x86",
|
|
|
|
recovery_available: true,
|
|
|
|
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)",
|
2024-01-19 20:05:36 +01:00
|
|
|
tools: ["genseccomp"],
|
2022-10-18 01:36:30 +02:00
|
|
|
srcs: [
|
2022-10-18 01:36:30 +02:00
|
|
|
":seccomp_syscalls_sources_app",
|
|
|
|
":libseccomp_gen_syscall_nrs_x86",
|
|
|
|
":libseccomp_gen_syscall_nrs_x86_64",
|
|
|
|
],
|
|
|
|
out: [
|
|
|
|
"x86_app_policy.cpp",
|
|
|
|
"x86_64_app_policy.cpp",
|
|
|
|
],
|
|
|
|
enabled: false,
|
|
|
|
arch: {
|
2024-01-19 20:05:36 +01:00
|
|
|
x86: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
2022-10-18 01:36:30 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_genrule {
|
|
|
|
name: "libseccomp_policy_app_sources_arm",
|
|
|
|
recovery_available: true,
|
|
|
|
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)",
|
2024-01-19 20:05:36 +01:00
|
|
|
tools: ["genseccomp"],
|
2022-10-18 01:36:30 +02:00
|
|
|
srcs: [
|
|
|
|
":seccomp_syscalls_sources_app",
|
|
|
|
":libseccomp_gen_syscall_nrs_arm",
|
|
|
|
":libseccomp_gen_syscall_nrs_arm64",
|
|
|
|
],
|
|
|
|
out: [
|
|
|
|
"arm_app_policy.cpp",
|
|
|
|
"arm64_app_policy.cpp",
|
2022-10-18 01:36:30 +02:00
|
|
|
],
|
2022-10-18 01:36:30 +02:00
|
|
|
enabled: false,
|
|
|
|
arch: {
|
2024-01-19 20:05:36 +01:00
|
|
|
arm: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
arm64: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
2022-10-18 01:36:30 +02:00
|
|
|
},
|
|
|
|
}
|
2018-08-04 05:53:28 +02:00
|
|
|
|
2022-10-18 01:36:30 +02:00
|
|
|
cc_genrule {
|
|
|
|
name: "libseccomp_policy_app_sources_riscv64",
|
|
|
|
recovery_available: true,
|
|
|
|
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)",
|
2024-01-19 20:05:36 +01:00
|
|
|
tools: ["genseccomp"],
|
2022-10-18 01:36:30 +02:00
|
|
|
srcs: [
|
|
|
|
":seccomp_syscalls_sources_app",
|
|
|
|
":libseccomp_gen_syscall_nrs_riscv64",
|
|
|
|
],
|
|
|
|
out: [
|
|
|
|
"riscv64_app_policy.cpp",
|
|
|
|
],
|
|
|
|
enabled: false,
|
2022-10-18 05:02:32 +02:00
|
|
|
arch: {
|
2024-01-19 20:05:36 +01:00
|
|
|
riscv64: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
2022-10-18 05:02:32 +02:00
|
|
|
},
|
2022-10-18 01:36:30 +02:00
|
|
|
}
|
2018-08-04 05:53:28 +02:00
|
|
|
|
2022-10-18 01:36:30 +02:00
|
|
|
cc_genrule {
|
2022-10-18 01:36:30 +02:00
|
|
|
name: "libseccomp_policy_system_sources_x86",
|
2022-10-18 01:36:30 +02:00
|
|
|
recovery_available: true,
|
|
|
|
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)",
|
2024-01-19 20:05:36 +01:00
|
|
|
tools: ["genseccomp"],
|
2022-10-18 01:36:30 +02:00
|
|
|
srcs: [
|
|
|
|
":seccomp_syscalls_sources_system",
|
|
|
|
":libseccomp_gen_syscall_nrs_x86",
|
|
|
|
":libseccomp_gen_syscall_nrs_x86_64",
|
|
|
|
],
|
|
|
|
out: [
|
|
|
|
"x86_system_policy.cpp",
|
|
|
|
"x86_64_system_policy.cpp",
|
|
|
|
],
|
|
|
|
enabled: false,
|
|
|
|
arch: {
|
2024-01-19 20:05:36 +01:00
|
|
|
x86: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
2022-10-18 01:36:30 +02:00
|
|
|
},
|
|
|
|
}
|
2018-08-04 05:53:28 +02:00
|
|
|
|
2022-10-18 01:36:30 +02:00
|
|
|
cc_genrule {
|
|
|
|
name: "libseccomp_policy_system_sources_arm",
|
|
|
|
recovery_available: true,
|
|
|
|
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)",
|
2024-01-19 20:05:36 +01:00
|
|
|
tools: ["genseccomp"],
|
2022-10-18 01:36:30 +02:00
|
|
|
srcs: [
|
|
|
|
":seccomp_syscalls_sources_system",
|
|
|
|
":libseccomp_gen_syscall_nrs_arm",
|
|
|
|
":libseccomp_gen_syscall_nrs_arm64",
|
|
|
|
],
|
|
|
|
out: [
|
|
|
|
"arm_system_policy.cpp",
|
|
|
|
"arm64_system_policy.cpp",
|
|
|
|
],
|
|
|
|
enabled: false,
|
|
|
|
arch: {
|
2024-01-19 20:05:36 +01:00
|
|
|
arm: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
arm64: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
2022-10-18 01:36:30 +02:00
|
|
|
},
|
|
|
|
}
|
2022-10-18 05:02:32 +02:00
|
|
|
|
2022-10-18 01:36:30 +02:00
|
|
|
cc_genrule {
|
|
|
|
name: "libseccomp_policy_system_sources_riscv64",
|
|
|
|
recovery_available: true,
|
|
|
|
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)",
|
2024-01-19 20:05:36 +01:00
|
|
|
tools: ["genseccomp"],
|
2018-08-04 05:53:28 +02:00
|
|
|
srcs: [
|
2022-10-18 01:36:30 +02:00
|
|
|
":seccomp_syscalls_sources_system",
|
|
|
|
":libseccomp_gen_syscall_nrs_riscv64",
|
|
|
|
],
|
|
|
|
out: [
|
|
|
|
"riscv64_system_policy.cpp",
|
2018-08-04 05:53:28 +02:00
|
|
|
],
|
2022-10-18 01:36:30 +02:00
|
|
|
enabled: false,
|
|
|
|
arch: {
|
2024-01-19 20:05:36 +01:00
|
|
|
riscv64: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
2022-10-18 01:36:30 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_library {
|
|
|
|
name: "libseccomp_policy",
|
|
|
|
recovery_available: true,
|
|
|
|
generated_headers: ["func_to_syscall_nrs"],
|
2018-08-04 05:53:28 +02:00
|
|
|
|
2022-10-10 19:06:43 +02:00
|
|
|
arch: {
|
|
|
|
arm: {
|
2022-10-18 01:36:30 +02:00
|
|
|
generated_sources: [
|
2024-01-19 20:05:36 +01:00
|
|
|
"libseccomp_policy_app_sources_arm",
|
|
|
|
"libseccomp_policy_app_zygote_sources_arm",
|
|
|
|
"libseccomp_policy_system_sources_arm",
|
2022-10-10 19:06:43 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
arm64: {
|
2022-10-18 01:36:30 +02:00
|
|
|
generated_sources: [
|
2024-01-19 20:05:36 +01:00
|
|
|
"libseccomp_policy_app_sources_arm",
|
|
|
|
"libseccomp_policy_app_zygote_sources_arm",
|
|
|
|
"libseccomp_policy_system_sources_arm",
|
2022-10-10 19:06:43 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
riscv64: {
|
2022-10-18 01:36:30 +02:00
|
|
|
generated_sources: [
|
2024-01-19 20:05:36 +01:00
|
|
|
"libseccomp_policy_app_sources_riscv64",
|
|
|
|
"libseccomp_policy_app_zygote_sources_riscv64",
|
|
|
|
"libseccomp_policy_system_sources_riscv64",
|
2022-10-18 01:36:30 +02:00
|
|
|
],
|
2022-10-10 19:06:43 +02:00
|
|
|
},
|
|
|
|
x86: {
|
2022-10-18 01:36:30 +02:00
|
|
|
generated_sources: [
|
2024-01-19 20:05:36 +01:00
|
|
|
"libseccomp_policy_app_sources_x86",
|
|
|
|
"libseccomp_policy_app_zygote_sources_x86",
|
|
|
|
"libseccomp_policy_system_sources_x86",
|
2022-10-10 19:06:43 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
x86_64: {
|
2022-10-18 01:36:30 +02:00
|
|
|
generated_sources: [
|
2024-01-19 20:05:36 +01:00
|
|
|
"libseccomp_policy_app_sources_x86",
|
|
|
|
"libseccomp_policy_app_zygote_sources_x86",
|
|
|
|
"libseccomp_policy_system_sources_x86",
|
2022-10-10 19:06:43 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2018-08-04 05:53:28 +02:00
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"seccomp/seccomp_policy.cpp",
|
|
|
|
],
|
|
|
|
|
|
|
|
export_include_dirs: ["seccomp/include"],
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
],
|
|
|
|
shared: {
|
|
|
|
shared_libs: ["libbase"],
|
|
|
|
},
|
|
|
|
static: {
|
|
|
|
static_libs: ["libbase"],
|
|
|
|
},
|
|
|
|
}
|
2019-02-28 03:07:55 +01:00
|
|
|
|
2021-09-02 02:26:00 +02:00
|
|
|
cc_library_host_static {
|
|
|
|
name: "libfts",
|
|
|
|
srcs: [
|
|
|
|
"bionic/fts.c",
|
|
|
|
"upstream-openbsd/lib/libc/stdlib/recallocarray.c",
|
|
|
|
],
|
|
|
|
export_include_dirs: ["fts/include"],
|
|
|
|
local_include_dirs: [
|
|
|
|
"private",
|
|
|
|
"upstream-openbsd/android/include",
|
|
|
|
],
|
|
|
|
cflags: [
|
|
|
|
"-include openbsd-compat.h",
|
|
|
|
"-Wno-unused-parameter",
|
|
|
|
],
|
|
|
|
enabled: false,
|
|
|
|
target: {
|
|
|
|
musl: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
},
|
2022-01-13 21:26:30 +01:00
|
|
|
stl: "none",
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_library_host_static {
|
|
|
|
name: "libexecinfo",
|
|
|
|
visibility: ["//external/musl"],
|
|
|
|
srcs: ["bionic/execinfo.cpp"],
|
|
|
|
export_include_dirs: ["execinfo/include"],
|
|
|
|
local_include_dirs: ["private"],
|
|
|
|
enabled: false,
|
|
|
|
target: {
|
|
|
|
musl: {
|
|
|
|
enabled: true,
|
|
|
|
system_shared_libs: [],
|
|
|
|
header_libs: ["libc_musl_headers"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
stl: "none",
|
2021-09-02 02:26:00 +02:00
|
|
|
}
|
|
|
|
|
2022-01-25 03:20:05 +01:00
|
|
|
cc_library_host_static {
|
|
|
|
name: "libb64",
|
|
|
|
visibility: ["//external/musl"],
|
|
|
|
srcs: ["upstream-openbsd/lib/libc/net/base64.c"],
|
|
|
|
export_include_dirs: ["b64/include"],
|
|
|
|
local_include_dirs: [
|
|
|
|
"private",
|
|
|
|
"upstream-openbsd/android/include",
|
|
|
|
],
|
|
|
|
cflags: [
|
|
|
|
"-include openbsd-compat.h",
|
|
|
|
],
|
|
|
|
enabled: false,
|
|
|
|
target: {
|
|
|
|
musl: {
|
|
|
|
enabled: true,
|
|
|
|
system_shared_libs: [],
|
|
|
|
header_libs: ["libc_musl_headers"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
stl: "none",
|
|
|
|
}
|
|
|
|
|
2022-02-03 19:20:32 +01:00
|
|
|
// Export kernel uapi headers to be used in the musl sysroot.
|
|
|
|
// Also include the execinfo headers for the libexecinfo and the
|
|
|
|
// b64 headers for libb64 embedded in musl libc.
|
|
|
|
cc_genrule {
|
|
|
|
name: "libc_musl_sysroot_bionic_headers",
|
|
|
|
visibility: ["//external/musl"],
|
|
|
|
host_supported: true,
|
|
|
|
device_supported: false,
|
|
|
|
enabled: false,
|
|
|
|
target: {
|
|
|
|
musl: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
srcs: [
|
|
|
|
"kernel/uapi/**/*.h",
|
|
|
|
"kernel/android/**/*.h",
|
|
|
|
"execinfo/include/**/*.h",
|
|
|
|
"b64/include/**/*.h",
|
2022-02-08 06:01:26 +01:00
|
|
|
|
|
|
|
"NOTICE",
|
2022-02-03 19:20:32 +01:00
|
|
|
|
|
|
|
":libc_musl_sysroot_bionic_arch_headers",
|
|
|
|
],
|
|
|
|
out: ["libc_musl_sysroot_bionic_headers.zip"],
|
|
|
|
tools: [
|
|
|
|
"soong_zip",
|
|
|
|
"merge_zips",
|
|
|
|
"zip2zip",
|
|
|
|
],
|
2022-02-08 06:01:26 +01:00
|
|
|
cmd: "BIONIC_LIBC_DIR=$$(dirname $(location NOTICE)) && " +
|
|
|
|
"$(location soong_zip) -o $(genDir)/sysroot.zip -symlinks=false" +
|
2022-02-26 03:27:04 +01:00
|
|
|
// NOTICE
|
|
|
|
" -j -f $(location NOTICE) " +
|
2022-02-03 19:20:32 +01:00
|
|
|
// headers
|
|
|
|
" -P include " +
|
2022-02-08 06:01:26 +01:00
|
|
|
" -C $${BIONIC_LIBC_DIR}/kernel/uapi " +
|
|
|
|
" -D $${BIONIC_LIBC_DIR}/kernel/uapi " +
|
|
|
|
" -C $${BIONIC_LIBC_DIR}/kernel/android/scsi " +
|
|
|
|
" -D $${BIONIC_LIBC_DIR}/kernel/android/scsi " +
|
|
|
|
" -C $${BIONIC_LIBC_DIR}/kernel/android/uapi " +
|
|
|
|
" -D $${BIONIC_LIBC_DIR}/kernel/android/uapi " +
|
|
|
|
" -C $${BIONIC_LIBC_DIR}/execinfo/include " +
|
|
|
|
" -D $${BIONIC_LIBC_DIR}/execinfo/include " +
|
|
|
|
" -C $${BIONIC_LIBC_DIR}/b64/include " +
|
|
|
|
" -D $${BIONIC_LIBC_DIR}/b64/include " +
|
2022-02-03 19:20:32 +01:00
|
|
|
" && " +
|
2022-02-26 03:27:04 +01:00
|
|
|
"$(location zip2zip) -i $(genDir)/sysroot.zip -o $(genDir)/sysroot-renamed.zip " +
|
2022-08-11 21:22:26 +02:00
|
|
|
" -x **/BUILD " +
|
2022-02-26 03:27:04 +01:00
|
|
|
" include/**/*:include/ " +
|
|
|
|
" NOTICE:NOTICE.bionic " +
|
|
|
|
" && " +
|
|
|
|
"$(location merge_zips) $(out) $(location :libc_musl_sysroot_bionic_arch_headers) $(genDir)/sysroot-renamed.zip",
|
2022-02-03 19:20:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// The architecture-specific bits have to be handled separately because the label varies based
|
|
|
|
// on architecture, which prevents using $(locations) to find them and requires using $(in)
|
|
|
|
// instead, which would mix in all the other files if this were part of the main libc_musl_sysroot
|
|
|
|
// genrule.
|
|
|
|
cc_genrule {
|
|
|
|
name: "libc_musl_sysroot_bionic_arch_headers",
|
|
|
|
visibility: ["//visibility:private"],
|
|
|
|
host_supported: true,
|
|
|
|
device_supported: false,
|
|
|
|
enabled: false,
|
|
|
|
target: {
|
|
|
|
musl: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
arch: {
|
|
|
|
arm: {
|
|
|
|
srcs: ["kernel/uapi/asm-arm/**/*.h"],
|
|
|
|
},
|
|
|
|
arm64: {
|
|
|
|
srcs: ["kernel/uapi/asm-arm64/**/*.h"],
|
|
|
|
},
|
|
|
|
x86: {
|
|
|
|
srcs: ["kernel/uapi/asm-x86/**/*.h"],
|
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
srcs: ["kernel/uapi/asm-x86/**/*.h"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
out: ["libc_musl_sysroot_bionic_arch_headers.zip"],
|
|
|
|
tools: ["soong_zip"],
|
|
|
|
cmd: "includes=($(in)) && $(location soong_zip) -o $(out) -P include/asm -j -D $$(dirname $${includes[0]})",
|
|
|
|
}
|
2022-10-13 21:51:13 +02:00
|
|
|
|
|
|
|
cc_genrule {
|
|
|
|
name: "bionic_sysroot_crt_objects",
|
|
|
|
visibility: ["//visibility:private"],
|
|
|
|
out: ["bionic_sysroot_crt_objects.zip"],
|
|
|
|
tools: ["soong_zip"],
|
|
|
|
srcs: [
|
|
|
|
":crtbegin_dynamic",
|
|
|
|
":crtbegin_so",
|
|
|
|
":crtbegin_static",
|
|
|
|
":crtend_android",
|
|
|
|
":crtend_so",
|
|
|
|
],
|
|
|
|
cmd: "$(location soong_zip) -o $(out) -j " +
|
|
|
|
"-f $(location :crtbegin_dynamic) " +
|
|
|
|
"-f $(location :crtbegin_so) " +
|
|
|
|
"-f $(location :crtbegin_static) " +
|
|
|
|
"-f $(location :crtend_android) " +
|
|
|
|
"-f $(location :crtend_so)",
|
|
|
|
dist: {
|
|
|
|
targets: ["bionic_sysroot_crt_objects"],
|
|
|
|
},
|
|
|
|
arch: {
|
|
|
|
arm: {
|
|
|
|
dist: {
|
|
|
|
suffix: "_arm",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
arm64: {
|
|
|
|
dist: {
|
|
|
|
suffix: "_arm64",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
riscv64: {
|
|
|
|
dist: {
|
|
|
|
suffix: "_riscv64",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
x86: {
|
|
|
|
dist: {
|
|
|
|
suffix: "_x86",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
dist: {
|
|
|
|
suffix: "_x86_64",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2023-09-28 20:00:12 +02:00
|
|
|
|
|
|
|
// headers that will be placed on the include path when running versioner in bazel
|
|
|
|
// this module should be a no-op in soong
|
|
|
|
filegroup {
|
2024-01-19 20:05:36 +01:00
|
|
|
name: "versioner-dependencies",
|
|
|
|
srcs: ["versioner-dependencies/**/*"],
|
2023-09-28 20:00:12 +02:00
|
|
|
}
|