qt5base-lts/mkspecs/common/linux.conf
Thiago Macieira 6315745770 Strip bootstrapped binaries of unused sections
This matches the -ffunction-sections from bootstrap.pro, which tells the
compiler to create a section for each function. The -gc-sections option
tells the linker to drop what wasn't used (normally, it only drops
entire files).

Before (on Linux, built with -O3, no LTO):
   text    data     bss     dec     hex filename
1746385    7920    3750 1758055  1ad367 bin/moc
1444101    6664    1894 1452659  162a73 bin/rcc
4407725    1568    4896 4414189  435aed bin/qmake

After:
   text    data     bss     dec     hex filename
1131655    6520    3494 1141669  116ba5 bin/moc
1027043    5480    1766 1034289   fc831 bin/rcc
3578489    1656    5313 3585458  36b5b2 bin/qmake

Gain: 35% on moc, 28% on rcc, 19% on qmake

Before (on OS X):
__TEXT	__DATA	__OBJC	others	dec	hex
1495040	12288	0	4294993008	4296500336	100176470	bin/moc
1265664	8192	0	4294983904	4296257760	10013b0e0	bin/rcc
5279744	81920	0	4297912320	4303273984	1007ec000	bin/qmake

After:
__TEXT	__DATA	__OBJC	others	dec	hex
806912	8192	0	4294988132	4295803236	1000cc164	bin/moc
720896	8192	0	4294979764	4295708852	1000b50b4	bin/rcc
4841472	77824	0	4295580688	4300499984	100546c10	bin/qmake

Gain: 46% on moc, 43% on rcc, 8% on qmake.

Change-Id: Icc7cdc9fd6f5db15537b4adabaac7e7a27e539d4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-05-19 19:33:15 +02:00

58 lines
1.5 KiB
Plaintext

#
# qmake configuration for common linux
#
QMAKE_PLATFORM += linux
QMAKE_CFLAGS_THREAD += -D_REENTRANT
QMAKE_CXXFLAGS_THREAD += $$QMAKE_CFLAGS_THREAD
QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections
QMAKE_INCDIR =
QMAKE_LIBDIR =
QMAKE_INCDIR_X11 =
QMAKE_LIBDIR_X11 =
QMAKE_INCDIR_OPENGL =
QMAKE_LIBDIR_OPENGL =
QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL
QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL
QMAKE_INCDIR_EGL =
QMAKE_LIBDIR_EGL =
QMAKE_INCDIR_OPENVG =
QMAKE_LIBDIR_OPENVG =
QMAKE_LIBS =
QMAKE_LIBS_DYNLOAD = -ldl
QMAKE_LIBS_X11 = -lXext -lX11 -lm
QMAKE_LIBS_NIS = -lnsl
QMAKE_LIBS_EGL = -lEGL
QMAKE_LIBS_OPENGL = -lGL
QMAKE_LIBS_OPENGL_ES2 = -lGLESv2
QMAKE_LIBS_OPENVG = -lOpenVG
QMAKE_LIBS_THREAD = -lpthread
QMAKE_LIBS_LIBUDEV = -ludev
QMAKE_CFLAGS_WAYLAND =
QMAKE_INCDIR_WAYLAND =
QMAKE_LIBS_WAYLAND_CLIENT = -lwayland-client
QMAKE_LIBS_WAYLAND_SERVER = -lwayland-server
QMAKE_LIBDIR_WAYLAND =
QMAKE_DEFINES_WAYLAND =
QMAKE_WAYLAND_SCANNER = wayland-scanner
QMAKE_CFLAGS_XCB =
QMAKE_LIBS_XCB =
QMAKE_DEFINES_XCB =
QMAKE_AR = ar cqs
QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
QMAKE_STRIP = strip
QMAKE_STRIPFLAGS_LIB += --strip-unneeded
QMAKE_INSTALL_FILE = install -m 644 -p
QMAKE_INSTALL_PROGRAM = install -m 755 -p
include(unix.conf)