Thanks. That helped a lot (except for -lposix4 and lang=c99 - those weren't too
good, and I had to quote the CPP flags).
I am now using:
CC="/opt/sun/sunstudio12/bin/c99"
declare -x CFLAGS=" -Xc -erroff=%all -errshort=full -errfmt=error
-errwarn=%none -xO3 -s -xjobs=2 -xregs=no%frameptr -xprefetch=auto
-xprefetch_auto_type=indirect_array_access -xprefetch_level=3 -xbuiltin=%all
-xcsi -xinline=%all -xustr=ascii_utf16_ushort -z combreloc -z redlocsym -z
nodefaultlib -z now -z rescan -z absexec -xildoff -xldscope=symbolic
-xrestrict=%all -xF=%none -xalias_level=std -xthreadvar -lc -lpthread -lrt -mt
-D_REENTRANT -D__EXTENSIONS__=1 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_XPG4 -D_XPG4_2 -D_XPG5 -D_XPG6 -D_POSIX_PTHREAD_SEMANTICS
-D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L -D_STDC_C99 -xtarget=pentium4
-xarch=sse2 -xchip=pentium4 -xcache=8/64/4:256/128/8"
CPPFLAGS="-I/opt/sun/sunstudio12/prod/include/CC
-I/opt/sun/sunstudio12/prod/include/CC/Cstd"
CXX="/opt/sun/sunstudio12/bin/CC"
CXXFLAGS=" -features=%all,extensions,tmplife,tmplrefstatic -instances=global
-template=geninlinefuncs -verbose=template -g -xustr=ascii_utf16_ushort -z
combreloc -z redlocsym -z nodefaultlib -z now -z rescan -z absexec
-xldscope=symbolic -Qoption ccfe -complextmplexp -Qoption ccfe -features=gcc
-xildoff -lc -lpthread -lrt -mt -D_REENTRANT -KPIC -D__EXTENSIONS__=1
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_XPG4 -D_XPG4_2 -D_XPG5 -D_XPG6 "
LDFLAGS=" -L/opt/sun/sunstudio12/prod/lib -lCrun -lCstd "
There is still a problem though - cmake is still putting the wrong options into
the build.
I found out the cause though - we need to add extra support to cmake for Linux
with the c99 and CC compilers. [Roughly what happens is that it checks uname -s
(in my case, "Linux", and loads the platform settings from
cmake/Modules/Platform/Linux, and then it tries the basename of the compiler
(e.g. c99) and sees if there is a file called cmake/Modules/Linux-c99, and then
loads that. n.B. cmake ships with Linux-ifort.cmake, Linux-icpc.cmake and
Linux-como.cmake, amongst others. Because there is no Linux-c99.cmake, the
platforms definitions come from Linux.cmake, which assumes gcc.
I scratched around and found a SunOS.cmake, removed all the gcc bits, and
turned it into Linux-c99.cmake (and symlinked that to Linux-CC.cmake). It is
attached.
Now it gets through the configure steps.
The next problem is:
"/opt/qt43/include/QtCore/qatomic.h", line 111: Warning: value hides
QBasicAtomic::value.
"/opt/qt43/include/QtCore/qatomic.h", line 111: Error: The function
"q_atomic_fetch_and_add_int" must have a prototype.
"/opt/qt43/include/QtCore/qatomic.h", line 114: Warning: value hides
QBasicAtomic::value.
"/opt/qt43/include/QtCore/qatomic.h", line 114: Error: The function
"q_atomic_fetch_and_add_acquire_int" must have a prototype.
"/opt/qt43/include/QtCore/qatomic.h", line 117: Warning: value hides
QBasicAtomic::value.
"/opt/qt43/include/QtCore/qatomic.h", line 117: Error: The function
"q_atomic_fetch_and_add_release_int" must have a prototype.
This is being caused by some conditional code in QtCore/qatomic_i386.h, which
basically looks like:
#if defined(Q_CC_GNU) || defined(Q_CC_INTEL)
inline int q_atomic_fetch_and_add_int(volatile int *ptr, int value)
{
asm volatile("lock\n"
"xaddl %0,%1"
: "=r" (value), "+m" (*ptr)
: "0" (value)
: "memory");
return value;
}
// some other definitions
#else
// some other definitions - no q_atomic_fetch_and_add_int!
#endif
I think that is probably a Qt bug (noting that sunstudio isn't a supported
compiler on Linux).
I think that there are probably two issues: I need to add c99/CC support to
cmake for the Linux platform, and the qatomic.h problem.
Thanks again.
--
This message posted from opensolaris.org