8148351: Only display resolved symlink for compiler, do not change path

Reviewed-by: erikj
This commit is contained in:
Magnus Ihse Bursie 2016-01-30 10:28:45 +01:00
parent 44a1209fdf
commit 4260fd470c
2 changed files with 53 additions and 976 deletions

File diff suppressed because it is too large Load Diff

View File

@ -433,39 +433,22 @@ AC_DEFUN([TOOLCHAIN_FIND_COMPILER],
# Now we have a compiler binary in $1. Make sure it's okay.
BASIC_FIXUP_EXECUTABLE($1)
TEST_COMPILER="[$]$1"
# Don't remove symbolic links on AIX because 'xlc_r' and 'xlC_r' may all be links
# to 'xlc' but it is crucial that we invoke the compiler with the right name!
if test "x$OPENJDK_BUILD_OS" != xaix; then
# FIXME: This test should not be needed anymore; we don't do that for any platform.
AC_MSG_CHECKING([resolved symbolic links for $1])
BASIC_REMOVE_SYMBOLIC_LINKS(TEST_COMPILER)
AC_MSG_RESULT([$TEST_COMPILER])
fi
AC_MSG_CHECKING([if $1 is disguised ccache])
COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"`
if test "x$COMPILER_BASENAME" = "xccache"; then
AC_MSG_RESULT([yes, trying to find proper $COMPILER_NAME compiler])
# We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache.
# We want to control ccache invocation ourselves, so ignore this cc and try
# searching again.
# Remove the path to the fake ccache cc from the PATH
RETRY_COMPILER_SAVED_PATH="$PATH"
COMPILER_DIRNAME=`$DIRNAME [$]$1`
PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`"
# Try again looking for our compiler
AC_CHECK_TOOLS(PROPER_COMPILER_$1, $3)
BASIC_FIXUP_EXECUTABLE(PROPER_COMPILER_$1)
PATH="$RETRY_COMPILER_SAVED_PATH"
AC_MSG_CHECKING([for resolved symbolic links for $1])
BASIC_REMOVE_SYMBOLIC_LINKS(PROPER_COMPILER_$1)
AC_MSG_RESULT([$PROPER_COMPILER_$1])
$1="$PROPER_COMPILER_$1"
AC_MSG_CHECKING([resolved symbolic links for $1])
SYMLINK_ORIGINAL="$TEST_COMPILER"
BASIC_REMOVE_SYMBOLIC_LINKS(SYMLINK_ORIGINAL)
if test "x$TEST_COMPILER" = "x$SYMLINK_ORIGINAL"; then
AC_MSG_RESULT([no symlink])
else
AC_MSG_RESULT([no, keeping $1])
AC_MSG_RESULT([$SYMLINK_ORIGINAL])
# We can't handle ccache by gcc wrappers, since we need to know if we're
# using ccache. Instead ccache usage must be controlled by a configure option.
COMPILER_BASENAME=`$BASENAME "$SYMLINK_ORIGINAL"`
if test "x$COMPILER_BASENAME" = "xccache"; then
AC_MSG_NOTICE([Please use --enable-ccache instead of providing a wrapped compiler.])
AC_MSG_ERROR([$TEST_COMPILER is a symbolic link to ccache. This is not supported.])
fi
fi
TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME])