summaryrefslogtreecommitdiff
path: root/scripts/build/libc/bionic.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build/libc/bionic.sh')
-rw-r--r--scripts/build/libc/bionic.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/build/libc/bionic.sh b/scripts/build/libc/bionic.sh
index 027493d..93dcea0 100644
--- a/scripts/build/libc/bionic.sh
+++ b/scripts/build/libc/bionic.sh
@@ -26,6 +26,12 @@ do_libc() {
fi
CT_DoStep INFO "Installing C library binaries"
CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/android-ndk/platforms/android-${CT_ANDROID_API}/arch-${arch}/usr" "${CT_SYSROOT_DIR}"
+
+ # NB: Modifying CT_TARGET_CFLAGS here, not CT_ALL_TARGET_CFLAGS: the __ANDROID_API__
+ # definition needs to be passed into GCC build, or the resulting libstdc++ gets
+ # miscompiled (attempt to link against it results in unresolved symbols to stdout/...).
+ # And since __ANDROID_API__ is a user config option, placing it with other user-supplied
+ # options isn't completely out of character.
CT_EnvModify CT_TARGET_CFLAGS "${CT_TARGET_CFLAGS} -D__ANDROID_API__=${CT_ANDROID_API}"
}