Commit 3e8a03bd authored by Kenneth Russell's avatar Kenneth Russell Committed by Commit Bot

Change adb_gdb to look for ld rather than gcc

Recent NDKs don't ship a gcc binary any more, so the detection of the
NDK fails, even if specified via --ndk-dir.

Bug: 1084750
Change-Id: I323cfdc04ecbeb53fde864d41f55bf3270ea33b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2207577Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarSami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770802}
parent 52f0c623
......@@ -581,32 +581,32 @@ get_ndk_toolchain_prebuilt () {
get_ndk_toolchain_fullprefix () {
local NDK_DIR="$1"
local ARCH="$2"
local TARGET NAME HOST_OS HOST_ARCH GCC CONFIG
local TARGET NAME HOST_OS HOST_ARCH LD CONFIG
# NOTE: This will need to be updated if the NDK changes the names or moves
# the location of its prebuilt toolchains.
#
GCC=
LD=
HOST_OS=$(get_ndk_host_system)
HOST_ARCH=$(get_ndk_host_arch)
CONFIG=$(get_arch_gnu_config $ARCH)
GCC=$(get_ndk_toolchain_prebuilt \
"$NDK_DIR" "$ARCH" "$HOST_OS-$HOST_ARCH/bin/$CONFIG-gcc")
if [ -z "$GCC" -a "$HOST_ARCH" = "x86_64" ]; then
GCC=$(get_ndk_toolchain_prebuilt \
"$NDK_DIR" "$ARCH" "$HOST_OS-x86/bin/$CONFIG-gcc")
LD=$(get_ndk_toolchain_prebuilt \
"$NDK_DIR" "$ARCH" "$HOST_OS-$HOST_ARCH/bin/$CONFIG-ld")
if [ -z "$LD" -a "$HOST_ARCH" = "x86_64" ]; then
LD=$(get_ndk_toolchain_prebuilt \
"$NDK_DIR" "$ARCH" "$HOST_OS-x86/bin/$CONFIG-ld")
fi
if [ ! -f "$GCC" -a "$ARCH" = "x86" ]; then
if [ ! -f "$LD" -a "$ARCH" = "x86" ]; then
# Special case, the x86 toolchain used to be incorrectly
# named i686-android-linux-gcc!
GCC=$(get_ndk_toolchain_prebuilt \
"$NDK_DIR" "$ARCH" "$HOST_OS-x86/bin/i686-android-linux-gcc")
LD=$(get_ndk_toolchain_prebuilt \
"$NDK_DIR" "$ARCH" "$HOST_OS-x86/bin/i686-android-linux-ld")
fi
if [ -z "$GCC" ]; then
if [ -z "$LD" ]; then
panic "Cannot find Android NDK toolchain for '$ARCH' architecture. \
Please verify your NDK installation!"
fi
echo "${GCC%%gcc}"
echo "${LD%%ld}"
}
# $1: NDK install path
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment