bug-ncurses
[Top][All Lists]
Advanced

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

Re: unresolved symbols with ncurses-5.6 on Alpha OSF1 5.1A


From: Thomas Dickey
Subject: Re: unresolved symbols with ncurses-5.6 on Alpha OSF1 5.1A
Date: Thu, 26 Apr 2007 16:14:29 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

On Wed, Apr 25, 2007 at 04:25:42PM -0500, Tim Mooney wrote:
> In regard to: Re: unresolved symbols with ncurses-5.6 on Alpha OSF1 
> 5.1A,...:
> 
> >Thomas Dickey wrote:
> >>On Tue, 17 Apr 2007, Martin MOKREJ wrote:
> >>
> >>>So, my problem is that static libs are being built on my system, but 
> >>>linker is instructed to use shared libs.
> >>
> >>It's been a while since I encountered _that_.  The workaround (not 
> >>implemented in ncurses) is to add linker directives (which of course 
> >>depend on the system and compiler) such as -static and -dynamic 
> >>before/after the -lncurses
> >
> >$ gcc ../objects/tic.o ../objects/dump_entry.o -L../lib -static -lncurses 
> >-dynamic -I../progs -I. -DHAVE_CONFIG_H -I. -I../include  -D_OSF_SOURCE 
> >-DNDEBUG -I/usr/home3/mmokrejs/include/ncurses -O2 -o tic
> >$ 
> >You are right, that works, but still imagine I would have static and 
> >dynamic
> >libs site-wide installed and that the generated Makefile does not force
> >the build process to use specifically the newly generated library in source
> >tree:

The -L option is used to specify the library location.

The real problem is that Tru64's linker searches the list of directories
twice, and finds a shared library outside the build tree before noticing
the static library in the build tree.
 
> What happens if you get rid of the -static and -dynamic directives you
> added, and just add
> 
>       -oldstyle_liblookup
> 
> to LDFLAGS?  Does that fix the issue?

I'm reading a Tru64 manpage now, and it sounds as if the answer is no.
That makes it search first for shared objects in all directories, and
then for static objects in all directories.  (It's a little puzzling
since that is also described for the default behavior).  However, note
that we're also talking about two compilers (cc and gcc).  gcc's wrapper
translates options such as -static into what's used locally by ld.
On the other hand, cc's options normally correspond to ld.

The relevant Tru64 linker options are "-noso", "-noarchive" and "-so_archive".
Based on what I'm reading, I'd expect that gcc is translating

        -static to "-so_archive -noso"
        -dynamic to "-so_archive -noarchive"

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

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