Re: prefer static linking

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

 



"Weaver, John P CIV" <john.p.weaver@xxxxxxxx> writes:

> The gcc compiler prefers to use dynamic libraries in the linking
> phase. When porting software from one machine to another it is
> frequently desirable to link to static libraries as much as possible
> to account for different versions of the libraries. The -static flag
> is useful when you do not need any dynamic library support but causes
> the linker to fail if there is only a dynamic library for a particular
> call. Is there a way to ask the linker to use static libraries when
> possible and report the dynamic libraries that are needed to complete
> the linking process?

I am not aware of any such option.

If you are using the GNU linker, you can tell it to prefer dynamic
libraries using -Bdynamic and tell it to use only static libraries using
-Bstatic, but I don't know of any option to tell it to prefer static
libraries but use dynamic libraries if they are available.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux