VMware {code} Community
Saurabh20111014
Contributor
Contributor

vSphere SDK compilation fails with gSOAP and Power-PC compiler

Hello VmWARE Gurus,

I am developing a vCenter application in C++ and using gSOAP to generate the C++ SDK from vCenter WSDL file.

SDK version: vSphere Web Services SDK 4.0

gSOAP version: gSOAP 2.8.3

powerpc-linux-g++: 3.4.6

gSOAP tools generate 2 cpp files:

-rw-r--r--   1 xxxx yyyy 52336045 Aug 25 22:23 soapC.cpp                      -> 52 MB

-rw-r--r--   1 xxxx yyyy  1033108 Aug 25 22:23 soapVimBindingProxy.cpp

When I try compiling these files and build my application, I get these linker errors:

powerpc-linux-g++ -g -O1 objs/vcenterClient.o objs/soapC.o objs/soapVimBindingProxy.o objs/stdsoap2.o  -lssl -lcrypto -o vcenterClient

powerpc-linux/lib/crt1.o: In function `_start':

init.c:(.text+0x20): relocation truncated to fit: R_PPC_REL24 against symbol `__libc_start_main@@GLIBC_2.0' defined in .plt section in powerpc-linux/lib/gcc/powerpc-linux/3.4.6/../../../../powerpc-linux/lib/crt1.o

powerpc-linux/3.4.6/../../../../powerpc-linux/lib/crti.o: In function `call_gmon_start':

powerpc-linux/gcc-3.4.6-glibc-2.3.6/build-glibc/csu/crti.S:16: relocation truncated to fit: R_PPC_LOCAL24PC against symbol `_GLOBAL_OFFSET_TABLE_' defined in .got section in powerpc-linux/lib/gcc/powerpc-linux/3.4.6/../../../../powerpc-linux/lib/crt1.o+fffffffc

objs/vcenterClient.o: In function `std::__verify_grouping(char const*, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':

vcenterClient.cpp:(.text+0x24): relocation truncated to fit: R_PPC_REL24 against symbol `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const@@GLIBCXX_3.4' defined in .plt section in powerpc-linux/3.4.6/../../../../powerpc-linux/lib/crt1.o

vcenterClient.cpp:(.text+0xa0): relocation truncated to fit: R_PPC_REL24 against symbol `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const@@GLIBCXX_3.4' defined in .plt section in powerpc-linux/lib/gcc/powerpc-linux/3.4.6/../../../../powerpc-linux/lib/crt1.o

vcenterClient.cpp:(.text+0x114): relocation truncated to fit: R_PPC_REL24 against symbol `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const@@GLIBCXX_3.4' defined in .plt section in powerpc-linux/lib/gcc/powerpc-linux/3.4.6/../../../../powerpc-linux/lib/crt1.o

vcenterClient.cpp:(.text+0x160): relocation truncated to fit: R_PPC_REL24 against symbol `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const@@GLIBCXX_3.4' defined in .plt section in powerpc-linux/lib/gcc/powerpc-linux/3.4.6/../../../../powerpc-linux/lib/crt1.o

objs/vcenterClient.o: In function `sigpipe_handle(int)':

vcenterClient.cpp:(.text+0x1fc): relocation truncated to fit: R_PPC_REL24 against symbol `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)@@GLIBCXX_3.4' defined in .plt section in powerpc-linux/lib/gcc/powerpc-linux/3.4.6/../../../../powerpc-linux/lib/crt1.o

vcenterClient.cpp:(.text+0x20c): relocation truncated to fit: R_PPC_REL24 against symbol `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)@@GLIBCXX_3.4' defined in .plt section in powerpc-linux/lib/gcc/powerpc-linux/3.4.6/../../../../powerpc-linux/lib/crt1.o

vcenterClient.cpp:(.text+0x220): relocation truncated to fit: R_PPC_REL24 against symbol `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))@@GLIBCXX_3.4' defined in .plt section in powerpc-linux/lib/gcc/powerpc-linux/3.4.6/../../../../powerpc-linux/lib/crt1.o

objs/vcenterClient.o: In function `get_host_for_vm(VimBindingProxy*, ns2__ServiceContent*, ns2__ManagedObjectReference*)':

vcenterClient.cpp:(.text+0x2a4): relocation truncated to fit: R_PPC_REL24 against symbol `operator new(unsigned int)@@GLIBCXX_3.4' defined in .plt section in powerpc-linux/lib/gcc/powerpc-linux/3.4.6/../../../../powerpc-linux/lib/crt1.o

vcenterClient.cpp:(.text+0x2c4): additional relocation overflows omitted from the output

collect2: ld returned 1 exit status

make: *** [all] Error 1

2nd problem is while building the object for these files with -fPIC option. Compilation of soapC.cpp fails with this error:

powerpc-linux-g++ -fPIC -DWITH_OPENSSL -DWITH_COOKIES -DSOAP_DEBUG -I/users/home40/smisra/vcenter_sdk -I/users/home40/smisra/gsoap-2.8/gsoap -c soapC.cpp -o objs/soapC.o

/tmp/cc6g9dqT.s: Assembler messages:

/tmp/cc6g9dqT.s:5710924: Error: operand out of range (0x00008000 is not between 0xffff8000 and 0x00007fff)

/tmp/cc6g9dqT.s:5711343: Error: operand out of range (0x00008008 is not between 0xffff8000 and 0x00007fff)

/tmp/cc6g9dqT.s:5711949: Error: operand out of range (0x0000800c is not between 0xffff8000 and 0x00007fff)

/tmp/cc6g9dqT.s:5712235: Error: operand out of range (0x00008010 is not between 0xffff8000 and 0x00007fff)

/tmp/cc6g9dqT.s:5712615: Error: operand out of range (0x00008018 is not between 0xffff8000 and 0x00007fff)

/tmp/cc6g9dqT.s:5713000: Error: operand out of range (0x0000801c is not between 0xffff8000 and 0x00007fff)

/tmp/cc6g9dqT.s:5713015: Error: operand out of range (0x0000801c is not between 0xffff8000 and 0x00007fff)

..............

..............

I did some search on the google and realized that because of the huge file size (52 MB) this problem is happening. As a work around I tried to trim the vim.wsdl file and use only those operations/messages/request-response types in which I am interested.

By trimming the WSDL file, the file size got reduced by ~20% (42MB), it helped me linking the application successfully. But trimming the WSDL file manually is not a good idea considering to support future verions of WSDL.

Can somebody look into this and suggest a better solution to this problem?

Is there a way to get a WSDL as per our requirements instead of a single WSDL for all the operations?

Regards,

Saurabh Misra

0 Kudos
0 Replies