summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@centrum.cz>2021-09-20 00:53:33 +0000
committerLuboš Luňák <l.lunak@collabora.com>2021-09-28 17:11:32 +0200
commit9e634c0987738ff2951ab82d7690a8e91c7e952e (patch)
tree1b5390f1c9a17cf0ac1cafac9f88d7f34e1757b3 /configure.ac
parente911cfe7c75a18a8023008cd437a281f3bfd3254 (diff)
use clang-cl's -Zc:dllexportInlines- for Skia (tdf#144598)
This is clang-cl's equivalent of -fvisibility-inlines-hidden, and it seems to be also sort of the equivalent of MSVC's -Zc:inline. So it saves build time and disk space. As an additional effect, this disables emitting copies of inlines functions in every .o file where the function is called (even if inlined), which means that it hopefully avoids the problem of SkOpts_avx.cpp generating a copy of SkRect::round() which would include AVX code, and the linker might select this as the instance of SkRect::round() to keep, thus making SSE2 code call AVX code without checking for AVX availability first. Change-Id: I97541ae11d05f489894bc9233271eb21fd520f43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122335 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com> (cherry picked from commit 36f76223193fb96df7b8cbc1a1ff30f739857189) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122739 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 31bf6e85efac..518fce0704d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11719,6 +11719,7 @@ LO_CLANG_CXXFLAGS_INTRINSICS_AVX2=
LO_CLANG_CXXFLAGS_INTRINSICS_AVX512=
LO_CLANG_CXXFLAGS_INTRINSICS_F16C=
LO_CLANG_CXXFLAGS_INTRINSICS_FMA=
+HAVE_LO_CLANG_DLLEXPORTINLINES=
if test "$ENABLE_SKIA" = TRUE -a "$COM_IS_CLANG" != TRUE -a ! \( "$_os" = "WINNT" -a "$CPUNAME" = "ARM64" \); then
if test -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then
@@ -11750,6 +11751,24 @@ if test "$ENABLE_SKIA" = TRUE -a "$COM_IS_CLANG" != TRUE -a ! \( "$_os" = "WINNT
LO_CLANG_CXX=
fi
fi
+ if test -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX" -a "$_os" = "WINNT"; then
+ save_CXX="$CXX"
+ CXX="$LO_CLANG_CXX"
+ AC_MSG_CHECKING([whether $CXX supports -Zc:dllexportInlines-])
+ AC_LANG_PUSH([C++])
+ save_CXXFLAGS=$CXXFLAGS
+ CXXFLAGS="$CXXFLAGS -Werror -Zc:dllexportInlines-"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE()], [
+ HAVE_LO_CLANG_DLLEXPORTINLINES=TRUE
+ AC_MSG_RESULT([yes])
+ ], [AC_MSG_RESULT([no])])
+ CXXFLAGS=$save_CXXFLAGS
+ AC_LANG_POP([C++])
+ CXX="$save_CXX"
+ if test -z "$HAVE_LO_CLANG_DLLEXPORTINLINES"; then
+ AC_MSG_ERROR([Clang compiler does not support -Zc:dllexportInlines-. The Skia library needs to be built using a newer Clang version, or use --disable-skia.])
+ fi
+ fi
if test -z "$LO_CLANG_CC" -o -z "$LO_CLANG_CXX"; then
# Skia is the default on Windows, so hard-require Clang.
# Elsewhere it's used just by the 'gen' VCL backend which is rarely used.
@@ -12020,6 +12039,7 @@ AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_AVX512)
AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_F16C)
AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_FMA)
AC_SUBST(CLANG_USE_LD)
+AC_SUBST([HAVE_LO_CLANG_DLLEXPORTINLINES])
SYSTEM_GPGMEPP=