Loading ...
Sorry, an error occurred while loading the content.

Re: Statically linking vim with gcc

Expand Messages
  • Jens M. Felderhoff
    ... There should be no problem selecting only a subset of the libraries, i.e. those that are available as static archives, for static linking. With many
    Message 1 of 4 , Mar 3, 2000
    • 0 Attachment
      Stephen P. Wall writes:

      > I use "-Xlinker -Bstatic" to switch the linker to static mode. I
      > only do this for the gtk/glib libraries, but if you put it before
      > any "-l" options, it applies for the entire link. Note that on my
      > system, some libraries are not available in a static form (i.e.,
      > only the dynamic (.so) library exists). This makes an entirely
      > static build a little difficult. 8-]

      There should be no problem selecting only a subset of the libraries,
      i.e. those that are available as static archives, for static linking.

      With many linkers you may place the respective linker options more
      than once in between the -l flags, like:

      libs = -lfoo -Wl,-Bstatic -lbar -lbuzz -Wl,-Bdynamic -lfrob \
      -Wl,-Bstatic -lfred -lfrobozz

      In this example, libfoo and libfrob will be dynamically linked,
      whereas libbar, libbuzz, libfred, and libfrobozz will be linked
      statically.

      The HP-UX linker even allows to specify preferences in arbitrary
      order, i.e., take the static one if available and the dynamic one if
      not, or vice versa. Have a look at ld(1) and see what your linker has
      to offer.

      Cheers

      Jens
    Your message has been successfully submitted and would be delivered to recipients shortly.