diff options
author | Peter Foley <pefoley2@pefoley.com> | 2016-01-15 11:34:20 -0500 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-01-18 08:31:09 +0000 |
commit | 0533b155354f086aa8dc1de06c7db92d3f3be4f5 (patch) | |
tree | 3e8832618f7835540845a3970025853cbfbfc6f5 /configure.ac | |
parent | 19167ea31383cb91c1563ba2d4bb7708eea8afc1 (diff) |
Wrappers for LTO
When building with GCC, the gcc-ar, gcc-ranlib, and gcc-nm wrappers
must be used for the linker to properly resolve symbols from static
libraries containing LTO objects.
Likewise, clang requires the llvm-ar, llvm-ranlib, and llvm-nm
wrappers.
Change-Id: I539017b6da7732f998a49820dc01d0e6b302952a
Reviewed-on: https://gerrit.libreoffice.org/21502
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 39f61c1f1140..3750beb5b312 100644 --- a/configure.ac +++ b/configure.ac @@ -5163,10 +5163,17 @@ if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then # /path/to/compiler/foo-gcc" you need to set the AR etc env vars # explicitly. Or put /path/to/compiler in PATH yourself. - AC_CHECK_TOOL(AR,ar) - AC_CHECK_TOOL(NM,nm) + # Use wrappers for LTO + if test "$ENABLE_LTO" == "TRUE" -a "$COM_IS_CLANG" != "TRUE"; then + AC_CHECK_TOOL(AR,gcc-ar) + AC_CHECK_TOOL(NM,gcc-nm) + AC_CHECK_TOOL(RANLIB,gcc-ranlib) + else + AC_CHECK_TOOL(AR,ar) + AC_CHECK_TOOL(NM,nm) + AC_CHECK_TOOL(RANLIB,ranlib) + fi AC_CHECK_TOOL(OBJDUMP,objdump) - AC_CHECK_TOOL(RANLIB,ranlib) AC_CHECK_TOOL(READELF,readelf) AC_CHECK_TOOL(STRIP,strip) if test "$_os" = "WINNT"; then |