diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2018-06-25 22:42:56 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2018-07-04 15:36:18 +0200 |
commit | d0cb2967aa288852561497537327ebea838ebc9a (patch) | |
tree | 8b7465799031b0db8ef25dfb69f57514a48bed65 /configure.ac | |
parent | 0654030f98355f105ddc741147fc0ff03ab0d906 (diff) |
add configure option --enable-ld to use GNU gold or LLVM lld
https://lists.freedesktop.org/archives/libreoffice/2018-June/080437.html
Change-Id: I06214459fcebe5cc58fd7979f3cbe5ac3d97db7d
Reviewed-on: https://gerrit.libreoffice.org/56417
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 12516d80219b..ebe5d0c5be9b 100644 --- a/configure.ac +++ b/configure.ac @@ -1341,6 +1341,11 @@ AC_ARG_ENABLE(icecream, wrappers, you can override that using --with-gcc-home=/the/path switch.]), ,) +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.]), +,) + libo_FUZZ_ARG_ENABLE(cups, AS_HELP_STRING([--disable-cups], [Do not build cups support.]) @@ -3152,6 +3157,29 @@ else fi AC_SUBST(CROSS_COMPILING) +USE_LD= +if test -n "$enable_ld" -a "$enable_ld" != "no"; then + AC_MSG_CHECKING([for -fuse-ld=$enable_ld linker support]) + if test "$GCC" = "yes"; then + ldflags_save=$LDFLAGS + LDFLAGS="$LDFLAGS -fuse-ld=$enable_ld" + AC_LINK_IFELSE([AC_LANG_PROGRAM([ +#include <stdio.h> + ],[ +printf ("hello world\n"); + ])], USE_LD=$enable_ld, []) + if test -n "$USE_LD"; then + AC_MSG_RESULT( yes ) + LDFLAGS="$ldflags_save -fuse-ld=$enable_ld" + else + AC_MSG_ERROR( no ) + fi + else + AC_MSG_ERROR( not supported ) + fi +fi +AC_SUBST(USE_LD) + HAVE_LD_BSYMBOLIC_FUNCTIONS= if test "$GCC" = "yes"; then AC_MSG_CHECKING([for -Bsymbolic-functions linker support]) |