Answer the question
In order to leave comments, you need to log in
Qt + MinGW + LTO + LLD: how to make them work together?
The glitch is reproduced like this.
1. Install MSYS (MinGW and LLD), Qt (any version) under Windows.
2. Build your own kit from the compiler from MSYS and any version of Qt from the distribution.
3. Build an empty Qt Widgets project . Add to it...
QMAKE_CXXFLAGS += -flto
QMAKE_LFLAGS += -flto -fuse-ld=lld
# Special LTO features for main.cpp
CONFIG(release, debug|release) {
win32|win64 {
FAT_SOURCES = main1.cpp
fat.name = FAT_SOURCES
fat.dependency_type = TYPE_C
fat.variable_out = OBJECTS
fat.input = FAT_SOURCES
fat.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_IN_BASE}$${first(QMAKE_EXT_OBJ)}
fat.commands = $${QMAKE_CXX} $(CXXFLAGS) $(INCPATH) -c ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} -ffat-lto-objects
QMAKE_EXTRA_COMPILERS += fat
}
}
__attribute__ ((used))
gives nothing. Answer the question
In order to leave comments, you need to log in
Unfortunately, I'm asking for the impossible. And this is due to the optimization architecture when linking GCC. The fact is that LD itself calls the optimizer, and it's a damn pity. After all, LLVM has a different virtual machine device that does optimization when linking.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question