diff options
author | Luboš Luňák <l.lunak@centrum.cz> | 2021-09-20 00:53:33 +0000 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-09-20 22:50:31 +0200 |
commit | 36f76223193fb96df7b8cbc1a1ff30f739857189 (patch) | |
tree | aebaaf6ef3c06f113fd1581cd8d81a3d6038f2d0 /configure.ac | |
parent | c9c9d40f79f1767a0a824fc421f2e476c3f24eb8 (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>
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 0a2d098b252c..fde9600bab27 100644 --- a/configure.ac +++ b/configure.ac @@ -12035,6 +12035,7 @@ LO_CLANG_CXXFLAGS_INTRINSICS_AVX512= LO_CLANG_CXXFLAGS_INTRINSICS_AVX512F= 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 @@ -12066,6 +12067,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. @@ -12345,6 +12364,7 @@ AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_AVX512F) 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= |