aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2015-01-09 15:34:31 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2015-01-09 15:34:52 +0800
commitdf73c1fc563e2d9d17bbbe05e9aed4e8b148f497 (patch)
tree5d3ee2dd02179228645a56a010a550f1876d9371 /build
parent13a99c7f71379070c19d366f803d7fd17041a728 (diff)
downloadndk-df73c1fc563e2d9d17bbbe05e9aed4e8b148f497.tar.gz
Fix NDK build called from top-level script rebuild-all-prebuilt.sh
Change-Id: I49c03b691eadfbcf4bc98865ac2077964c259c1f
Diffstat (limited to 'build')
-rwxr-xr-xbuild/tools/build-gnu-libstdc++.sh12
-rwxr-xr-xbuild/tools/build-target-prebuilts.sh10
-rw-r--r--build/tools/builder-funcs.sh2
3 files changed, 12 insertions, 12 deletions
diff --git a/build/tools/build-gnu-libstdc++.sh b/build/tools/build-gnu-libstdc++.sh
index 1c2d5bf49..90c8ee214 100755
--- a/build/tools/build-gnu-libstdc++.sh
+++ b/build/tools/build-gnu-libstdc++.sh
@@ -168,9 +168,11 @@ build_gnustl_for_abi ()
exit 1
fi
- EXTRA_FLAGS="-ffunction-sections -fdata-sections"
+ EXTRA_CFLAGS="-ffunction-sections -fdata-sections"
+ EXTRA_LDFLAGS=
if [ -n "$THUMB" ] ; then
- EXTRA_FLAGS="$EXTRA_FLAGS -mthumb"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -mthumb"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -mthumb"
fi
case $ARCH in
@@ -194,8 +196,8 @@ build_gnustl_for_abi ()
;;
esac
- CFLAGS="-fPIC $CFLAGS --sysroot=$SYSROOT -fexceptions -funwind-tables -D__BIONIC__ -O2 $EXTRA_FLAGS"
- CXXFLAGS="-fPIC $CXXFLAGS --sysroot=$SYSROOT -fexceptions -frtti -funwind-tables -D__BIONIC__ -O2 $EXTRA_FLAGS"
+ CFLAGS="-fPIC $CFLAGS --sysroot=$SYSROOT -fexceptions -funwind-tables -D__BIONIC__ -O2 $EXTRA_CFLAGS"
+ CXXFLAGS="-fPIC $CXXFLAGS --sysroot=$SYSROOT -fexceptions -frtti -funwind-tables -D__BIONIC__ -O2 $EXTRA_CFLAGS"
CPPFLAGS="$CPPFLAGS --sysroot=$SYSROOT"
if [ "$WITH_DEBUG_INFO" ]; then
CFLAGS="$CFLAGS -g"
@@ -213,7 +215,7 @@ build_gnustl_for_abi ()
setup_ccache
- export LDFLAGS="-lc $EXTRA_FLAGS"
+ export LDFLAGS="-lc $EXTRA_LDFLAGS"
case $ABI in
armeabi-v7a|armeabi-v7a-hard)
diff --git a/build/tools/build-target-prebuilts.sh b/build/tools/build-target-prebuilts.sh
index d75cb0656..57d0f9241 100755
--- a/build/tools/build-target-prebuilts.sh
+++ b/build/tools/build-target-prebuilts.sh
@@ -69,7 +69,7 @@ fi
if [ ! -z "$LLVM_VERSION" ]; then
BUILD_TOOLCHAIN="--llvm-version=$LLVM_VERSION"
-else
+elif [ ! -z "$GCC_VERSION" ]; then
BUILD_TOOLCHAIN="--gcc-version=$GCC_VERSION"
fi
@@ -90,7 +90,7 @@ fi
if [ -z "$NO_GEN_PLATFORMS" ]; then
echo "Preparing the build..."
PLATFORMS_BUILD_TOOLCHAIN=
- if [ "$GCC_VERSION" != "default" ]; then
+ if [ ! -z "$GCC_VERSION" ]; then
PLATFORMS_BUILD_TOOLCHAIN="--gcc-version=$GCC_VERSION"
fi
run $BUILDTOOLS/gen-platforms.sh --samples --fast-copy --dst-dir=$NDK_DIR --ndk-dir=$NDK_DIR --arch=$(spaces_to_commas $ARCHS) $PACKAGE_FLAGS $PLATFORMS_BUILD_TOOLCHAIN
@@ -133,9 +133,9 @@ fi
# First, gdbserver
for ARCH in $ARCHS; do
- if [ "$GCC_VERSION" = "default" ]; then
+ if [ -z "$GCC_VERSION" ]; then
GDB_TOOLCHAIN=$(get_default_toolchain_name_for_arch $ARCH)
- elif [ ! -z "$GCC_VERSION" ]; then
+ else
GDB_TOOLCHAIN=$(get_toolchain_name_for_arch $ARCH $GCC_VERSION)
fi
GDB_VERSION="--gdb-version="$(get_default_gdb_version_for_gcc $GDB_TOOLCHAIN)
@@ -185,8 +185,6 @@ if [ ! -z "$GCC_VERSION_LIST" ]; then
STDCXX_GCC_VERSIONS="--gcc-version-list=$GCC_VERSION_LIST"
fi
dump "Building $ABIS gnustl binaries..."
- run $BUILDTOOLS/build-gnu-libstdc++.sh --abis="$ABIS" $FLAGS $GNUSTL_STATIC_VIS_FLAG "$SRC_DIR" $STDCXX_GCC_VERSIONS
- fail_panic "Could not build gnustl!"
run $BUILDTOOLS/build-gnu-libstdc++.sh --abis="$ABIS" $FLAGS $GNUSTL_STATIC_VIS_FLAG "$SRC_DIR" --with-debug-info $STDCXX_GCC_VERSIONS
fail_panic "Could not build gnustl with debug info!"
fi
diff --git a/build/tools/builder-funcs.sh b/build/tools/builder-funcs.sh
index 273cfdbe7..0ef54a02f 100644
--- a/build/tools/builder-funcs.sh
+++ b/build/tools/builder-funcs.sh
@@ -615,6 +615,7 @@ builder_begin_android ()
;;
esac
SCRATCH_FLAGS="-target $LLVM_TRIPLE $FLAGS"
+ builder_ldflags "$SCRATCH_FLAGS"
if [ "$LLVM_VERSION" \> "3.4" ]; then
# Turn off integrated-as for clang >= 3.5 due to ill-formed object it produces
# involving inline-assembly .pushsection/.popsection which crashes ld.gold
@@ -623,7 +624,6 @@ builder_begin_android ()
fi
builder_cflags "$SCRATCH_FLAGS"
builder_cxxflags "$SCRATCH_FLAGS"
- builder_ldflags "$SCRATCH_FLAGS"
if [ ! -z $GCC_TOOLCHAIN ]; then
SCRATCH_FLAGS="-gcc-toolchain $GCC_TOOLCHAIN"
builder_cflags "$SCRATCH_FLAGS"