Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jan 1999 13:58:32 -0900 (AKST)
From:      Mike Endsley <al7oj@customcpu.com>
To:        Nik Clayton <nik@nothing-going-on.demon.co.uk>
Cc:        Freebsd-newbies@FreeBSD.ORG
Subject:   Re: statically/dynamically based software
Message-ID:  <Pine.BSF.4.05.9901281357001.1114-100000@FreeBSDrulz>
In-Reply-To: <19990128214526.A11914@catkin.nothing-going-on.org>

next in thread | previous in thread | raw e-mail | index | archive | help

Thank-you very much! I will save this for future reference (bad memory!).
Mike



On Thu, 28 Jan 1999, Nik Clayton wrote:

> On Wed, Jan 27, 1999 at 02:16:01PM -0900, Michael A. Endsley wrote:
> > Can some one tell me the difference between these 2 items?
> > I want to download software, but the pages list for either of the 2.
> > I am running FreeBSD 3.0-R as just a home user.
> 
> It's all to do with libraries.
> 
> When you load and run a "dynamic" program, the binary file doesn't contain
> the whole of your program. Instead, it references libraries that contain
> common routines. For example, "libc" contains most of the library of code
> for standard C functions like printf().
> 
> If every program had to carry the code for printf() (and all the other
> functions around) then they'd all be much larger.
> 
> Instead, when your program runs it is "dynamically linked" with the 
> correct libraries.
> 
> However, what if you're building a program, and you don't know for certain
> that the right libraries will be available on the system it will run on?
> Or you don't know that the version of the libraries on the target system
> is correct?
> 
> In this case, you can choose to link your program statically. If you do
> this then all the code from the libraries that your program uses is
> bundled in to the executable file, giving you a complete, standalone
> binary that pretty much anyone can execute. This file is somewhat bigger
> than a dynamically linked one, because it contains all the extra code.
> 
> With your RealPlayer example -- it was probably compiled on a FreeBSD
> -stable system (or possibly a direct release). However, people downloading
> it might run it on a variety of different FreeBSD releases, and some of 
> those releases (-current in particular) will have different libraries, and
> some of the library functions might have changed as well.
> 
> Instead of providing lots of different binaries, and saying "Download 'x'
> if you're running -stable, 'y' if you're running 2.2.7, 'z' if you're 
> running -current before 15th January 1999, and 'foo' if you're running
> -current after 15th January 1999" they provide one, statically linked
> binary that should run pretty much anywhere.
> 
> Make sense?
> 
> N
> 

-- 
----------------------------------------------------------------------------
What part of the term "operating system" doesn't Bill Gates understand?
I have/run:
Un*x (FreeBSD) Linux (Slakware, Debian1.3 and 2.0), OS/2Warp3.0, win*
al7oj@customcpu.com   al7oj@al7oj.#nak.ak.usa.noam   al7oj@al7oj.ampr.org
http://www.customcpu.com/personal/al7oj/
----------------------------------------------------------------------------



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-newbies" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9901281357001.1114-100000>