Results 1 to 9 of 9

Thread: -pthread havoc

  1. #1
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default -pthread havoc

    Hello there,

    this has been bugging me for a while. When I compile my Qt project, the last call to the linker contains approximately one million -pthread arguments:

    g++ -Wl,-O1 -Wl,-rpath,/home/missura/qtsdk-2009.03/qt/lib -o MocapRobot dynaped.o gait_modell.o kidsize.o main.o mocaprobot.o fileloader.o landscape.o moc_mocaprobot.o moc_fileloader.o moc_landscape.o -L/home/missura/qtsdk-2009.03/qt/lib -L/usr/X11R6/lib -LQGLViewer -lQGLViewer -L/usr/X11R6/lib -L/home/missura/qtsdk-2009.03/qt/lib -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -lQtXml -pthread -pthread -lQtOpenGL -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -lQtGui -pthread -lfreetype -lgobject-2.0 -lSM -lICE -pthread -pthread -lXrender -lfontconfig -lXext -lX11 -lQtCore -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lGLU -lGL -lpthread
    Why does this happen? And what can I do about it? My .pro file doesn't seem to contain anything suspicious.

    Thanks,
    Cruz

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: -pthread havoc

    What does it contain exactly?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: -pthread havoc

    Here is my .pro file:

    TEMPLATE = app
    TARGET = MocapRobot
    QT += core \
    gui \
    xml \
    opengl
    HEADERS += dynaped.h \
    gait_modell.h \
    kidsize.h \
    mocaprobot.h \
    fileloader.h \
    landscape.h \
    globals.h
    SOURCES += dynaped.cpp \
    gait_modell.cpp \
    kidsize.cpp \
    main.cpp \
    mocaprobot.cpp \
    fileloader.cpp \
    landscape.cpp
    FORMS += mocaprobot.ui
    RESOURCES +=
    CONFIG += console
    LIBS += -LQGLViewer \
    -lQGLViewer

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: -pthread havoc

    What if you change this:
    qmake Code:
    1. QT += core \
    2. gui \
    3. xml \
    4. opengl
    To copy to clipboard, switch view to plain text mode 
    to this:
    qmake Code:
    1. QT = core \
    2. gui \
    3. xml \
    4. opengl
    To copy to clipboard, switch view to plain text mode 

    I doubt it will change anything but that would be a proper line in this case anyway.

    This "-pthread" is probably coming from somewhere in your system. Are you using HP-UX? That's the only system that actually makes use of this flag, at least that's what g++ manual says.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: -pthread havoc

    You were right, the line doesn't change anything. I'm using Linux. I regenerated my Makefiles and I can see all the -pthread flags in the LIBS variable. I don't know how they get there though, it must be generated by qmake somehow.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: -pthread havoc

    Please run the following code from your console and paste the result:

    bash Code:
    1. cd /home/missura/qtsdk-2009.03/qt/mkspecs
    2. grep -R "\\-pthread" *
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: -pthread havoc

    Here it is:

    missura@shakey:~/qtsdk-2009.03/qt/mkspecs$ grep -R "\\-pthread" *
    freebsd-g++/qmake.conf:QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE
    freebsd-g++/qmake.conf:QMAKE_LFLAGS_THREAD = -pthread
    freebsd-g++34/qmake.conf:QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE
    freebsd-g++34/qmake.conf:QMAKE_LFLAGS_THREAD = -pthread
    freebsd-g++40/qmake.conf:QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE
    freebsd-g++40/qmake.conf:QMAKE_LFLAGS_THREAD = -pthread
    netbsd-g++/qmake.conf:QMAKE_CFLAGS_THREAD = -pthread
    netbsd-g++/qmake.conf:QMAKE_LFLAGS_THREAD = -pthread
    openbsd-g++/qmake.conf:QMAKE_CFLAGS_THREAD = -pthread
    openbsd-g++/qmake.conf:QMAKE_LFLAGS_THREAD = -pthread
    qws/freebsd-generic-g++/qmake.conf:QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE
    qws/freebsd-generic-g++/qmake.conf:QMAKE_LFLAGS_THREAD = -pthread
    tru64-cxx/qmake.conf:QMAKE_CFLAGS_THREAD = -pthread
    tru64-cxx/qmake.conf:QMAKE_LFLAGS_THREAD = -pthread
    and also:
    missura@shakey:~/qtsdk-2009.03/qt/mkspecs$ cat /proc/version
    Linux version 2.6.24-27-generic (buildd@vernadsky) (gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)) #1 SMP Wed Jan 27 23:54:28 UTC 2010

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: -pthread havoc

    In that case the "-pthead havoc" doesn't come from qmake but rather from something else installed on your system. As you can see qmake would insert such statements only on tru64 and various bsd systems. Please check your /etc/ld.conf.so.d and /etc/ld.so.conf files, maybe one of them contains such statements.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: -pthread havoc

    Unfortunately there is nothing interesting there:

    missura@shakey:~$ cat /etc/ld.so.conf
    /lib/i486-linux-gnu
    /usr/lib/i486-linux-gnu
    /usr/local/lib

Similar Threads

  1. pthread instead QThread
    By brevleq in forum Qt Programming
    Replies: 8
    Last Post: 23rd December 2008, 07:16
  2. Inline functons causing Havoc
    By sunil.thaha in forum Qt Programming
    Replies: 4
    Last Post: 12th January 2006, 06:22

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.