Bug 201891 - Qt Project passes GNU options to Solaris Studio
Qt Project passes GNU options to Solaris Studio
Status: VERIFIED FIXED
Product: cnd
Classification: Unclassified
Component: Project
7.0
PC Linux
: P2 (vote)
: 7.1
Assigned To: igor_nikiforov
issues@cnd
701patch2-verified, elif
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-09 14:09 UTC by Leonid Lenyashin
Modified: 2011-09-27 11:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leonid Lenyashin 2011-09-09 14:09:43 UTC
On Linux create a "Hello Qt World" sample project. Make sure that Studio is the selected toolchain. Try to build:

dmake: defaulting to parallel mode.
See the man page dmake(1) for more information on setting up the .dmakerc file.
lsl-ThinkPad-X201s --> 1 job
lsl-ThinkPad-X201s --> 2 jobs
"/home/leonid/solstudiodev/bin/dmake" -f nbproject/Makefile-Debug.mk QMAKE=/usr/bin/qmake-qt4 SUBPROJECTS= .clean-conf
lsl-ThinkPad-X201s --> 1 job
/usr/bin/qmake-qt4 VPATH=. -o qttmp-Debug.mk nbproject/qt-Debug.pro
mv -f qttmp-Debug.mk nbproject/qt-Debug.mk
/home/leonid/solstudiodev/bin/dmake -f nbproject/qt-Debug.mk distclean
lsl-ThinkPad-X201s --> 1 job
rm -f moc_HelloForm.cpp
lsl-ThinkPad-X201s --> 2 jobs
rm -f ui_HelloForm.h
lsl-ThinkPad-X201s --> 1 job
rm -f build/Debug/OracleSolarisStudio-Linux-x86/HelloForm.o  build/Debug/OracleSolarisStudio-Linux-x86/newmain.o  build/Debug/OracleSolarisStudio-Linux-x86/moc_HelloForm.o
rm -f *~ core *.core
lsl-ThinkPad-X201s --> 1 job
rm -f dist/Debug/OracleSolarisStudio-Linux-x86/HelloQtWorld_1 
rm -f qttmp-Debug.mk

CLEAN SUCCESSFUL (total time: 457ms)
dmake: defaulting to parallel mode.
See the man page dmake(1) for more information on setting up the .dmakerc file.
"/home/leonid/solstudiodev/bin/dmake" -f nbproject/Makefile-Debug.mk QMAKE=/usr/bin/qmake-qt4 SUBPROJECTS= .build-conf
/usr/bin/qmake-qt4 VPATH=. -o qttmp-Debug.mk nbproject/qt-Debug.pro
mv -f qttmp-Debug.mk nbproject/qt-Debug.mk
"/home/leonid/solstudiodev/bin/dmake" -f nbproject/qt-Debug.mk dist/Debug/OracleSolarisStudio-Linux-x86/HelloQtWorld_1
/usr/bin/uic-qt4 HelloForm.ui -o ui_HelloForm.h
CC -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -Inbproject -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -Inbproject -I. -o build/Debug/OracleSolarisStudio-Linux-x86/HelloForm.o HelloForm.cpp
CC -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -Inbproject -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -Inbproject -I. -o build/Debug/OracleSolarisStudio-Linux-x86/newmain.o newmain.cpp
CC -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -Inbproject -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -Inbproject -I. -o build/Debug/OracleSolarisStudio-Linux-x86/newmain.o newmain.cpp
CC: Warning: Option -pipe passed to ld, if ld is invoked, ignored otherwise
CC: -W option with unknown program all
*** Error code 1
dmake: Fatal error: Command failed for target `build/Debug/OracleSolarisStudio-Linux-x86/newmain.o'
Current working directory /home/leonid/SolStudioProjects/HelloQtWorld_1
Waiting for 1 job to finish
CC -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -Inbproject -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -Inbproject -I. -o build/Debug/OracleSolarisStudio-Linux-x86/HelloForm.o HelloForm.cpp
CC: Warning: Option -pipe passed to ld, if ld is invoked, ignored otherwise
CC: -W option with unknown program all
*** Error code 1
dmake: Warning: Command failed for target `build/Debug/OracleSolarisStudio-Linux-x86/HelloForm.o'
Current working directory /home/leonid/SolStudioProjects/HelloQtWorld_1
*** Error code 1
dmake: Fatal error: Command failed for target `.build-conf'
Current working directory /home/leonid/SolStudioProjects/HelloQtWorld_1
*** Error code 1
dmake: Fatal error: Command failed for target `.build-impl'

BUILD FAILED (exit value 1, total time: 473ms)

This is crazy as:
-pipe is not supported by Studio
-Wall is something close to Studio's +w or +w2  
-W (old form of gnu's -Wextra) is part of Studio +w2 I assume.

This is a stopper for any Qt work in Studio on Linux (I've not checked Solaris)
Comment 1 yuriy_lalym 2011-09-09 22:14:35 UTC
mkspecs/linux-g++ and CC - ? How there can correspond options?

CC not linked Qt.so-files created gcc. It is news?
Comment 2 igor_nikiforov 2011-09-19 10:40:23 UTC
The Qt support is implemented the following way:
  1. IDE generates the .pro file with some Qt qmake options
  2. IDE executes qmake with the generated Qt file as a parameter.    

qmake uses so-called "specs", to understand what compiler options should be used for different platform compilers in different situations.
Here is the specs list from Ubuntu 8.04 system with Qt 4.3.4 installed (located in /usr/share/qt4/mkspecs)
linux-ecc-64
linux-g++
linux-g++-32
linux-g++-64
linux-icc
linux-icc-32
linux-icc-64
linux-kcc
linux-lsb-g++
linux-pgcc

As you can see this list don't contains spec for OSS on Linux. I've filed Suggestion on Qt to add this spec to the distribution:
Here is the link:
    https://bugreports.qt.nokia.com/browse/QTBUG-21526

On Solaris 10 Qt 4.4.4 from blastwave.org supports the following specs:
solaris-cc
solaris-cc-64
solaris-g++
solaris-g++-64

"solaris-cc" or "solaris-cc-64" are OSS spec to be used.

The minor problem with Qt support on Solaris is the following:
    1. Add OSS to path and start IDE.
    2. Create Qt sample.
    3. Try to build it. The following error message will appear in output:
        QMAKESPEC has not been set, so configuration cannot be deduced.
        Error processing project file: nbproject/qt-Debug.pro

To resolve that user should go to  Project Properties->QT and set spec property to "solaris-cc" or "solaris-cc-64". After that both build and run work will work fine.

So on Solaris if OSS toolchain is used and user haven't set spec Project Property the -spec should be passed to qmake with "solaris-cc" value.
Comment 3 igor_nikiforov 2011-09-19 10:47:06 UTC
The described Solaris issue fix is here:
http://hg.netbeans.org/cnd-main/rev/96daf0c83a78
Comment 4 Alexander Simon 2011-09-19 13:08:54 UTC
Fix correct (for solaris+OSS) and safe.
One note:
It would be nice to set default qmakespec in all OSS tool collection flavors.
Comment 5 dnikitin 2011-09-26 09:16:13 UTC
verified in Build oss-platform-build-66-on-20110921
Comment 6 dnikitin 2011-09-27 11:03:06 UTC
verified in patch2 (NetBeans IDE 7.0.1 (Build 201109261118))


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo