PDA

View Full Version : -pthread havoc



Cruz
9th March 2010, 09:54
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

wysota
9th March 2010, 10:59
What does it contain exactly?

Cruz
9th March 2010, 11:54
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

wysota
9th March 2010, 13:52
What if you change this:
QT += core \
gui \
xml \
opengl
to this:
QT = core \
gui \
xml \
opengl

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.

Cruz
9th March 2010, 14:04
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.

wysota
9th March 2010, 14:49
Please run the following code from your console and paste the result:


cd /home/missura/qtsdk-2009.03/qt/mkspecs
grep -R "\\-pthread" *

Cruz
10th March 2010, 10:35
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

wysota
10th March 2010, 11:17
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.

Cruz
10th March 2010, 13:22
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