summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-07-28 08:12:57 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-07-28 09:05:52 +0200
commitd668c9a04d04d256fcbbd2165fe226f1db88256b (patch)
treec78400ef596fcabd74896b79572fa5c08e442f04 /configure.ac
parent27798238ecb200e0753b013c79df0e6c014c7a7a (diff)
Adapt --enable-ld to Clang 12 trunk --ld-path
...split from -fuse-ld with <https://github.com/llvm/llvm-project/commit/ 1bc5c84710a8c73ef21295e63c19d10a8c71f2f5> "[Driver] Add --ld-path= and deprecate -fuse-ld=/abs/path and -fuse-ld=rel/path", and now causing warnings (or even errors with -Werror) like '-fuse-ld=' taking a path is deprecated. Use '--ld-path=' instead when --enable-ld is configured as a full path. (--enable-ld was vague whether it supports full paths, but it appeared to work reasonably well at least with old versions of Clang.) Change-Id: I5a7dfd992b56aba78dd3646045fb9a827dc40321 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99569 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 11 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 5e846685cf1a..f651056fc11c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1418,7 +1418,10 @@ AC_ARG_ENABLE(icecream,
AC_ARG_ENABLE(ld,
AS_HELP_STRING([--enable-ld=<linker>],
[Use the specified linker. Both 'gold' and 'lld' linkers generally use less memory and link faster.
- By default tries to use the best linker possible, use --disable-ld to use the default linker.]),
+ By default tries to use the best linker possible, use --disable-ld to use the default linker.
+ If <linker> contains any ':', the part before the first ':' is used as the value of
+ -fuse-ld, while the part after the first ':' is used as the value of --ld-path (which is
+ needed for Clang 12).]),
,)
libo_FUZZ_ARG_ENABLE(cups,
@@ -4006,12 +4009,16 @@ dnl All checks for linker features/options should come after this.
dnl ===================================================================
check_use_ld()
{
- use_ld=$1
+ use_ld=-fuse-ld=${1%%:*}
+ use_ld_path=${1#*:}
+ if test "$use_ld_path" != "$1"; then
+ use_ld="$use_ld --ld-path=$use_ld_path"
+ fi
use_ld_fail_if_error=$2
use_ld_ok=
- AC_MSG_CHECKING([for -fuse-ld=$use_ld linker support])
+ AC_MSG_CHECKING([for $use_ld linker support])
use_ld_ldflags_save="$LDFLAGS"
- LDFLAGS="$LDFLAGS -fuse-ld=$use_ld"
+ LDFLAGS="$LDFLAGS $use_ld"
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <stdio.h>
],[