Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Nov 1995 22:21:32 -0500 (EST)
From:      Chuck Robey <chuckr@glue.umd.edu>
To:        "Marc G. Fournier" <scrappy@hub.org>
Cc:        freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org
Subject:   Re: Shared Libraries...almost there...
Message-ID:  <Pine.SUN.3.91.951116221654.14053E@espresso.eng.umd.edu>
In-Reply-To: <Pine.BSF.3.91.951116195056.6449c-100000@hub.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 16 Nov 1995, Marc G. Fournier wrote:

> 
> Hi...
> 
> 	Well, I've finally got it down to the point that I have
> to compile with -fpic, and then link with "ld -Bshareable" to create
> a shared library...but it doesn't look right...
> 
> 	Looking at /usr/share/mk/bsd.lib.mk, I'm supposed to be using
> "shlib_version" to get major/minor numbers for the libraries I create,
> but I can't find that.  And, the shared library I created is over 3x
> the size of the original ncurses shared library that comes with the 
> system...so I screwed up somewhere :(
> 
> 	So...back to the drawing board...
> 
> 	what am I missing?  can someone who has the src's distribution
> available send me the Makefile for ncurses that is being used for the
> standard ncurses distribution?
> 
> 	Essentially, so that I don't get a bunch of "just type make out
> of the src's directory" answers this time...I'm trying to get ncurses
> 1.9.8 compiled and working.  It compiles and works cleanly using static
> libraries, but getting it to compile shared has been a new experience...
> 
> 	...so, what key step have I missed in all this?  I assume that
> when gcc compiles, its going to look at the "registered" ncurses shared
> library, which is the one that was installed when the system was built,
> right?

You know there's two version of that pic flag stuff, which stands for 
Position Independent Code (I think).  The -fPIC is supposed to be 
stronger in force than the -fpic, but most code does not need the strong 
-fPIC.  I don't know how to tell the difference, except to try it and 
find out.  As far as code size, have you checked to see if you happen to 
be using the -g flag?  That causes gcc to stuff in a huge number of 
debugging flags and can really bloat out code.  A lot of packages come 
with that set automatically, which I think is dumb, because if you're 
sophisticated enough to know how to use a debugger, then you would know 
how to set the -g your ownself.  If you weren't that familiar with it, 
then you would have huge code and no idea how to fix it.

> 
> 
> thanks...
> 
> 
> Marc G. Fournier | Knowledge, Information and Communications, Inc (ki.net)
> scrappy@hub.org  |
>  soon to be:     | 
> scrappy@ki.net   | For more information, send me email.
> 
> 

==========================================================================
Chuck Robey chuckr@eng.umd.edu, I run FreeBSD-current on n3lxx + Journey2
 
     Here's OJ's internet address in hex code: 
           00 2F 2F 2F 2F 5C 7F 2D 0D 15 1B 19 24 24 24 18 
           If you can't recall the translation, here it is: 
           null character, slash, slash, slash, slash, backslash, rubout, dash, 
           carriage return, negative acknowledgement, escape, end of media, 
           dollar sign, dollar sign, dollar sign, cancel 





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.951116221654.14053E>