This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 201891

Summary: Qt Project passes GNU options to Solaris Studio
Product: cnd Reporter: Leonid Lenyashin <lsl239>
Component: ProjectAssignee: igor_nikiforov <igor_nikiforov>
Status: VERIFIED FIXED    
Severity: normal    
Priority: P2    
Version: 7.0   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

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))