You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Simon Kitching <si...@ecnetwork.co.nz> on 2004/07/19 04:36:59 UTC

Using xerces-c on AIX

Hi,

I have built an app using xerces-c as a shared lib on Linux. I'm now
trying to get it running on AIX 5.1.

Issue 1: 

The binary download of xerces-c for AIX appears to have static libs
(.a), but no shared libs (.so). Is this deliberate, and if so, what is
the reason?

Issue 2:

When I try to compile from source using gcc/g++ 2.9, I get a link
problem. I can compile other c/c++ apps successfully on this machine.

The runConfigure script seems ok:
   ./runConfigure -p aix -cgcc -xg++ -nfileonly -rpthread

And the compile seems ok.

But I get this link error:

gmake[1]: Entering directory `/home/simon/xerces-c-src_2_5_0/obj'

Building /home/simon/xerces-c-src_2_5_0/lib/libxerces-c25.0.a
makeC++SharedLib_r -p 5000   -o
/home/simon/xerces-c-src_2_5_0/lib/libxerces-c25.0.a
{lots of .o files}
-bmap:/home/simon/xerces-c-src_2_5_0/obj/libxerces-c25.0.map 
-lpthreads  -L/usr/lpp/xlC/lib

ld: 0711-317 ERROR: Undefined symbol: __pure_virtual
ld: 0711-317 ERROR: Undefined symbol: .__builtin_new
ld: 0711-317 ERROR: Undefined symbol: .__eh_alloc
ld: 0711-317 ERROR: Undefined symbol: .__cp_push_exception
ld: 0711-317 ERROR: Undefined symbol: .__throw
ld: 0711-317 ERROR: Undefined symbol: .__rethrow
ld: 0711-317 ERROR: Undefined symbol: .__cp_pop_exception
ld: 0711-317 ERROR: Undefined symbol: .__start_cp_handler
ld: 0711-317 ERROR: Undefined symbol: .__builtin_delete
ld: 0711-317 ERROR: Undefined symbol: .__rtti_si
ld: 0711-317 ERROR: Undefined symbol: .__rtti_user
ld: 0711-317 ERROR: Undefined symbol: .__rtti_class
ld: 0711-317 ERROR: Undefined symbol: .__builtin_vec_new
ld: 0711-317 ERROR: Undefined symbol: .__builtin_vec_delete
ld: 0711-317 ERROR: Undefined symbol: .__uncatch_exception
ld: 0711-317 ERROR: Undefined symbol: .__eprintf
ld: 0711-317 ERROR: Undefined symbol: .__tfi
ld: 0711-317 ERROR: Undefined symbol: .__fixunssfsi
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
gmake[1]: *** [/home/simon/xerces-c-src_2_5_0/lib/libxerces-c25.0.a]
Error 8
gmake[1]: Target `ALL' not remade because of errors.
gmake[1]: Leaving directory `/home/simon/xerces-c-src_2_5_0/obj'
gmake: *** [/home/simon/xerces-c-src_2_5_0/lib/libxerces-c25.0.a] Error
2

It looks rather like libstdc++ is not being found or something. 


Thanks in advance,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Using xerces-c on AIX

Posted by Simon Kitching <si...@ecnetwork.co.nz>.
On Mon, 2004-07-19 at 23:31, David Cargill wrote:

> For you link problem, the build for AIX assumes you are using xlC.  So when
> you specify a compiler of gcc/g++ it still uses xlC for the link.  You
> would need to override the Makefile.incl in /src/xercesc to test the
> compiler and then point to the appropriate libraries for g++ and invoke
> something other than makeC++SharedLib_r.

Thanks for the very useful pointers above, David. 

The fact that code compiled with gcc/g++ is incompatible with the xlC
linker rather makes the -c and -x options to the runConfigure script
irrelevant, does it not?

Anyway, this is now really a GCC-on-AIX problem rather than a xerces-c
problem, so I won't take up any more bandwidth here.

But just in case someone does have any last suggestions, here's what I'm
getting after following David's suggestion as best I can. If anyone here
has managed to compile any dynamic shared library on AIX using gcc
tools, I would appreciate your comments, even if it's just to say that
yes it is possible.

--------------

I've modified Makefile.incl,  but can't find the right combo of options
to create a dynamic shared library on AIX using GNU "ld".

The "-shared" option to ld is, according to the man pages, only
available on "ELF, XCOFF and SunOS platforms". This matches nicely with
the error message I'm getting:

g++ -DAIX -shared -fPIC  -Wl,-soname,libxerces-c25.so -o
/home/simon/xerces-c-src_2_5_0/lib/libxerces-c25.0.so  ...
collect2: libxerces-c25.so: cannot open as COFF file

The output of gld --help does state that "aixcoff-rs6000" is supported
(the target server is AIX5.1 on rs6000). But I've tried using "--oformat
aixcoff-rs6000" without success. Experiments continue....

[NB: the ld version installed is: GNU ld 2.9-aix43-010414]


Cheers, and thanks for all the help.

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Using xerces-c on AIX

Posted by David Cargill <ca...@ca.ibm.com>.



Hi Simon,
> Is it possible that g++ and xlC v5 use different name-mangling
> algorithms from xlC v6, which the binary xerces download was built with?
Yes.  If you need to use a different compiler I suggest you download the
source and recompile.

For you link problem, the build for AIX assumes you are using xlC.  So when
you specify a compiler of gcc/g++ it still uses xlC for the link.  You
would need to override the Makefile.incl in /src/xercesc to test the
compiler and then point to the appropriate libraries for g++ and invoke
something other than makeC++SharedLib_r.

Regards,
David A. Cargill


                                                                           
             Simon Kitching                                                
             <simon@ecnetwork.                                             
             co.nz>                                                     To 
                                       xerces-c-dev@xml.apache.org         
             07/19/2004 01:52                                           cc 
             AM                                                            
                                                                   Subject 
                                       Re: Using xerces-c on AIX           
             Please respond to                                             
               xerces-c-dev                                                
                                                                           
                                                                           
                                                                           
                                                                           




On Mon, 2004-07-19 at 14:36, Simon Kitching wrote:
> Hi,
>
> I have built an app using xerces-c as a shared lib on Linux. I'm now
> trying to get it running on AIX 5.1.
>
> Issue 1:
>
> The binary download of xerces-c for AIX appears to have static libs
> (.a), but no shared libs (.so). Is this deliberate, and if so, what is
> the reason?

Hmm..it appears that AIX uses the suffix '.a' for dynamic shared libs.
How nice :-(. Well that issue's solved.

However if I compile code with either g++ or xlC v5, then link against
the xerces-c libs in the prebuilt download, I get link errors. None of
the xerces-c APIs can be found.

Is it possible that g++ and xlC v5 use different name-mangling
algorithms from xlC v6, which the binary xerces download was built with?

>
> Issue 2:
>
> When I try to compile from source using gcc/g++ 2.9, I get a link
> problem. I can compile other c/c++ apps successfully on this machine.
>
> The runConfigure script seems ok:
>    ./runConfigure -p aix -cgcc -xg++ -nfileonly -rpthread
>
> And the compile seems ok.
>
> But I get this link error:
>
> gmake[1]: Entering directory `/home/simon/xerces-c-src_2_5_0/obj'
>
> Building /home/simon/xerces-c-src_2_5_0/lib/libxerces-c25.0.a
> makeC++SharedLib_r -p 5000   -o
> /home/simon/xerces-c-src_2_5_0/lib/libxerces-c25.0.a
> {lots of .o files}
> -bmap:/home/simon/xerces-c-src_2_5_0/obj/libxerces-c25.0.map
> -lpthreads  -L/usr/lpp/xlC/lib
>
> ld: 0711-317 ERROR: Undefined symbol: __pure_virtual
> ld: 0711-317 ERROR: Undefined symbol: .__builtin_new
> ld: 0711-317 ERROR: Undefined symbol: .__eh_alloc
> ld: 0711-317 ERROR: Undefined symbol: .__cp_push_exception
> ld: 0711-317 ERROR: Undefined symbol: .__throw
> ld: 0711-317 ERROR: Undefined symbol: .__rethrow
> ld: 0711-317 ERROR: Undefined symbol: .__cp_pop_exception
> ld: 0711-317 ERROR: Undefined symbol: .__start_cp_handler
> ld: 0711-317 ERROR: Undefined symbol: .__builtin_delete
> ld: 0711-317 ERROR: Undefined symbol: .__rtti_si
> ld: 0711-317 ERROR: Undefined symbol: .__rtti_user
> ld: 0711-317 ERROR: Undefined symbol: .__rtti_class
> ld: 0711-317 ERROR: Undefined symbol: .__builtin_vec_new
> ld: 0711-317 ERROR: Undefined symbol: .__builtin_vec_delete
> ld: 0711-317 ERROR: Undefined symbol: .__uncatch_exception
> ld: 0711-317 ERROR: Undefined symbol: .__eprintf
> ld: 0711-317 ERROR: Undefined symbol: .__tfi
> ld: 0711-317 ERROR: Undefined symbol: .__fixunssfsi
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
> information.
> gmake[1]: *** [/home/simon/xerces-c-src_2_5_0/lib/libxerces-c25.0.a]
> Error 8
> gmake[1]: Target `ALL' not remade because of errors.
> gmake[1]: Leaving directory `/home/simon/xerces-c-src_2_5_0/obj'
> gmake: *** [/home/simon/xerces-c-src_2_5_0/lib/libxerces-c25.0.a] Error
> 2
>
> It looks rather like libstdc++ is not being found or something.

I'd still *really* appreciate any suggestions on this.

Regards,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Using xerces-c on AIX

Posted by Simon Kitching <si...@ecnetwork.co.nz>.
On Mon, 2004-07-19 at 14:36, Simon Kitching wrote:
> Hi,
> 
> I have built an app using xerces-c as a shared lib on Linux. I'm now
> trying to get it running on AIX 5.1.
> 
> Issue 1: 
> 
> The binary download of xerces-c for AIX appears to have static libs
> (.a), but no shared libs (.so). Is this deliberate, and if so, what is
> the reason?

Hmm..it appears that AIX uses the suffix '.a' for dynamic shared libs.
How nice :-(. Well that issue's solved.

However if I compile code with either g++ or xlC v5, then link against
the xerces-c libs in the prebuilt download, I get link errors. None of
the xerces-c APIs can be found.

Is it possible that g++ and xlC v5 use different name-mangling
algorithms from xlC v6, which the binary xerces download was built with?

> 
> Issue 2:
> 
> When I try to compile from source using gcc/g++ 2.9, I get a link
> problem. I can compile other c/c++ apps successfully on this machine.
> 
> The runConfigure script seems ok:
>    ./runConfigure -p aix -cgcc -xg++ -nfileonly -rpthread
> 
> And the compile seems ok.
> 
> But I get this link error:
> 
> gmake[1]: Entering directory `/home/simon/xerces-c-src_2_5_0/obj'
> 
> Building /home/simon/xerces-c-src_2_5_0/lib/libxerces-c25.0.a
> makeC++SharedLib_r -p 5000   -o
> /home/simon/xerces-c-src_2_5_0/lib/libxerces-c25.0.a
> {lots of .o files}
> -bmap:/home/simon/xerces-c-src_2_5_0/obj/libxerces-c25.0.map 
> -lpthreads  -L/usr/lpp/xlC/lib
> 
> ld: 0711-317 ERROR: Undefined symbol: __pure_virtual
> ld: 0711-317 ERROR: Undefined symbol: .__builtin_new
> ld: 0711-317 ERROR: Undefined symbol: .__eh_alloc
> ld: 0711-317 ERROR: Undefined symbol: .__cp_push_exception
> ld: 0711-317 ERROR: Undefined symbol: .__throw
> ld: 0711-317 ERROR: Undefined symbol: .__rethrow
> ld: 0711-317 ERROR: Undefined symbol: .__cp_pop_exception
> ld: 0711-317 ERROR: Undefined symbol: .__start_cp_handler
> ld: 0711-317 ERROR: Undefined symbol: .__builtin_delete
> ld: 0711-317 ERROR: Undefined symbol: .__rtti_si
> ld: 0711-317 ERROR: Undefined symbol: .__rtti_user
> ld: 0711-317 ERROR: Undefined symbol: .__rtti_class
> ld: 0711-317 ERROR: Undefined symbol: .__builtin_vec_new
> ld: 0711-317 ERROR: Undefined symbol: .__builtin_vec_delete
> ld: 0711-317 ERROR: Undefined symbol: .__uncatch_exception
> ld: 0711-317 ERROR: Undefined symbol: .__eprintf
> ld: 0711-317 ERROR: Undefined symbol: .__tfi
> ld: 0711-317 ERROR: Undefined symbol: .__fixunssfsi
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
> information.
> gmake[1]: *** [/home/simon/xerces-c-src_2_5_0/lib/libxerces-c25.0.a]
> Error 8
> gmake[1]: Target `ALL' not remade because of errors.
> gmake[1]: Leaving directory `/home/simon/xerces-c-src_2_5_0/obj'
> gmake: *** [/home/simon/xerces-c-src_2_5_0/lib/libxerces-c25.0.a] Error
> 2
> 
> It looks rather like libstdc++ is not being found or something. 

I'd still *really* appreciate any suggestions on this.

Regards,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org