Kaydet (Commit) d0cb2967 authored tarafından Luboš Luňák's avatar Luboš Luňák

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: 's avatarLuboš Luňák <l.lunak@collabora.com>
üst 0654030f
......@@ -601,6 +601,7 @@ export UCRTSDKDIR=@UCRTSDKDIR@
export UCRTVERSION=@UCRTVERSION@
export UCRT_REDISTDIR=@UCRT_REDISTDIR@
export UNOWINREG_DLL=@UNOWINREG_DLL@
export USE_LD=@USE_LD@
export USE_LIBRARY_BIN_TAR=@USE_LIBRARY_BIN_TAR@
export USE_XINERAMA=@USE_XINERAMA@
export UPDATE_CONFIG=@UPDATE_CONFIG@
......
......@@ -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])
......
......@@ -35,6 +35,10 @@ else
gb_AR := $(shell $(CC) -print-prog-name=ar)
endif
ifneq ($(USE_LD),)
gb_LinkTarget_LDFLAGS += -fuse-ld=$(USE_LD)
endif
ifeq ($(strip $(gb_COMPILEROPTFLAGS)),)
gb_COMPILEROPTFLAGS := -O2
endif
......
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