diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-26 15:55:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-27 09:10:26 +0200 |
commit | bd39ec554f90badccfb26c843fd0d43237f1b622 (patch) | |
tree | bedc72fdd5ccd3c7de5d901ef678c924479d4d1f | |
parent | 3fb424b4326cff4f810fb24977e387bdb9e5a34e (diff) |
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 <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | solenv/gbuild/platform/com_GCC_defs.mk | 4 |
1 files changed, 3 insertions, 1 deletions
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 |