summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/libc/bionic.sh8
-rw-r--r--scripts/build/libc/newlib.sh2
2 files changed, 8 insertions, 2 deletions
diff --git a/scripts/build/libc/bionic.sh b/scripts/build/libc/bionic.sh
index 573b8d4..93dcea0 100644
--- a/scripts/build/libc/bionic.sh
+++ b/scripts/build/libc/bionic.sh
@@ -26,7 +26,13 @@ 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}"
- CT_EnvModify CT_ALL_TARGET_CFLAGS "${CT_ALL_TARGET_CFLAGS} -D__ANDROID_API__=${CT_ANDROID_API}"
+
+ # 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}"
}
do_libc_post_cc() {
diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
index 9a9e04e..6449d68 100644
--- a/scripts/build/libc/newlib.sh
+++ b/scripts/build/libc/newlib.sh
@@ -38,7 +38,7 @@ do_libc() {
# Multilib is the default, so if it is not enabled, disable it.
if [ "${CT_MULTILIB}" != "y" ]; then
- extra_config+=("--disable-multilib")
+ newlib_opts+=("--disable-multilib")
fi
if [ "${CT_LIBC_NEWLIB_IO_FLOAT}" = "y" ]; then