https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50250

--- Comment #4 from Tom Payerle <payerle at umd dot edu> ---
In the interest of actually getting this fixed, may I suggest the following
revised wording:
----------------
Search the library named @var{library} when linking.  (The second
alternative with the library as a separate argument is only for
POSIX compliance and is not recommended.)

This is actually just passed directly to the linker, so the exact behavior is
dependent on your linker.  The description below is provided as a courtesy to
users; your linker documentation should be considered definitive and should be
referred to for more details.

Typically, the linker will search a list of directories for a library with a
name matching @var{library}.  On Unix-like systems, this is usually a file
named @file{lib@var{library}.@var{ext}} where @var{ext} is @samp{.a} for static
libraries or @samp{.so} for dynamic libraries.  The list of directories
searched
typically consists of several standard directories (system dependent) as well
as
directories added with the @option{-L} option.

Note that in general it makes a difference where in the command you write this
option: the linker typically processes libraries and object files in the order
they are specified.  Symbols in object files (or even other libraries specified
with the @samp{-l} option) that follow the @samp{-l@var{library}} option on the
command line might not get resolved.  
----------------

I think the above provides the same basic information as the original to the
casual reader while making it clear that one needs to read the linker
documentation for details.

Reply via email to