Linking Errors Using Sun Studio 12.1 on SPARC

225 views
Skip to first unread message

Hering

unread,
May 28, 2010, 2:25:37 PM5/28/10
to Protocol Buffers
Hi,

I am trying to build versions 2.3.0 and 2.3.0rc2 with Sun Studio 12
Update 1 compiler on a Solaris SPARC box without success. The
compilation goes well but the linking phase fails for both versions:

$ ( distro="/GAAL/chenher/share/protobuf/distro-sparc-2.3.0rc2-64bit";
rm -rf ${distro}; sunstudio_home="/GAAL/chenher/share/sunstudio12.1";
export PATH="/GAAL/chenher/bin:${JAVA_HOME}/bin:${sunstudio_home}/bin:/
bin:/usr/bin:/usr/ccs/bin:/sbin:/usr/ucb:"; export LD_LIBRARY_PATH="/
GAAL/chenher/share/sunstudio12.1/lib"; export CFLAGS="-m64 -
xcode=pic32"; export CXXFLAGS="-m64 -xcode=pic32 -library=stlport4 -
template=no%extdef"; export LDFLAGS="-m64"; ./configure --prefix=$
{distro} "CFLAGS=${CFLAGS}" "CXXFLAGS=${CXXFLAGS}" "LDFLAGS=$
{LDFLAGS}" )
...

$ make clean all check install
...
libtool: compile: CC -DHAVE_CONFIG_H -I. -I.. -D_REENTRANT -
xmemalign=8s -m64 -xcode=pic32 -library=stlport4 -template=no%extdef -
c google/protobuf/compiler/parser.cc -o parser.o >/dev/null 2>&1
/bin/bash ../libtool --tag=CXX --mode=link CC -D_REENTRANT -
xmemalign=8s -m64 -xcode=pic32 -library=stlport4 -template=no%extdef -
version-info 6:0:0 -export-dynamic -no-undefined -m64 -o
libprotobuf.la -rpath /GAAL/chenher/share/protobuf/distro-
sparc-2.3.0rc2-64bit/lib/sparcv9 common.lo once.lo hash.lo
extension_set.lo generated_message_util.lo message_lite.lo
repeated_field.lo wire_format_lite.lo coded_stream.lo
zero_copy_stream.lo zero_copy_stream_impl_lite.lo strutil.lo
substitute.lo structurally_valid.lo descriptor.lo descriptor.pb.lo
descriptor_database.lo dynamic_message.lo extension_set_heavy.lo
generated_message_reflection.lo message.lo reflection_ops.lo
service.lo text_format.lo unknown_field_set.lo wire_format.lo
gzip_stream.lo printer.lo tokenizer.lo zero_copy_stream_impl.lo
importer.lo parser.lo -lpthread -lz
libtool: link: CC -G -zdefs -hlibprotobuf.so.6 -o .libs/libprotobuf.so.
6.0.0 .libs/common.o .libs/once.o .libs/hash.o .libs/
extension_set.o .libs/generated_message_util.o .libs/
message_lite.o .libs/repeated_field.o .libs/wire_format_lite.o .libs/
coded_stream.o .libs/zero_copy_stream.o .libs/
zero_copy_stream_impl_lite.o .libs/strutil.o .libs/substitute.o .libs/
structurally_valid.o .libs/descriptor.o .libs/descriptor.pb.o .libs/
descriptor_database.o .libs/dynamic_message.o .libs/
extension_set_heavy.o .libs/generated_message_reflection.o .libs/
message.o .libs/reflection_ops.o .libs/service.o .libs/
text_format.o .libs/unknown_field_set.o .libs/wire_format.o .libs/
gzip_stream.o .libs/printer.o .libs/tokenizer.o .libs/
zero_copy_stream_impl.o .libs/importer.o .libs/parser.o -
library=stlport4 -lpthread -lz -lc -m64 -m64
Undefined first referenced
symbol in file
void __Crun::pure_error() .libs/common.o (symbol belongs to
implicit dependency /nfsdata/taqstore-tr18/chenher/share/sunstudio12.1/
lib/sparc/64/libCrun.so.1)
void*__Crun::simple_down_cast(void*,const
__Crun::static_type_info*,const __Crun::static_type_info*) .libs/
descriptor.o (symbol belongs to implicit dependency /nfsdata/taqstore-
tr18/chenher/share/sunstudio12.1/lib/sparc/64/libCrun.so.1)
void*operator new(unsigned long,void*) .libs/
common.o (symbol belongs to implicit dependency /nfsdata/taqstore-
tr18/chenher/share/sunstudio12.1/lib/sparc/64/libCrun.so.1)
void __Crun::ex_rethrow_q() .libs/common.o (symbol belongs to
implicit dependency /nfsdata/taqstore-tr18/chenher/share/sunstudio12.1/
lib/sparc/64/libCrun.so.1)
void __Crun::register_exit_code(void(*)()extern"C") .libs/
descriptor.o (symbol belongs to implicit dependency /nfsdata/taqstore-
tr18/chenher/share/sunstudio12.1/lib/sparc/64/libCrun.so.1)
bool __Crun::ex_skip() .libs/extension_set.o (symbol
belongs to implicit dependency /nfsdata/taqstore-tr18/chenher/share/
sunstudio12.1/lib/sparc/64/libCrun.so.1)
void __Crun::ex_clean() .libs/extension_set.o (symbol
belongs to implicit dependency /nfsdata/taqstore-tr18/chenher/share/
sunstudio12.1/lib/sparc/64/libCrun.so.1)
void __Crun::ex_rethrow() .libs/extension_set.o (symbol
belongs to implicit dependency /nfsdata/taqstore-tr18/chenher/share/
sunstudio12.1/lib/sparc/64/libCrun.so.1)
void operator delete(void*,void*) .libs/
extension_set.o (symbol belongs to implicit dependency /nfsdata/
taqstore-tr18/chenher/share/sunstudio12.1/lib/sparc/64/libCrun.so.1)
void*operator new[](unsigned long) .libs/
extension_set.o (symbol belongs to implicit dependency /nfsdata/
taqstore-tr18/chenher/share/sunstudio12.1/lib/sparc/64/libCrun.so.1)
void*operator new(unsigned long) .libs/common.o
(symbol belongs to implicit dependency /nfsdata/taqstore-tr18/chenher/
share/sunstudio12.1/lib/sparc/64/libCrun.so.1)
void operator delete[](void*) .libs/
extension_set.o (symbol belongs to implicit dependency /nfsdata/
taqstore-tr18/chenher/share/sunstudio12.1/lib/sparc/64/libCrun.so.1)
void operator delete(void*) .libs/common.o
(symbol belongs to implicit dependency /nfsdata/taqstore-tr18/chenher/
share/sunstudio12.1/lib/sparc/64/libCrun.so.1)
ld: fatal: Symbol referencing errors. No output written to .libs/
libprotobuf.so.6.0.0
make[2]: *** [libprotobuf.la] Error 1
make[2]: Leaving directory `/nfsdata/taqstore-tr13/chenher/share/
protobuf/protobuf-2.3.0rc2/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/nfsdata/taqstore-tr13/chenher/share/
protobuf/protobuf-2.3.0rc2'
make: *** [all] Error 2

Using the same environment, I am able to compile and link a simple
test program (obviously, this is not a shared library):

$ cat hello.cc
#include <iostream>
int main() { std::cout << "Hello\n"; }

$ ( sunstudio_home="/GAAL/chenher/share/sunstudio12.1"; export PATH="/
GAAL/chenher/bin:${JAVA_HOME}/bin:${sunstudio_home}/bin:/bin:/usr/bin:/
usr/ccs/bin:/sbin:/usr/ucb:"; export LD_LIBRARY_PATH="$
{sunstudio_home}/lib"; echo $LD_LIBRARY_PATH; CC -m64 -template=no
%extdef -library=stlport4 hello.cc )
/GAAL/chenher/share/sunstudio12.1/lib

$ ldd a.out
libstlport.so.1 => /nfsdata/taqstore-tr18/chenher/share/
sunstudio12.1/lib/stlport4/v9/libstlport.so.1
librt.so.1 => /lib/sparcv9/librt.so.1
libCrun.so.1 => /nfsdata/taqstore-tr18/chenher/share/
sunstudio12.1/lib/sparc/64/libCrun.so.1
libm.so.2 => /lib/sparcv9/libm.so.2
libc.so.1 => /lib/sparcv9/libc.so.1
libaio.so.1 => /lib/64/libaio.so.1
libmd.so.1 => /lib/64/libmd.so.1
/platform/SUNW,Sun-Fire-V890/lib/sparcv9/libc_psr.so.1
/platform/SUNW,Sun-Fire-V890/lib/sparcv9/libmd_psr.so.1

Does anyone have working commands that I can do to build?

Thanks.

Kenton Varda

unread,
Jun 3, 2010, 6:14:13 PM6/3/10
to Hering, Monty Taylor, Protocol Buffers

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.


Monty Taylor

unread,
Jun 3, 2010, 6:23:19 PM6/3/10
to Kenton Varda, Hering, Monty Taylor, Protocol Buffers
On 06/03/2010 03:14 PM, Kenton Varda wrote:
>
>
> On Fri, May 28, 2010 at 11:25 AM, Hering <hering...@computer.org
> <mailto:hering...@computer.org>> wrote:
>
> Hi,
>
> I am trying to build versions 2.3.0 and 2.3.0rc2 with Sun Studio 12
> Update 1 compiler on a Solaris SPARC box without success. The
> compilation goes well but the linking phase fails for both versions:
>
> $ ( distro="/GAAL/chenher/share/protobuf/distro-sparc-2.3.0rc2-64bit";
> rm -rf ${distro}; sunstudio_home="/GAAL/chenher/share/sunstudio12.1";
> export PATH="/GAAL/chenher/bin:${JAVA_HOME}/bin:${sunstudio_home}/bin:/
> bin:/usr/bin:/usr/ccs/bin:/sbin:/usr/ucb:"; export LD_LIBRARY_PATH="/
> GAAL/chenher/share/sunstudio12.1/lib"; export CFLAGS="-m64 -
> xcode=pic32"; export CXXFLAGS="-m64 -xcode=pic32 -library=stlport4 -
> template=no%extdef"; export LDFLAGS="-m64"; ./configure --prefix=$
> {distro} "CFLAGS=${CFLAGS}" "CXXFLAGS=${CXXFLAGS}" "LDFLAGS=$
> {LDFLAGS}" )
> ...

Have you tried building it without injecting these extra CFLAGS and
CXXFLAGS? We've already got code in protobuf configure which builds with
stlport no%extdef. (We build with Sun Studio on Sparc and link to our
own project as part of the Drizzle project) ... I can't say for sure
_why_ you adding those flags in that way there would break - but if you
wouldn't mind trying it with no CFLAGS, CXXFLAGS or LDFLAGS in your env
and seeing if it works for you, I'd appreciate it - it will help track
down where the problem is for you.

> $ make clean all check install
> ...
> libtool: compile: CC -DHAVE_CONFIG_H -I. -I.. -D_REENTRANT -
> xmemalign=8s -m64 -xcode=pic32 -library=stlport4 -template=no%extdef -
> c google/protobuf/compiler/parser.cc -o parser.o >/dev/null 2>&1
> /bin/bash ../libtool --tag=CXX --mode=link CC -D_REENTRANT -
> xmemalign=8s -m64 -xcode=pic32 -library=stlport4 -template=no%extdef -
> version-info 6:0:0 -export-dynamic -no-undefined -m64 -o

> libprotobuf.la <http://libprotobuf.la> -rpath

> make[2]: *** [libprotobuf.la <http://libprotobuf.la>] Error 1

> <mailto:prot...@googlegroups.com>.


> To unsubscribe from this group, send email to
> protobuf+u...@googlegroups.com

> <mailto:protobuf%2Bunsu...@googlegroups.com>.

Reply all
Reply to author
Forward
0 new messages