From bd39ec554f90badccfb26c843fd0d43237f1b622 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 26 May 2020 15:55:04 +0200 Subject: bloaty: use -ffunction-sections and --gc-sections for linking strips out 3+ megabytes of duplicate functions (which originate in the generated UNO header files) Change-Id: I69ba5f478b2b062e2b05516bbaa2d18fa8312aa6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94868 Tested-by: Noel Grandin Reviewed-by: Noel Grandin --- solenv/gbuild/platform/com_GCC_defs.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'solenv/gbuild') diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk index 1707a7481ee6..766d53c07526 100644 --- a/solenv/gbuild/platform/com_GCC_defs.mk +++ b/solenv/gbuild/platform/com_GCC_defs.mk @@ -106,7 +106,9 @@ gb_LinkTarget_LDFLAGS += -fprofile-arcs -lgcov gb_COMPILEROPTFLAGS := -O0 endif -ifeq ($(DISABLE_DYNLOADING),TRUE) +# Strip out duplicates, which happen a lot with e.g. UNO +# functions declared in UNO header files. +ifneq ($(OS_FOR_BUILD),MACOSX) gb_CFLAGS_COMMON += -ffunction-sections -fdata-sections gb_CXXFLAGS_COMMON += -ffunction-sections -fdata-sections gb_LinkTarget_LDFLAGS += -Wl,--gc-sections -- cgit v1.2.3