summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-06-26 03:09:01 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-06-26 03:09:01 +0000
commit3287b8d6f03f97b18b7c7ec9ff7c0c61d3fba9fe (patch)
treee4e192a00cdd1a33815a765f6b212069222e9d84
parentbe514cb4014d92376c2eaa48d8138800c50725bf (diff)
parentb98bc39d9f3d44fc2910c0bdd16ba1933cab282d (diff)
downloadextras-3287b8d6f03f97b18b7c7ec9ff7c0c61d3fba9fe.tar.gz
Snap for 7495277 from b98bc39d9f3d44fc2910c0bdd16ba1933cab282d to sc-d1-release
Change-Id: I851200259217102355077352e47525dd4d27e2c5
-rw-r--r--ext4_utils/Android.bp1
-rw-r--r--libfec/Android.bp1
-rw-r--r--libfscrypt/Android.bp1
-rw-r--r--squashfs_utils/Android.bp1
-rw-r--r--toolchain-extras/Android.bp3
-rw-r--r--toolchain-extras/profile-clang-extras.cpp21
6 files changed, 11 insertions, 17 deletions
diff --git a/ext4_utils/Android.bp b/ext4_utils/Android.bp
index 10aa765f..80f70b9a 100644
--- a/ext4_utils/Android.bp
+++ b/ext4_utils/Android.bp
@@ -20,6 +20,7 @@ license {
cc_library {
name: "libext4_utils",
host_supported: true,
+ ramdisk_available: true,
recovery_available: true,
srcs: [
"ext4_utils.cpp",
diff --git a/libfec/Android.bp b/libfec/Android.bp
index 6bd44dd9..0b464b01 100644
--- a/libfec/Android.bp
+++ b/libfec/Android.bp
@@ -70,6 +70,7 @@ cc_library {
name: "libfec",
defaults: ["libfec_default"],
host_supported: true,
+ ramdisk_available: true,
recovery_available: true,
target: {
diff --git a/libfscrypt/Android.bp b/libfscrypt/Android.bp
index afdc7f4e..343ccef3 100644
--- a/libfscrypt/Android.bp
+++ b/libfscrypt/Android.bp
@@ -19,6 +19,7 @@ license {
cc_library {
name: "libfscrypt",
+ ramdisk_available: true,
recovery_available: true,
srcs: [
"fscrypt.cpp",
diff --git a/squashfs_utils/Android.bp b/squashfs_utils/Android.bp
index 4a6fb5fa..b2d493b7 100644
--- a/squashfs_utils/Android.bp
+++ b/squashfs_utils/Android.bp
@@ -21,6 +21,7 @@ cc_library {
name: "libsquashfs_utils",
cflags: ["-Werror"],
host_supported: true,
+ ramdisk_available: true,
recovery_available: true,
srcs: [
"squashfs_utils.c",
diff --git a/toolchain-extras/Android.bp b/toolchain-extras/Android.bp
index 007817ec..220f3e34 100644
--- a/toolchain-extras/Android.bp
+++ b/toolchain-extras/Android.bp
@@ -129,11 +129,10 @@ cc_test {
srcs: [
"profile-clang-extras-test.cpp",
],
- static_libs: [
+ whole_static_libs: [
"libprofile-clang-extras",
],
ldflags: [
- "-uinit_profile_extras",
"-Wl,--wrap,open",
],
native_coverage: false,
diff --git a/toolchain-extras/profile-clang-extras.cpp b/toolchain-extras/profile-clang-extras.cpp
index 89c18b2a..bb713e18 100644
--- a/toolchain-extras/profile-clang-extras.cpp
+++ b/toolchain-extras/profile-clang-extras.cpp
@@ -36,24 +36,15 @@ static void llvm_signal_handler(__unused int signum) {
}
}
-__attribute__((weak)) int init_profile_extras_once = 0;
-
// Initialize libprofile-extras:
-// - Install a signal handler that triggers __llvm_profile_write_file on <COVERAGE_FLUSH_SIGNAL>.
-//
-// We want this initializer to run during load time.
//
-// Just marking init_profile_extras() with __attribute__((constructor)) isn't
-// enough since the linker drops it from its output since no other symbol from
-// this static library is referenced.
+// - Install a signal handler that triggers __llvm_profile_write_file on
+// <COVERAGE_FLUSH_SIGNAL>.
//
-// We force the linker to include init_profile_extras() by passing
-// '-uinit_profile_extras' to the linker (in build/soong).
-__attribute__((constructor)) int init_profile_extras(void) {
- if (init_profile_extras_once)
- return 0;
- init_profile_extras_once = 1;
-
+// We want this initializer to run during load time. In addition to marking
+// this function as a constructor, we link this library with `--whole-archive`
+// to force this function to be included in the output.
+static __attribute__((constructor)) int init_profile_extras(void) {
if (chained_signal_handler != SIG_ERR) {
return -1;
}