From f9c78655bec3036e2cef8946e261246cbe17f4c9 Mon Sep 17 00:00:00 2001 From: John Criswell Date: Mon, 26 Jan 2004 21:26:54 +0000 Subject: Clarified the extension to shared library objects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10978 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/CommandGuide/gccld.html | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'docs/CommandGuide/gccld.html') diff --git a/docs/CommandGuide/gccld.html b/docs/CommandGuide/gccld.html index 1b90d84595..be8092a7b0 100644 --- a/docs/CommandGuide/gccld.html +++ b/docs/CommandGuide/gccld.html @@ -32,24 +32,35 @@ optimizations on the program.

Search Order

+

When looking for objects specified on the command line, gccld will search for the object first in the current directory and then in the directory specified by the LLVM_LIB_SEARCH_PATH environment variable. If it cannot find the object, it fails. -

+

+

When looking for a library specified with the -l option, gccld first attempts to load a file with that name from the current directory. If that fails, it looks for lib<library>.bc, lib<library>.a, or -lib<library>.so, in that order, in each directory added to the library -search path with the -L option. These directories are searched in order they +lib<library>.<shared library extension>, in that order, in each +directory added to the library search path with the -L option. These +directories are searched in the order they were specified. If the library cannot be located, then gccld looks in the directory specified by the LLVM_LIB_SEARCH_PATH environment -variable. If it does not find lib<library>.[bc | a | so] there, it fails. +variable. If it does not find a library there, it fails. +

+

+The shared library extension is usually .so, but it may differ +depending upon the system. +

+ +

The -L option is global. It does not matter where it is specified in the list of command line arguments; the directory is simply added to the search path and is applied to all libraries, preceding or succeeding, in the command line. +

Link order

@@ -131,9 +142,9 @@ using the -native option.
Specify libraries to include when linking the output file. When linking, gccld will first attempt to load a file with the - pathname library. If that fails, it will then attempt to load - lib<library>.bc, lib<library>.a, and lib<library>.so, - in that order. + pathname library. If that fails, it will then attempt to load + lib<library>.bc, lib<library>.a, and + lib<library>.<shared library extension>, in that order.

  • -link-as-library -- cgit v1.2.3-70-g09d2