bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shared library in AIX (with gcc)


From: Michael Haubenwallner
Subject: Re: Shared library in AIX (with gcc)
Date: Wed, 2 Nov 2016 10:41:55 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1

Hi Luciano,

On 11/01/2016 01:48 PM, Luciano Moreira wrote:
> The environment is an AIX 7.1 with gcc 4.8.3 (there aren't xlc).
> My experience to generate ncurses 6 shared library (--with-shared) follows:
> 
> 1) .a vs .so files: The AIX linker (ld) cannot choose between .so and .a for 
> shared and static respectively,
> it links always against .a files being that shared or static library (same 
> extension for both).
> Although, there are a ld argument "-brtl" to link with shared library where 
> it searches either for .a or .so,
> it shows these duplicate symbol warnings (linking to libncurses.so or 
> libncurses++.so):
> ld: 0711-224 WARNING: Duplicate symbol: .__init_aix_libgcc_cxa_atexit
> ld: 0711-224 WARNING: Duplicate symbol: __dso_handle
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> 
> 2) Choosing to have only shared library and using the default behavior of ld 
> command without passing "-brtl" argument to it,
> I used a workaround wrapping .so in an .a (as suggested by this publication:
> http://www.ibm.com/developerworks/aix/library/au-gnu.html:
> "/Using -brtl, the AIX linker will look for libraries with both the .a and 
> .so extensions, such as libfoo.a and libfoo.so.
> Without -brtl, the AIX linker looks only for libfoo.a. You can create 
> libfoo.a simply by archiving a shared object or even
> by renaming the shared object as libfoo.a -- AIX doesn't care, as long as the 
> file suffix is .a/.")

just to keep in mind:

AIX does support lots of different ways to create shared libraries,
each one asking for different (more or less hidden) subtle headaches,
which I doubt ncurses should deal with (feel free to ask for details).

> After wrapping .so in an .a and removing the argument -brtl, the ld doesn't 
> show warnings for duplicate symbols anymore.
> My test app linked with ncurses 6 (libncurses.so) worked well, no matter the 
> kind of liking used.

While all of these different ways may work in various situations, at least
for package managers I'd recommend to leave handling theses subtleties to
libtool, which is the ncurses' "--with-libtool" configure flag for.

HTH,
/haubi/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]