Results 1 to 4 of 4

Thread: ARM Platform: Segfaults with "-release" Qt but works great with "-debug" Qt?!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Aug 2009
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: ARM Platform: Segfaults with "-release" Qt but works great with "-debug" Qt?!

    Quote Originally Posted by nrabara View Post
    hi thajan,

    I have found the similar problem..
    Did you find the solution??

    If yes, please let me know??
    Hi there,

    I contacted the people at Qt and it is a common error caused by compiler optimizations present in G++ 4.2.x and higher. This also explains why it DOES work in debug mode, because it excludes several optimization options.

    They had several solutions to get rid of the optimization issue:

    (i) Use a 4.1 compiler
    (ii) Drop the "-O2" value of the QMAKE_CFLAGS_RELEASE in "mkspecs/common/g++.conf" to "-O1".
    (iii) Edit "mkspecs/qws/linux-arm-g++/qmake.conf" and turn off some compiler optimizations that seem to give some problems like so:
    Qt Code:
    1. QMAKE_CFLAGS_RELEASE += -fomit-frame-pointer -finline-functions -funroll-loops -falign-functions=2 -falign-loops=2 -falign-jumps=2
    To copy to clipboard, switch view to plain text mode 

    NOTE: Fill in the right values for "-falign-functions -falign-loops -falign-jumps" that fit with your CPU.

    Don't forget to run "make confclean" after you edit the file.

    All options (changing compiler was not an option), however, did not work properly for me. I had to drop the compilerflag to "-O0", which had an, to me, unacceptable slow performance.
    In staid I had to change the following line in "src/gui/embedded/qscreenlinuxfb.cpp":

    From:
    Qt Code:
    1. canaccel = useOffscreen();
    To copy to clipboard, switch view to plain text mode 
    To:
    Qt Code:
    1. canaccel = false;
    To copy to clipboard, switch view to plain text mode 

    I found this out by filling the file with qDebug()'s and see where it went wrong.

    NOTE: This is a HACK, and not a pretty one either. It makes sure that it hardcoded doesn't use off-chip graphic memory. I don't use off-chip graphic memory, but if you do, this hack is useless.
    Last edited by thajan; 29th August 2009 at 22:29.

Similar Threads

  1. Crash handler on Win32
    By niko in forum Qt Programming
    Replies: 3
    Last Post: 12th November 2007, 19:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.