Skip to content

Commit d806407

Browse files
committed
Merge bitcoin/bitcoin#25542: build: Use Link Time Optimization for Qt code on Linux
3442865 build: Use Link Time Optimization for Qt code on Linux (Hennadii Stepanov) ebce66e build: pass -fno-lto when building expat (fanquake) Pull request description: See: https://www.qt.io/blog/2019/01/02/qt-applications-lto `bitcon-qt` unstripped size: | host | master (31c6309) | this PR, depends built with `LTO=1` | |---|:-:|:-:| | x86_64-pc-linux-gnu | 42 MB | 35 MB | | arm-linux-gnueabihf | 31 MB | 26 MB | | aarch64-linux-gnu | 41 MB | 32 MB | | powerpc64-linux-gnu | 51 MB | 41 MB | | powerpc64le-linux-gnu | 48 MB | 39 MB | | riscv64-linux-gnu | 35 MB | 29 MB | Based on the first commit from bitcoin/bitcoin#25391. Using LTO for macOS and Windows hosts has some issues which could be addressed in follow ups. x86_64 build: ![image](https://user-images.githubusercontent.com/32963518/179326902-f91853ca-23c1-4c04-9a6d-161b695f27b5.png) ACKs for top commit: fanquake: ACK 3442865 Tree-SHA512: 03eef2568358df9336e24d6c4e12f28b89d649076fb74e7e5303d61e52865c2360c5345a4fb2b1e4bdfdae194f273fc27a5f67e6cf797ed01a154f3da9117247
2 parents c5fa7ed + 3442865 commit d806407

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

depends/packages/expat.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ define $(package)_set_vars
99
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
1010
$(package)_config_opts += --without-xmlwf
1111
$(package)_config_opts_linux=--with-pic
12+
$(package)_cflags += -fno-lto
1213
endef
1314

1415
define $(package)_config_cmds

depends/packages/qt.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ $(package)_config_opts_linux += -fontconfig
152152
$(package)_config_opts_linux += -no-opengl
153153
$(package)_config_opts_linux += -no-feature-vulkan
154154
$(package)_config_opts_linux += -dbus-runtime
155+
ifneq ($(LTO),)
156+
$(package)_config_opts_linux += -ltcg
157+
endif
155158
$(package)_config_opts_arm_linux += -platform linux-g++ -xplatform bitcoin-linux-g++
156159
$(package)_config_opts_i686_linux = -xplatform linux-g++-32
157160
ifneq (,$(findstring -stdlib=libc++,$($(1)_cxx)))

0 commit comments

Comments
 (0)