[blfs-support] Problem with gcc-6 and qt--5.6

Bruce Dubbs bruce.dubbs at gmail.com
Sat May 21 15:11:38 PDT 2016

Pierre Bechetoille wrote:
> Le 21/05/2016 23:07, Bruce Dubbs a écrit :
>> Pierre Bechetoille wrote:
>>> Hi,
>>> Following BLFS dev, I built latest KDE plasma and sddm with QT-5.6.0. The
>>> build was OK.
>>> However starting sddm or kde plasma failed (segmentation fault).
>>> Using gdb on sddm, I finally found the culprit: the crash occured in
>>> QV4::ExecutionEngine::newArrayObject(int) () from /usr/lib/libQt5Qml.so.5
>>> Googling the problem, I found this issue in Qt bugreports:
>>> https://bugreports.qt.io/browse/QTBUG-52057
>>> The description explains exactly what happens :
>>> "Upcoming gcc-6 has much more aggressive dead-store elimination.
>>> See: http://gcc.gnu.org/gcc-6/porting_to.html (-flifetime-dse section).
>>> Due to undefined behavior in QV4::ExecutionEngine::newArrayObject(int)
>>> this will lead to segfaults"
>>> There is no patch currently available however, the author suggests
>>> compiling Qt-5.6.0 with gcc-6 adding "-flifetime-dse=1" to QMAKE_CXXFLAGS
>>> (addition in
>>> qt-everywhere-opensource-src-5.6.0/qtbase/mkspecs/linux-g++/qmake.conf).
>>> And it works ! I now can start sddm / kde plasma without crash.
>>> Hope this can help if anyone encounters the same problem.
>> Sounds like we need a sed, but I do not see any QMAKE_CXXFLAGS settings
>> in that qmake.conf file.  Do we just need to add
>> QMAKE_CXXFLAGS += -flifetime-dse=1
>> to the end of the file?

> Yes, it is what I did. But there are lot of .conf files in mkspecs
> directory: maybe there is a more appropriate place (e.g.
> qt-everywhere-opensource-src-5.6.0/qtbase/mkspecs/common/linux.conf).

Yes there are a lot of .conf files, but if it works, then we don't need to 
search a lot.  I guess we only need:

echo "QMAKE_CXXFLAGS += -flifetime-dse=1" >> 

   -- Bruce

More information about the blfs-support mailing list