Bug 208811 - devel/qt5-qmake: Qmake-Qt5 uses clang for linking instead of gcc/g++ specified in Netbeans toolchain
Summary: devel/qt5-qmake: Qmake-Qt5 uses clang for linking instead of gcc/g++ specifie...
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-15 00:04 UTC by nulluse
Modified: 2018-10-20 18:24 UTC (History)
4 users (show)

See Also:


Attachments
qt-Debug.mk (82.73 KB, text/plain)
2016-04-15 00:26 UTC, nulluse
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description nulluse 2016-04-15 00:04:45 UTC
For some reason instead of using g++ specified in Netbeans toolchain for C++ qmake-qt5 uses clang and that breaks compilation if -lquadmath option is used for gcc. Qmake should always use the specified tools.

Here is a build log under Fedora 19 Linux - notice use of g++ for linking

<pre>
cd '/home/user0/NetBeansProjects/MandelbrotQT'
/usr/bin/gmake -f Makefile CONF=Debug QMAKE=/bin/qmake-qt5
"/usr/bin/gmake" -f nbproject/Makefile-Debug.mk QMAKE=/bin/qmake-qt5 SUBPROJECTS= .build-conf
gmake[1]: Entering directory `/home/user0/NetBeansProjects/MandelbrotQT'
/bin/qmake-qt5 VPATH=. -o qttmp-Debug.mk nbproject/qt-Debug.pro
mv -f qttmp-Debug.mk nbproject/qt-Debug.mk
"/usr/bin/gmake" -f nbproject/qt-Debug.mk dist/Debug/GNU-Linux/MandelbrotQT
gmake[2]: Entering directory `/home/user0/NetBeansProjects/MandelbrotQT'
/usr/lib64/qt5/bin/uic newForm.ui -o ui_newForm.h
g++ -c -pipe -O3 -lquadmath -g -std=c++0x -Wall -W -D_REENTRANT -fPIE -DQT_WIDGETS_LIB -DQT_CONCURRENT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib64/qt5/mkspecs/linux-g++ -Inbproject -isystem /usr/local/include/qt5/QtConcurrent -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtConcurrent -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -I. -I. -I. -o build/Debug/GNU-Linux/main.o main.cpp
g++ -c -pipe -O3 -lquadmath -g -std=c++0x -Wall -W -D_REENTRANT -fPIE -DQT_WIDGETS_LIB -DQT_CONCURRENT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib64/qt5/mkspecs/linux-g++ -Inbproject -isystem /usr/local/include/qt5/QtConcurrent -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtConcurrent -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -I. -I. -I. -o build/Debug/GNU-Linux/newForm.cpp.o newForm.cpp.cc
newForm.cpp.cc:179:6: warning: unused parameter ‘pA’ [-Wunused-parameter]
 void newForm::handleRubberBandChanged(QRect r, QPointF pA, QPointF pB){
      ^
newForm.cpp.cc:179:6: warning: unused parameter ‘pB’ [-Wunused-parameter]
/usr/lib64/qt5/bin/moc -DQT_WIDGETS_LIB -DQT_CONCURRENT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib64/qt5/mkspecs/linux-g++ -I/home/user0/NetBeansProjects/MandelbrotQT/nbproject -I/usr/local/include/qt5/QtConcurrent -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtConcurrent -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I. -I/usr/include/c++/4.8.3 -I/usr/include/c++/4.8.3/x86_64-redhat-linux -I/usr/include/c++/4.8.3/backward -I/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include -I/usr/local/include -I/usr/include newForm.h -o moc_newForm.cpp
g++ -c -pipe -O3 -lquadmath -g -std=c++0x -Wall -W -D_REENTRANT -fPIE -DQT_WIDGETS_LIB -DQT_CONCURRENT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib64/qt5/mkspecs/linux-g++ -Inbproject -isystem /usr/local/include/qt5/QtConcurrent -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtConcurrent -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -I. -I. -I. -o build/Debug/GNU-Linux/moc_newForm.o moc_newForm.cpp
g++  -o dist/Debug/GNU-Linux/MandelbrotQT build/Debug/GNU-Linux/main.o build/Debug/GNU-Linux/newForm.cpp.o build/Debug/GNU-Linux/moc_newForm.o   -lQt5Widgets -lQt5Concurrent -lQt5Gui -lQt5Core -lGL -lpthread 
gmake[2]: Leaving directory `/home/user0/NetBeansProjects/MandelbrotQT'
gmake[1]: Leaving directory `/home/user0/NetBeansProjects/MandelbrotQT'

BUILD SUCCESSFUL (total time: 957ms)

And here is the log from PCBSD - notice the use of clang for linking:

cd '/usr/home/leo/NetBeansProjects/QtApplication_1'
/usr/local/bin/gmake -f Makefile CONF=Debug QMAKE=/usr/local/lib/qt5/bin/qmake
"/usr/local/bin/gmake" -f nbproject/Makefile-Debug.mk QMAKE=/usr/local/lib/qt5/bin/qmake SUBPROJECTS= .build-conf
gmake[1]: Entering directory '/usr/home/leo/NetBeansProjects/QtApplication_1'
/usr/local/lib/qt5/bin/qmake VPATH=. -o qttmp-Debug.mk nbproject/qt-Debug.pro
mv -f qttmp-Debug.mk nbproject/qt-Debug.mk
"/usr/local/bin/gmake" -f nbproject/qt-Debug.mk dist/Debug/GNU-Generic/QtApplication_1
gmake[2]: Entering directory '/usr/home/leo/NetBeansProjects/QtApplication_1'
/usr/local/lib/qt5/bin/uic newForm.ui -o ui_newForm.h
g++ -c -pipe -O3 -lquadmath -g -std=c++11 -Wall -W -pthread -D_THREAD_SAFE -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -Inbproject -I. -I../../../../local/include/qt5/QtConcurrent -I../../../../local/include/qt5 -I../../../../local/include/qt5/QtWidgets -I../../../../local/include/qt5/QtGui -I../../../../local/include/qt5/QtCore -I. -I../../../../local/include -I. -I../../../../local/include -I../../../../local/lib/qt5/mkspecs/freebsd-clang -o build/Debug/GNU-Generic/main.o main.cpp
g++ -c -pipe -O3 -lquadmath -g -std=c++11 -Wall -W -pthread -D_THREAD_SAFE -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -Inbproject -I. -I../../../../local/include/qt5/QtConcurrent -I../../../../local/include/qt5 -I../../../../local/include/qt5/QtWidgets -I../../../../local/include/qt5/QtGui -I../../../../local/include/qt5/QtCore -I. -I../../../../local/include -I. -I../../../../local/include -I../../../../local/lib/qt5/mkspecs/freebsd-clang -o build/Debug/GNU-Generic/newForm.cpp.o newForm.cpp.cc
newForm.cpp.cc:191:6: warning: unused parameter 'pA' [-Wunused-parameter]
 void newForm::handleRubberBandChanged(QRect r, QPointF pA, QPointF pB){
      ^
newForm.cpp.cc:191:6: warning: unused parameter 'pB' [-Wunused-parameter]
/usr/local/lib/qt5/bin/moc -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I/usr/local/lib/qt5/mkspecs/freebsd-clang -I/usr/home/leo/NetBeansProjects/QtApplication_1/nbproject -I/usr/local/include/qt5/QtConcurrent -I/usr/local/include/qt5 -I/usr/local/include/qt5/QtWidgets -I/usr/local/include/qt5/QtGui -I/usr/local/include/qt5/QtCore -I. -I/usr/include/c++/v1 -I/usr/include/clang/3.4.1 -I/usr/include newForm.h -o moc_newForm.cpp
g++ -c -pipe -O3 -lquadmath -g -std=c++11 -Wall -W -pthread -D_THREAD_SAFE -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -Inbproject -I. -I../../../../local/include/qt5/QtConcurrent -I../../../../local/include/qt5 -I../../../../local/include/qt5/QtWidgets -I../../../../local/include/qt5/QtGui -I../../../../local/include/qt5/QtCore -I. -I../../../../local/include -I. -I../../../../local/include -I../../../../local/lib/qt5/mkspecs/freebsd-clang -o build/Debug/GNU-Generic/moc_newForm.o moc_newForm.cpp
clang++ -pthread -Wl,-rpath,/usr/local/lib -o dist/Debug/GNU-Generic/QtApplication_1 build/Debug/GNU-Generic/main.o build/Debug/GNU-Generic/newForm.cpp.o build/Debug/GNU-Generic/moc_newForm.o   -L/usr/local/lib -lQt5Widgets -lQt5Gui -lQt5Concurrent -lQt5Core -lGL
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
build/Debug/GNU-Generic/newForm.cpp.o: In function `_ZN12QtConcurrent9MapKernelIPiZN7newForm18handleBtnCalculateEvEUlRiE_E12runIterationES1_iPv':
newForm.cpp.cc:(.text+0x157): undefined reference to `__extenddftf2'
newForm.cpp.cc:(.text+0x175): undefined reference to `__extenddftf2'
newForm.cpp.cc:(.text+0x1a9): undefined reference to `__gttf2'
newForm.cpp.cc:(.text+0x1c5): undefined reference to `__gttf2'
newForm.cpp.cc:(.text+0x1e7): undefined reference to `__multf3'
newForm.cpp.cc:(.text+0x202): undefined reference to `__multf3'
newForm.cpp.cc:(.text+0x211): undefined reference to `__subtf3'
newForm.cpp.cc:(.text+0x220): undefined reference to `__addtf3'
newForm.cpp.cc:(.text+0x239): undefined reference to `__addtf3'
newForm.cpp.cc:(.text+0x247): undefined reference to `__multf3'
newForm.cpp.cc:(.text+0x256): undefined reference to `__addtf3'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
nbproject/qt-Debug.mk:224: recipe for target 'dist/Debug/GNU-Generic/QtApplication_1' failed
gmake[2]: *** [dist/Debug/GNU-Generic/QtApplication_1] Error 1
gmake[2]: Leaving directory '/usr/home/leo/NetBeansProjects/QtApplication_1'
nbproject/Makefile-Debug.mk:65: recipe for target '.build-conf' failed
gmake[1]: *** [.build-conf] Error 2
gmake[1]: Leaving directory '/usr/home/leo/NetBeansProjects/QtApplication_1'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
gmake: *** [.build-impl] Error 2
</pre>
Comment 1 nulluse 2016-04-15 00:26:13 UTC
Created attachment 169326 [details]
qt-Debug.mk

Apparently the attached file, generated by qmake-qt5, contains link command that uses clang instead of gcc/g++ specified in Netbeans C++ tool chain:

LINK          = clang++
LFLAGS        = -pthread -Wl,-rpath,/usr/local/lib

For some reason FreeBSD port of Qt5 has qmake that wants to use a different tool.
Comment 2 nulluse 2016-04-18 17:02:09 UTC
Additional info: After blowing away PCBSD 10.3 and installing FreeBSD 10.1 instead the bug is still there.
Comment 3 Marie Loise Nolden 2016-05-29 12:09:00 UTC
This will always be the case as long as you use a qt build on 10.x which uses clang by default, so qmake will be using the mkspecs for clang in any qt-related builds on 10.3.

Can you specify your netbeans build environment setup how to reproduce the process until you use Qt5 ?
Comment 4 Walter Schwarzenfeld freebsd_triage 2018-02-01 08:12:36 UTC
Feedback timeout?
Comment 5 Adriaan de Groot freebsd_committer freebsd_triage 2018-08-20 08:04:36 UTC
Feedback timeout; if there's an underlying issue it is that Qt (qmake) uses the mkspecs to set up the toolchain, and the default toolchain is set when Qt is compiled. You can change toolchains for Qt by changing QMAKESPEC or passing -spec to qmake when it generates the makefile. However, that's independent of things like CC and CXX in the environment: right now, Qt5 knows about "clang" and "gcc" and none of the suffixed versions.
Comment 6 Tobias C. Berner freebsd_committer freebsd_triage 2018-10-20 18:24:43 UTC
For GCC using architectures Qt/Qmake will now chose gcc${GCC_DEFAULT} -- if you need/want to use the same work around on a clang-architecture, you could fiddle a bit in qt-dist.mk to get the same fix. 

Please reopen if this is still important.

mfg Tobias