Bug 204993 - fails to build with -g compiler option
Summary: fails to build with -g compiler option
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: 4.3
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-24 18:30 UTC by tropikhajma
Modified: 2010-03-10 20:44 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tropikhajma 2009-08-24 18:30:45 UTC
Version:            (using KDE 4.3.0)
Compiler:          Sun Studio 12 U1 
OS:                Solaris
Installed from:    Compiled From Sources

The code that is used to detect if Qt was built with SSL support (kdecore/network/ConfigureChecks.cmake) fails when the '-g' option is passed to the Sun Studio compiler. According to similar issue discussed at http://forums.sun.com/thread.jspa?threadID=5388956, some headers may be missing somewhere.

Without the flag:
$ /opt/sunstudio12.1/bin/CC  -library=no%Cstd -library=Crun    -I/opt/foss/include/stdcxx       -Qoption ccfe -features=gcc   -DHAVE_QSSLSOCKET -I/opt/foss/qt4/include   -o cxx.o -c src.cxx   
test2@opensolaris:~$ /opt/sunstudio12.1/bin/CC  -library=no%Cstd -library=Crun  -I/opt/foss/include/stdcxx   -Qoption ccfe -features=gcc     -DHAVE_QSSLSOCKET   cxx.o  -o cmTryCompileExec

************************************
With the flag:
$ /opt/sunstudio12.1/bin/CC  -library=no%Cstd -library=Crun    -I/opt/foss/include/stdcxx       -Qoption ccfe -features=gcc   -DHAVE_QSSLSOCKET -I/opt/foss/qt4/include   -o cxx.o -c src.cxx -g
$ /opt/sunstudio12.1/bin/CC  -library=no%Cstd -library=Crun  -I/opt/foss/include/stdcxx   -Qoption ccfe -features=gcc     -DHAVE_QSSLSOCKET   cxx.o  -o cmTryCompileExec   -g
Undefined			first referenced
 symbol  			    in file
QByteArray::shared_null      cxx.o
[Hint: static member QByteArray::shared_null must be defined in the program]

void qFree(void*)                   cxx.o
QSslCertificate::QSslCertificate(const QByteArray&,QSsl::EncodingFormat) cxx.o
q_atomic_decrement                  cxx.o
q_atomic_increment                  cxx.o
ld: fatal: symbol referencing errors. No output written to cmTryCompileExec

I had to add '-L/opt/foss/qt4/lib -lQtCore -lQtNetwork' to the CXXFLAGS to get past the check
Comment 1 tropikhajma 2009-11-12 00:47:38 UTC
still valid in 4.3.74
Comment 2 tropikhajma 2010-03-10 05:29:04 UTC
still valid in 4.4.1
Comment 3 Allen Winter 2010-03-10 20:44:34 UTC
SVN commit 1101739 by winterz:

add the QtCore and QtNetwork libraries to the CMAKE_REQUIRED_LIBRARIES
when doing try compiles. 
Might fix building with -g on Sun Studio12

tropikhajma, please test and let me know if this works.
if it does, we can forward port to trunk.
BUG: 204993


 M  +1 -0      ConfigureChecks.cmake  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1101739