Commit cc48bbff authored by Andrew Hsieh's avatar Andrew Hsieh Committed by Gerrit Code Review
Browse files

Merge "Symlink ld.bfd if ld.gold isn't available"

parents 628b3942 05592764
......@@ -504,18 +504,25 @@ done
# $1: Source file prefix (e.g. 'c++')
# $2: Destination file prefix (e.g. 'g++')
# $3: Alternative file prefix if $2 doesn't exist (eg. ld.bfd)
do_relink_bin () {
local DST_FILE=$2
if [ ! -f "$TOOLCHAIN_PATH/bin/$ABI_CONFIGURE_TARGET-$DST_FILE$HOST_EXE" ]; then
DST_FILE=$3
fi
if [ ! -f "$TOOLCHAIN_PATH/bin/$ABI_CONFIGURE_TARGET-$DST_FILE$HOST_EXE" ]; then
echo "ERROR: Can't relink $1 to $DST_FILE because $DST_FILE doesn't exist"
exit 1
fi
do_relink \
$TOOLCHAIN_PATH/bin/$ABI_CONFIGURE_TARGET-$1$HOST_EXE \
$ABI_CONFIGURE_TARGET-$2$HOST_EXE
$ABI_CONFIGURE_TARGET-$DST_FILE$HOST_EXE
}
do_relink_bin c++ g++
do_relink_bin gcc-$GCC_VERSION gcc
# Gold is the default except for 4.4.3
if [ "$GCC_VERSION" != "4.4.3" ]; then
do_relink_bin ld ld.gold
fi
# symlink ld to either ld.gold or ld.bfd
do_relink_bin ld ld.gold ld.bfd
# copy SOURCES file if present
if [ -f "$SRC_DIR/SOURCES" ]; then
......
......@@ -1579,8 +1579,10 @@ install_gcc ()
# Also relink a few files under $INSTALL_DIR/bin/
do_relink "$INSTALL_DIR"/bin/$TARGET-c++ $TARGET-g++ &&
do_relink "$INSTALL_DIR"/bin/$TARGET-gcc-$GCC_VERSION $TARGET-gcc &&
if [ "$GCC_VERSION" != "4.4.3" ]; then
if [ -f "$INSTALL_DIR"/bin/$TARGET-ld.gold ]; then
do_relink "$INSTALL_DIR"/bin/$TARGET-ld $TARGET-ld.gold
else
do_relink "$INSTALL_DIR"/bin/$TARGET-ld $TARGET-ld.bfd
fi
fail_panic
......
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