diff options
author | Luboš Luňák <l.lunak@centrum.cz> | 2021-09-20 00:53:33 +0000 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-09-21 10:24:53 +0200 |
commit | afc221abb6e1895aa62abeca96c8b5043ddae63e (patch) | |
tree | a6393fd80b37d179265e619a0bb54daa0796bb21 /configure.ac | |
parent | 20672741eded49de01e8b7bc660e115f404203aa (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/+/122284
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index ec355cc47d7d..5e7bef2f7b77 100644 --- a/configure.ac +++ b/configure.ac @@ -11930,6 +11930,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" = "AARCH64" \); then if test -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then @@ -11961,6 +11962,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. @@ -12237,6 +12256,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= |