summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@centrum.cz>2021-09-20 00:53:33 +0000
committerMichael Stahl <michael.stahl@allotropia.de>2021-09-21 10:24:57 +0200
commit11f3ed0ca9f87da6ef5b24f6cb4f58335b78ff7d (patch)
tree62c046f26f4e9a597156252b95f99c8c529ffc73 /configure.ac
parent754a28a5a0e4cb3eb7ab98dd9d45c992caa0a51f (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/+/122285 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
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 a9241848fdd0..83b67fd34d50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11731,6 +11731,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
@@ -11762,6 +11763,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.
@@ -12032,6 +12051,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=