summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2022-01-02 04:41:31 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2022-01-02 07:08:44 +0100
commita3adb6f82eb582f5bc52037018ad3b7b53bb4bd1 (patch)
tree4f3128beeb559c3f6111b9a6b00b6241756bf4cb /configure.ac
parent7f5140fb8cf3d127b5cb8704d277b03de2f63b51 (diff)
Error-out on --enable-ld with path and gcc
Now that mold can successfully link LO and its unit tests (needs mold 1.0.1 or later), gcc could support an alternative linker with '-B<path>' to search for its tools in some extra path. But it turns out that libtool filters the '-B' option from its arguments, so it falls back to some system ld. But since we already tested "our" ld for some features, this might not match, resulting in libtool failing to link externals, like orcus. The original use case was testing mold, which can also be done by using LD_PRELOAD=/usr/lib/mold/mold-wrapper.so, so this patch just shows an error, if gcc is used with an use_ld_path. Change-Id: I9c7860895f8b24a5f3fc4b1e0fd5232be22293f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127493 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 9 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index fb8d85a01f71..2467b55957a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4500,7 +4500,15 @@ check_use_ld()
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"
+ if test "$COM_IS_CLANG" = TRUE; then
+ use_ld="${use_ld} --ld-path=${use_ld_path}"
+ else
+ # I tried to use gcc's '-B<path>' and a directory + symlink setup in
+ # $BUILDDIR, but libtool always filtered-out that option, so gcc wouldn't
+ # pickup the alternative linker, when called by libtool for linking.
+ # For mold, one can use LD_PRELOAD=/usr/lib/mold/mold-wrapper.so instead.
+ AC_MSG_ERROR([A linker path is just supported with clang, because of libtool's -B filtering!])
+ fi
fi
use_ld_fail_if_error=$2
use_ld_ok=