Skip to content

Commit be70991

Browse files
committed
Disable LTO for building the UI
- The new connect syntax is incompatible with LTO, but unavoidable
1 parent 240cbad commit be70991

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

firebird.pro

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ QMAKE_CXXFLAGS = -g -std=c++11 -Wall -Wextra -D QT_NO_CAST_FROM_ASCII
4141
LIBS += -lz
4242

4343
# Override bad default options to enable better optimizations
44-
QMAKE_CFLAGS_RELEASE = -O3 -flto -DNDEBUG
45-
QMAKE_CXXFLAGS_RELEASE = -O3 -flto -DNDEBUG
44+
QMAKE_CFLAGS_RELEASE = -O3 -flto -fno-fat-lto-objects -DNDEBUG
45+
QMAKE_CXXFLAGS_RELEASE = -O3 -flto -fno-fat-lto-objects -DNDEBUG
4646
QMAKE_LFLAGS_RELEASE = -Wl,-O3 -flto
4747
QMAKE_LFLAGS += -fno-pie
4848

@@ -153,18 +153,35 @@ contains(FB_ARCH, "arm") {
153153
QMAKE_LFLAGS += -march=armv7-a -marm # We're using LTO, so the linker has to get the same flags
154154
}
155155

156+
# QObject is incompatible with LTO, so don't use it for building the UI
157+
nolto.name = nolto
158+
nolto.input = SOURCES_UI
159+
nolto.dependency_type = TYPE_C
160+
nolto.variable_out = OBJECTS
161+
nolto.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_IN_BASE}$${first(QMAKE_EXT_OBJ)}
162+
nolto.commands = $${QMAKE_CXX} $(CXXFLAGS) -fno-lto $(INCPATH) -c ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
163+
QMAKE_EXTRA_COMPILERS += nolto
164+
156165
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
157166

158167
QML_IMPORT_PATH += $$PWD/qml
159168

160-
SOURCES += $$ASMCODE_IMPL \
169+
SOURCES_UI = \
161170
lcdwidget.cpp \
162171
mainwindow.cpp \
163172
main.cpp \
164173
flashdialog.cpp \
165174
emuthread.cpp \
166175
qmlbridge.cpp \
167176
qtkeypadbridge.cpp \
177+
qtframebuffer.cpp \
178+
usblinktreewidget.cpp \
179+
kitmodel.cpp \
180+
fbaboutdialog.cpp \
181+
dockwidget.cpp \
182+
consolelineedit.cpp
183+
184+
SOURCES += $$ASMCODE_IMPL \
168185
core/arm_interpreter.cpp \
169186
core/coproc.cpp \
170187
core/cpu.cpp \
@@ -188,15 +205,9 @@ SOURCES += $$ASMCODE_IMPL \
188205
core/sha256.c \
189206
core/usb.c \
190207
core/usblink.c \
191-
qtframebuffer.cpp \
192208
core/debug.cpp \
193209
core/flash.cpp \
194210
core/emu.cpp \
195-
usblinktreewidget.cpp \
196-
kitmodel.cpp \
197-
fbaboutdialog.cpp \
198-
dockwidget.cpp \
199-
consolelineedit.cpp
200211

201212
FORMS += \
202213
mainwindow.ui \

0 commit comments

Comments
 (0)