protobuf generated files does not compile on Solaris SPARC 64

雨燕双飞 提交于 2019-12-11 13:10:18

问题


I am trying to compile some generated proto.cc files on Solaris 10 SPARC 64.

And I get these errors:

"/apps/pkgs/studio-11.0.13/prod/include/CC/stlport4/stl/_alloc.h", line 134: Error: The function "__stl_new" must have a prototype.
"/apps/pkgs/studio-11.0.13/prod/include/CC/stlport4/stl/_alloc.h", line 135: Error: The function "__stl_delete" must have a prototype.
"/apps/pkgs/studio-11.0.13/prod/include/CC/stlport4/./stdexcept", line 52: Error: _STLP_EXCEPTION_BASE is not defined.

Compiler flags are:

/apps/pkgs/studio-11.0.13/prod/bin/CC -xarch=v9 -library=stlport4 -library=Crun -features=no%conststrings -library=no%rwtools7 -erroff=nonewline

protobuf compiler flags:

CXXFLAGS = -xmemalign=8s -g0 -xO3 -xlibmil -xdepend -xbuiltin -mt -compat=5 -library=stlport4 -library=Crun -template=no%extdef  -DNDEBUG -m64 -xarch=v9 

protobuf was compiled successfully(all tests passed)

Thanks, Bogdan


回答1:


Ok, so it seams that our code is build with native stl, which means we cannot link it with protobuf build with stlport4. So I had to build protobuf with native stl.

Here are the steps:

1. You have to apply these patches: https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/protobuf/trunk/files/

2.Run ./configure with these parameters:

./configure LDFLAGS=-L$PWD/src/solaris --disable-64bit-solaris --prefix=/bogdan/protobuf-2.4.1

If you want to build it on SPARC 64, remove --disable-64bit-solaris and edit protobuf-2.4.1/src/solaris/libstdc++.la file to add the correct dependecies to the linker.

3. Run: make, make check and make install

Regards, Bogdan



来源:https://stackoverflow.com/questions/8167424/protobuf-generated-files-does-not-compile-on-solaris-sparc-64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!