summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@centrum.cz>2021-11-13 16:20:46 +0000
committerLuboš Luňák <l.lunak@collabora.com>2021-11-17 15:21:44 +0100
commitc48a5f2653f7e76421c140cbd6018deffefccaf9 (patch)
treeb3415eecc9205f5787e749d8307c40792eedca77 /external
parent938fbac669bc59cf0b388bd0d21a2f14c4399757 (diff)
support ccache for MSVC too
There's no official MSVC support in ccache yet, but there are patches in progress of getting upstreamed. So right now it's necessary to get a patched ccache. Ccache cannot work with -Zi option, since sharing debuginfo in a .PDB cannot be cached. Added --enable-z7-symbols that gets enabled by default if ccache is detected. It works even with PCHs enabled, and externals seem to work too. I get almost 100% hit rate on a rebuild, although such a rebuild is slower than on Linux. Change-Id: I1d230ee1fccc441b9d9bec794cc2e1ec13161999 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125179 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'external')
-rw-r--r--external/curl/ExternalProject_curl.mk1
-rw-r--r--external/curl/UnpackedTarball_curl.mk1
-rw-r--r--external/curl/configurable-z-option.patch.020
-rw-r--r--external/openssl/ExternalProject_openssl.mk1
-rw-r--r--external/openssl/UnpackedTarball_openssl.mk1
-rw-r--r--external/openssl/configurable-z-option.patch.034
6 files changed, 58 insertions, 0 deletions
diff --git a/external/curl/ExternalProject_curl.mk b/external/curl/ExternalProject_curl.mk
index d068f2dc36f2..d7bf396ca9fd 100644
--- a/external/curl/ExternalProject_curl.mk
+++ b/external/curl/ExternalProject_curl.mk
@@ -84,6 +84,7 @@ $(call gb_ExternalProject_get_state_target,curl,build):
VC=12 \
MACHINE=$(gb_MSBUILD_PLATFORM) \
GEN_PDB=$(if $(call gb_Module__symbols_enabled,curl),yes,no) \
+ $(if $(call gb_Module__symbols_enabled,curl),CFLAGS_PDB_VALUE="$(gb_DEBUGINFO_FLAGS)") \
DEBUG=$(if $(MSVC_USE_DEBUG_RUNTIME),yes,no) \
ENABLE_IPV6=yes \
ENABLE_SSPI=yes \
diff --git a/external/curl/UnpackedTarball_curl.mk b/external/curl/UnpackedTarball_curl.mk
index f1244d0fd989..73dca5ed219c 100644
--- a/external/curl/UnpackedTarball_curl.mk
+++ b/external/curl/UnpackedTarball_curl.mk
@@ -26,6 +26,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,curl,\
external/curl/curl-7.26.0_win-proxy.patch \
external/curl/zlib.patch.0 \
external/curl/curl-debug.patch.1 \
+ external/curl/configurable-z-option.patch.0 \
))
ifeq ($(SYSTEM_NSS),)
diff --git a/external/curl/configurable-z-option.patch.0 b/external/curl/configurable-z-option.patch.0
new file mode 100644
index 000000000000..160577c76533
--- /dev/null
+++ b/external/curl/configurable-z-option.patch.0
@@ -0,0 +1,20 @@
+--- winbuild/MakefileBuild.vc.sav 2021-11-13 11:43:40.756226600 +0000
++++ winbuild/MakefileBuild.vc 2021-11-13 11:52:08.921692300 +0000
+@@ -45,7 +45,7 @@
+
+ !IF "$(VC)"=="6"
+ CC_NODEBUG = $(CC) /O2 /DNDEBUG
+-CC_DEBUG = $(CC) /Od /Gm /Zi /D_DEBUG /GZ
++CC_DEBUG = $(CC) /Od /Gm $(DEBUG_FLAGS_VALUE) /D_DEBUG /GZ
+ CFLAGS = /I. /I../lib /I../include /nologo /W4 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL
+ !ELSE
+ CC_NODEBUG = $(CC) /O2 /DNDEBUG
+@@ -62,7 +62,7 @@
+ # Instead of id: just create an archive, that contains all objects
+ LNKLIB = lib.exe
+
+-CFLAGS_PDB = /Zi
++CFLAGS_PDB = $(DEBUG_FLAGS_VALUE)
+ LFLAGS_PDB = /incremental:no /opt:ref,icf /DEBUG
+
+ CFLAGS_LIBCURL_STATIC = /DCURL_STATICLIB
diff --git a/external/openssl/ExternalProject_openssl.mk b/external/openssl/ExternalProject_openssl.mk
index 4c5d630721c8..e44ccf5f3436 100644
--- a/external/openssl/ExternalProject_openssl.mk
+++ b/external/openssl/ExternalProject_openssl.mk
@@ -66,6 +66,7 @@ $(call gb_ExternalProject_get_state_target,openssl,build):
CONFIGURE_INSIST=1 $(PERL) Configure $(OPENSSL_PLATFORM) no-tests no-multilib \
&& export PERL="$(shell cygpath -w $(PERL))" \
&& nmake -f makefile \
+ $(if $(call gb_Module__symbols_enabled,openssl),DEBUG_FLAGS_VALUE="$(gb_DEBUGINFO_FLAGS)") \
)
$(call gb_Trace_EndRange,openssl,EXTERNAL)
diff --git a/external/openssl/UnpackedTarball_openssl.mk b/external/openssl/UnpackedTarball_openssl.mk
index 6f00cf7f7e44..c52b427a866e 100644
--- a/external/openssl/UnpackedTarball_openssl.mk
+++ b/external/openssl/UnpackedTarball_openssl.mk
@@ -13,6 +13,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,openssl,$(OPENSSL_TARBALL),,openssl
$(eval $(call gb_UnpackedTarball_add_patches,openssl,\
external/openssl/openssl-no-multilib.patch.0 \
+ external/openssl/configurable-z-option.patch.0 \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/openssl/configurable-z-option.patch.0 b/external/openssl/configurable-z-option.patch.0
new file mode 100644
index 000000000000..3dcf49dc81a6
--- /dev/null
+++ b/external/openssl/configurable-z-option.patch.0
@@ -0,0 +1,34 @@
+--- Configurations/10-main.conf.sav 2021-08-24 13:38:47.000000000 +0000
++++ Configurations/10-main.conf 2021-11-02 22:20:44.377653700 +0000
+@@ -13,7 +13,7 @@
+ } elsif ($disabled{asm}) {
+ # assembler is still used to compile uplink shim
+ $vc_win64a_info = { AS => "ml64",
+- ASFLAGS => "/nologo /Zi",
++ ASFLAGS => "/nologo $$(DEBUG_FLAGS_VALUE)",
+ asflags => "/c /Cp /Cx",
+ asoutflag => "/Fo" };
+ } else {
+@@ -41,7 +41,7 @@
+ } elsif ($disabled{asm}) {
+ # not actually used, uplink shim is inlined into C code
+ $vc_win32_info = { AS => "ml",
+- ASFLAGS => "/nologo /Zi",
++ ASFLAGS => "/nologo $$(DEBUG_FLAGS_VALUE)",
+ asflags => "/Cp /coff /c /Cx",
+ asoutflag => "/Fo",
+ perlasm_scheme => "win32" };
+@@ -1231,10 +1231,10 @@
+ "UNICODE", "_UNICODE",
+ "_CRT_SECURE_NO_DEPRECATE",
+ "_WINSOCK_DEPRECATED_NO_WARNINGS"),
+- lib_cflags => add("/Zi /Fdossl_static.pdb"),
++ lib_cflags => add("\$(DEBUG_FLAGS_VALUE)"),
+ lib_defines => add("L_ENDIAN"),
+- dso_cflags => "/Zi /Fddso.pdb",
+- bin_cflags => "/Zi /Fdapp.pdb",
++ dso_cflags => "\$(DEBUG_FLAGS_VALUE)",
++ bin_cflags => "\$(DEBUG_FLAGS_VALUE)",
+ shared_ldflag => "/dll",
+ shared_target => "win-shared", # meaningless except it gives Configure a hint
+ thread_scheme => "winthreads",