diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2014-12-09 17:06:35 +0800 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2014-12-09 17:06:35 +0800 |
commit | 4a93ce816ac39e769d245bbc9b89f0839dba3c6a (patch) | |
tree | 94e791b4600839b48fbc8e9151728c49ebea3141 /build | |
parent | 49ec1d317bab03f493c717e28f8f2019c649d518 (diff) | |
download | ndk-4a93ce816ac39e769d245bbc9b89f0839dba3c6a.tar.gz |
Add mipsr6
This is internal-only ABI for -mips32r6 enough to generate
mips32r6 STL libraries in prebuilts/ndk. "mips" (r1) remains the
only supported 32-bit ABI for MIPS
Change-Id: I2ede51fccd57680d1405749da80ad837e2816795
Diffstat (limited to 'build')
-rwxr-xr-x | build/tools/build-compiler-rt.sh | 2 | ||||
-rwxr-xr-x | build/tools/build-cxx-stl.sh | 11 | ||||
-rwxr-xr-x | build/tools/build-device-llvm.sh | 2 | ||||
-rwxr-xr-x | build/tools/build-gcc.sh | 2 | ||||
-rwxr-xr-x | build/tools/build-gnu-libstdc++.sh | 4 | ||||
-rwxr-xr-x | build/tools/build-llvm.sh | 2 | ||||
-rwxr-xr-x | build/tools/build-target-prebuilts.sh | 2 | ||||
-rw-r--r-- | build/tools/builder-funcs.sh | 4 | ||||
-rw-r--r-- | build/tools/dev-defaults.sh | 5 | ||||
-rwxr-xr-x | build/tools/make-standalone-toolchain.sh | 2 | ||||
-rw-r--r-- | build/tools/prebuilt-common.sh | 29 | ||||
-rw-r--r-- | build/tools/toolchain-patches/gcc/0010-Fix-PR-target-63209.patch | 2 |
12 files changed, 46 insertions, 21 deletions
diff --git a/build/tools/build-compiler-rt.sh b/build/tools/build-compiler-rt.sh index af630757d..27eeceb32 100755 --- a/build/tools/build-compiler-rt.sh +++ b/build/tools/build-compiler-rt.sh @@ -178,7 +178,7 @@ prepare_compiler_rt_source_for_abi () ARCH_SOURCES="$COMPILER_RT_ARM_SOURCES" elif [ $ABI == "x86" ]; then ARCH_SOURCES="$COMPILER_RT_X86_SOURCES" - elif [ $ABI == "mips" ]; then + elif [ $ABI == "mips" -o $ABI == "mipsr6"]; then ARCH_SOURCES="$COMPILER_RT_MIPS_SOURCES" elif [ $ABI == "x86_64" ]; then ARCH_SOURCES="$COMPILER_RT_X86_64_SOURCES" diff --git a/build/tools/build-cxx-stl.sh b/build/tools/build-cxx-stl.sh index 8a512006e..fe0d65e55 100755 --- a/build/tools/build-cxx-stl.sh +++ b/build/tools/build-cxx-stl.sh @@ -99,7 +99,7 @@ fi ABIS=$(commas_to_spaces $ABIS) UNKNOWN_ABIS= if [ "$ABIS" = "${ABIS%%64*}" ]; then - UNKNOWN_ABIS="$(filter_out "$PREBUILT_ABIS" "$ABIS" )" + UNKNOWN_ABIS="$(filter_out "$PREBUILT_ABIS mipsr6" "$ABIS" )" if [ -n "$UNKNOWN_ABIS" ] && [ -n "$(find_ndk_unknown_archs)" ]; then ABIS="$(filter_out "$UNKNOWN_ABIS" "$ABIS")" ABIS="$ABIS $(find_ndk_unknown_archs)" @@ -537,6 +537,11 @@ build_stl_libs_for_abi () EXTRA_CFLAGS="-mfix-cortex-a53-835769" EXTRA_CXXFLAGS="-mfix-cortex-a53-835769" ;; + mipsr6) + EXTRA_CFLAGS="-mips32r6" + EXTRA_CXXFLAGS="-mips32r6" + EXTRA_LDFLAGS="-mips32r6" + ;; esac if [ -n "$THUMB" ]; then @@ -654,12 +659,12 @@ build_stl_libs_for_abi () } for ABI in $ABIS; do - build_stl_libs_for_abi $ABI "$BUILD_DIR/$ABI/shared" "shared" "$OUT_DIR" build_stl_libs_for_abi $ABI "$BUILD_DIR/$ABI/static" "static" "$OUT_DIR" + build_stl_libs_for_abi $ABI "$BUILD_DIR/$ABI/shared" "shared" "$OUT_DIR" # build thumb version of libraries for 32-bit arm if [ "$ABI" != "${ABI%%arm*}" -a "$ABI" = "${ABI%%64*}" ] ; then - build_stl_libs_for_abi $ABI "$BUILD_DIR/$ABI/shared" "shared" "$OUT_DIR" thumb build_stl_libs_for_abi $ABI "$BUILD_DIR/$ABI/static" "static" "$OUT_DIR" thumb + build_stl_libs_for_abi $ABI "$BUILD_DIR/$ABI/shared" "shared" "$OUT_DIR" thumb fi done diff --git a/build/tools/build-device-llvm.sh b/build/tools/build-device-llvm.sh index 8c341e12e..f1f0a9d15 100755 --- a/build/tools/build-device-llvm.sh +++ b/build/tools/build-device-llvm.sh @@ -175,7 +175,7 @@ for abi in $ABIS; do CFLAGS=$CFLAGS" -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -Wl,--no-warn-mismatch -lm_hard" fi ;; - mips) + mips|mipsr6) CFLAGS=$CFLAGS" -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers" ;; esac diff --git a/build/tools/build-gcc.sh b/build/tools/build-gcc.sh index 1339e8b81..4664c615a 100755 --- a/build/tools/build-gcc.sh +++ b/build/tools/build-gcc.sh @@ -466,7 +466,7 @@ unwind_library_for_abi () pr-support.o \ unwind-c.o" ;; - x86|mips) + x86|mips|mipsr6) BASE_DIR="$BUILD_OUT/gcc-$CONFIGURE_GCC_VERSION/$ABI_CONFIGURE_TARGET/libgcc/" if [ "$GCC_VERSION" = "4.6" -o "$GCC_VERSION" = "4.4.3" ]; then OBJS="unwind-c.o \ diff --git a/build/tools/build-gnu-libstdc++.sh b/build/tools/build-gnu-libstdc++.sh index 9cb237c83..f89f1d903 100755 --- a/build/tools/build-gnu-libstdc++.sh +++ b/build/tools/build-gnu-libstdc++.sh @@ -343,7 +343,7 @@ copy_gnustl_libs () LDIR=lib if [ "$ARCH" != "${ARCH%%64*}" ]; then - #Can't call $(get_default_libdir_for_arch $ARCH) which contain hack for arm64 and mips64 + #Can't call $(get_default_libdir_for_arch $ARCH) which contain hack for arm64 LDIR=lib64 fi @@ -443,7 +443,7 @@ if [ -n "$PACKAGE_DIR" ] ; then lib64/libsupc++.a lib64/libgnustl_static.a lib64/libgnustl_shared.so lib64r2/libsupc++.a lib64r2/libgnustl_static.a lib64r2/libgnustl_shared.so" ;; - mips) + mips|mipsr6) if [ "$VERSION" == "4.9" ]; then MULTILIB="include/mips-r2/bits include/mips-r6/bits include/bits lib/libsupc++.a lib/libgnustl_static.a lib/libgnustl_shared.so diff --git a/build/tools/build-llvm.sh b/build/tools/build-llvm.sh index 3a4c40314..53a5cf813 100755 --- a/build/tools/build-llvm.sh +++ b/build/tools/build-llvm.sh @@ -497,7 +497,7 @@ for ABI in $ABIS; do x86_64) LLVM_TARGET=x86_64-none-linux-android ;; - mips) + mips|mipsr6) LLVM_TARGET=mipsel-none-linux-android ;; mips64) diff --git a/build/tools/build-target-prebuilts.sh b/build/tools/build-target-prebuilts.sh index 31e71b6ed..db25bdf38 100755 --- a/build/tools/build-target-prebuilts.sh +++ b/build/tools/build-target-prebuilts.sh @@ -169,7 +169,7 @@ fail_panic "Could not build libc++ with libc++abi and debug info!" # workaround issues in libc++/libc++abi for x86 and mips for abi in $ABIS; do case $abi in - x86|x86_64|mips|mips64) + x86|x86_64|mips|mipsr6|mips64) dump "Rebuilding $abi libc++ binaries... with gabi++" run $BUILDTOOLS/build-cxx-stl.sh --stl=libc++-gabi++ --abis=$abi $FLAGS --with-debug-info $BUILD_TOOLCHAIN esac diff --git a/build/tools/builder-funcs.sh b/build/tools/builder-funcs.sh index 340cc6d0f..15f711ba4 100644 --- a/build/tools/builder-funcs.sh +++ b/build/tools/builder-funcs.sh @@ -562,7 +562,7 @@ builder_begin_android () else SYSROOT=$NDK_DIR/platforms/$PLATFORM/arch-$ARCH fi - LDIR=$SYSROOT"/usr/"$(get_default_libdir_for_arch $ARCH) + LDIR=$SYSROOT"/usr/"$(get_default_libdir_for_abi $ABI) CRTBEGIN_EXE_O=$LDIR/crtbegin_dynamic.o CRTEND_EXE_O=$LDIR/crtend_android.o @@ -598,7 +598,7 @@ builder_begin_android () x86_64) LLVM_TRIPLE=x86_64-none-linux-android ;; - mips) + mips|mipsr6) LLVM_TRIPLE=mipsel-none-linux-android ;; mips64) diff --git a/build/tools/dev-defaults.sh b/build/tools/dev-defaults.sh index 8078e3f84..cf034bca8 100644 --- a/build/tools/dev-defaults.sh +++ b/build/tools/dev-defaults.sh @@ -150,6 +150,9 @@ get_default_abi_for_arch () x86|x86_64|mips|mips64) RET="$1" ;; + mipsr6) + RET="mips" + ;; *) 2> echo "ERROR: Unsupported architecture name: $1, use one of: arm arm64 x86 x86_64 mips mips64" exit 1 @@ -172,7 +175,7 @@ get_default_abis_for_arch () arm64) RET="arm64-v8a" ;; - x86|x86_64|mips|mips64) + x86|x86_64|mips|mipsr6|mips64) RET="$1" ;; *) diff --git a/build/tools/make-standalone-toolchain.sh b/build/tools/make-standalone-toolchain.sh index 4919944c4..a06371c8e 100755 --- a/build/tools/make-standalone-toolchain.sh +++ b/build/tools/make-standalone-toolchain.sh @@ -714,7 +714,7 @@ copy_stl_libs_for_abi () { copy_stl_libs "$ABI" fi ;; - mips) + mips|mipsr6) if [ "$STL" = "gnustl" -a "$GCC_VERSION" = "4.9" ]; then copy_stl_libs mips "bits" "bits" "../lib" "lib" copy_stl_libs mips "mips-r2/bits" "mips-r2/bits" "../libr2" "libr2" diff --git a/build/tools/prebuilt-common.sh b/build/tools/prebuilt-common.sh index 0f675fbba..210acefe7 100644 --- a/build/tools/prebuilt-common.sh +++ b/build/tools/prebuilt-common.sh @@ -1327,6 +1327,9 @@ convert_abi_to_arch () x86|mips|x86_64|mips64) RET=$ABI ;; + mipsr6) + RET=mips + ;; arm64-v8a) RET=arm64 ;; @@ -1466,6 +1469,14 @@ get_default_platform_sysroot_for_arch () echo "platforms/android-$LEVEL/arch-$ARCH" } +# Return the default platform sysroot corresponding to a given abi +# $1: ABI +get_default_platform_sysroot_for_abi () +{ + local ARCH=$(convert_abi_to_arch $1) + $(get_default_platform_sysroot_for_arch $ARCH) +} + # Return the default libs dir corresponding to a given architecture # $1: Architecture name get_default_libdir_for_arch () @@ -1477,14 +1488,20 @@ get_default_libdir_for_arch () esac } -# Guess what? -get_default_platform_sysroot_for_abi () +# Return the default libs dir corresponding to a given abi +# $1: ABI +get_default_libdir_for_abi () { - local ARCH=$(convert_abi_to_arch $1) - $(get_default_platform_sysroot_for_arch $ARCH) -} - + local ARCH + case $1 in + mipsr6) echo "libr6" ;; + *) + local ARCH=$(convert_abi_to_arch $1) + $(get_default_libdir_for_arch $ARCH) + ;; + esac +} # Return the host/build specific path for prebuilt toolchain binaries # relative to $1. diff --git a/build/tools/toolchain-patches/gcc/0010-Fix-PR-target-63209.patch b/build/tools/toolchain-patches/gcc/0010-Fix-PR-target-63209.patch index 6cd48a336..5d04e1e1a 100644 --- a/build/tools/toolchain-patches/gcc/0010-Fix-PR-target-63209.patch +++ b/build/tools/toolchain-patches/gcc/0010-Fix-PR-target-63209.patch @@ -63,7 +63,7 @@ index 51626c3..1a04681 100644 + 2014-10-29 Kyrylo Tkachov <kyrylo.tkachov@arm.com> - PR tree-optimization/63530 + * gcc.target/aarch64/madd_after_asm_1.c: New test. diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr63209.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr63209.c new file mode 100644 index 0000000..9bcb587 |