Files
odfstudio/sw/CustomTarget_generated.mk
T
Caolán McNamara e75369aff8 use gperf -fpic friendly version mode
nm -S --size-sort --print-size instdir/program/libmergedlo.so| grep ' [Dd] ' | c++filt | tail -n 10

before:
... 00000000000027f0 d aFmFormShellSlots_Impl
... 0000000000002920 d pRGBTable
... 0000000000003b80 d vcl::pdf::BuildinFontFace::m_aBuildinFonts
... 0000000000004140 d C.16.0
... 0000000000004d80 d (anonymous namespace)::aMethods
... 00000000000066a8 d aRTFTokenTab
... 000000000000cf60 d xmloff::(anonymous namespace)::wordlist
... 000000000000cf60 d xmloff::token::getNames(int)::{lambda()#1}::operator()() const::sppcTokenNames
... 00000000000172c0 d oox::(anonymous namespace)::wordlist
... 00000000000172c0 d oox::TokenMap::getUtf8TokenName(int)::{lambda()#1}::operator()() const::sppcTokenNames

after:
... 0000000000002790 d STR_ARR_SVT_LANGUAGE_TABLE
... 00000000000027a8 d RID_STRLIST_FUNCTION_NAMES
... 00000000000027f0 d aFmFormShellSlots_Impl
... 0000000000002920 d pRGBTable
... 0000000000003b80 d vcl::pdf::BuildinFontFace::m_aBuildinFonts
... 0000000000004140 d C.16.0
... 0000000000004d80 d (anonymous namespace)::aMethods
... 00000000000066a8 d aRTFTokenTab
... 000000000000cf60 d xmloff::token::getNames(int)::{lambda()#1}::operator()() const::sppcTokenNames
... 00000000000172c0 d oox::TokenMap::getUtf8TokenName(int)::{lambda()#1}::operator()() const::sppcTokenNames

See also: https://www.akkadia.org/drepper/dsohowto.pdf

Change-Id: Ic1141c466d06d79d71e573c5f283cd1f089d7067
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187578
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-07-09 16:49:00 +02:00

42 lines
1.8 KiB
Makefile

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_CustomTarget_CustomTarget,sw/generated))
sw_SRC := $(SRCDIR)/sw/source/core/swg
sw_PY := $(SRCDIR)/solenv/bin/gentoken.py
sw_INC := $(gb_CustomTarget_workdir)/sw/generated
# static pattern rule
$(sw_INC)/TextBlockTokens.gperf \
$(sw_INC)/BlockListTokens.gperf : $(sw_INC)/%.gperf : $(sw_SRC)/%.txt $(sw_PY) \
| $(call gb_ExternalExecutable_get_dependencies,python)
mkdir -p $(@D)
$(call gb_ExternalExecutable_get_command,python) $(sw_PY) $< $@
# appending when wrapping with wsl.exe is broken, will always replace from start instead of add
# https://github.com/microsoft/WSL/issues/4400 so create them as separate intermediates
$(sw_INC)/TextBlockTokens.processed : $(sw_INC)/TextBlockTokens.gperf
$(GPERF) --compare-strncmp --readonly-tables --class-name=TextBlockTokens \
--pic --string-pool-name=textBlockPool \
--word-array-name=textBlockList --enum $(sw_INC)/TextBlockTokens.gperf > $@
$(sw_INC)/BlockListTokens.processed : $(sw_INC)/BlockListTokens.gperf
$(GPERF) --compare-strncmp --readonly-tables -T $(sw_INC)/BlockListTokens.gperf \
--pic --string-pool-name=blockListPool \
--class-name=BlockListTokens --word-array-name=blockListList > $@
$(sw_INC)/tokens.cxx : sw_INC:=$(call gb_Helper_wsl_path,$(sw_INC))
$(sw_INC)/tokens.cxx : $(sw_INC)/TextBlockTokens.processed $(sw_INC)/BlockListTokens.processed
sed -e '/^#line/d' -e 's/(char\*)0/(char\*)0, XML_TOKEN_INVALID/g' $^ > $@
$(call gb_CustomTarget_get_target,sw/generated) : $(sw_INC)/tokens.cxx
# vim: set noet sw=4 ts=4: