[vlc-commits] [Git][videolan/vlc][master] qt: enable --gc-sections / -dead_strip linker flags
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sat Jun 6 14:39:37 UTC 2026
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
bde4f02e by Steve Lhomme at 2026-06-06T14:28:58+00:00
qt: enable --gc-sections / -dead_strip linker flags
Qt builds by default with -ffunction-sections -fdata-sections when supported by the compiler.
By using the proper linker flag we can reduce the size of the binary.
- - - - -
2 changed files:
- modules/gui/qt/Makefile.am
- modules/gui/qt/meson.build
Changes:
=====================================
modules/gui/qt/Makefile.am
=====================================
@@ -70,7 +70,7 @@ if HAVE_LIBATOMIC
libqt_plugin_la_CXXFLAGS += -DQT_HAS_LIBATOMIC
libqt_plugin_la_LIBADD += -latomic
endif
-libqt_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS)
+libqt_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS) $(GC_SECTIONS_LDFLAGS)
if HAVE_OSX
libqt_plugin_la_LDFLAGS += -Wl,-framework,Cocoa
endif
=====================================
modules/gui/qt/meson.build
=====================================
@@ -9,7 +9,7 @@ qt_include_dir = include_directories('.')
qt_extra_deps = []
qt_extra_flags = ['-DQT_STRICT_ITERATORS','-DQT_USE_QSTRINGBUILDER','-DQT_NO_CAST_TO_ASCII','-DQT_NO_CAST_FROM_BYTEARRAY']
qt_cppargs = []
-qt_link_args = []
+qt_link_args = [gc_sections_linkargs]
qt6_dep = dependency('qt6',
# Note that Qt < 6.2.5 does not provide pc files!
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bde4f02e2afb8c7cf51b4d34e359a753536a5d03
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bde4f02e2afb8c7cf51b4d34e359a753536a5d03
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list