bug-ncurses
[Top][All Lists]
Advanced

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

Shared library in AIX (with gcc)


From: Luciano Moreira
Subject: Shared library in AIX (with gcc)
Date: Tue, 01 Nov 2016 12:48:54 +0000

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 booth). 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.")

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.

--

Luciano Moreira


reply via email to

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