|| | |||Browse by category|
Multithreaded and shared buildtypes of Rogue Wave libraries fail to build when using the g++ compiler on the Solaris operating system.
The shared library buildtype fails to build with the following error:
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
The multithreaded buildtype fails to build with the following error:
cc1plus: Invalid option `t'
make: *** [bintree.o] Error 1
When trying to build the shared library, the linker fails because it tries to use the command g++ -shared. Although this command works with the SunPro compiler (CC -shared) and on many platforms, it fails with the g++ compiler and on Solaris and SunOS.
When trying to build the multithreaded build type, the standard Solaris option for multithreaded is -mt. This flag is used with the SunPro compiler, but is not recognized by the g++ compiler.
To fix these problems, you must modify two comptests as shown below. After you have made the changes, remove the workspaces directory and rebuild the libraries. Be sure to use the correct platform file: solaris_gnu.in
Here is a sample command line build:
rwspm -d -t7 -f solaris_gnu.in -p/build/spm/parts/tls0711u -w /build/spm/workspaces/SOLARIS7/GNU/7d
To fix the shared library problem, you must edit the file /scripts/comptest/test015 as shown below. The new lines are in red.
128: if test '$cppname' = 'g++'; then
129: case '$RWOS' in
137: if test 'X$try_rwsharedopts' != 'X'; then
140: try_rwshared_ldopts='-shared $try_rwsharedopts'
142: # use try_shared_lib_extension set on basis of RWOS
To fix the multithread problem, you must edit the file /scripts/comptest/test018 as shown below. The new lines are in red.
450: case $THREADS_TYPE in
453: case $RWCOMPILER in
463: rwmtlibs='-ldce -lpthread'
465: Solaris | SOLARIS)
466: case $RWCOMPILER in