免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 684 | 回复: 0
打印 上一主题 下一主题

link system [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-06-21 10:47 |只看该作者 |倒序浏览
Environment
This section describes several environment variables that affect how GCC operates. Some of them work by specifying directories or prefixes to
use when searching for various kinds of files. Some are used to specify other aspects of the compilation environment.
Note that you can also specify places to search using options such as -B, -I and -L. These take precedence over
places specified using environment variables, which in turn take precedence over those specified by the configuration of GCC .
LIBRARY_PATH
The value of LIBRARY_PATH is a colon-separated list of directories, much like PATH . When configured as a native
compiler, GCC tries the directories thus specified when searching for special linker files, if it can't find them using
GCC_EXEC_PREFIX . Linking using GCC also uses these directories when searching for ordinary libraries for the
-l option (but directories specified with -L come first).
The linker uses the following search paths to locate required shared libraries:
1.
Any directories specified by -rpath-link options.
2.
Any directories specified by -rpath options. The difference between -rpath and -rpath-link is that directories
specified by -rpath options are included in the executable and used at runtime, whereas the -rpath-link option is only
effective at link time. Searching -rpath in this way is only supported by native linkers and cross linkers which have been configured with the
--with-sysroot option.
3.
On an ELF system, if the -rpath and "rpath-link" options were not used, search the contents of the environment
variable "LD_RUN_PATH". It is for the native linker only.
4.
On SunOS, if the -rpath option was not used, search any directories specified using -L options.
5.
For a native linker, the contents of the environment variable "LD_LIBRARY_PATH".
6.
For a native ELF linker, the directories in "DT_RUNPATH" or "DT_RPATH" of a shared library are searched for shared
libraries needed by it. The "DT_RPATH" entries are ignored if "DT_RUNPATH" entries exist.
7.
The default directories, normally /lib and /usr/lib.
8.
For a native linker on an ELF system, if the file /etc/ld.so.conf exists, the list of directories found in that file.
If the required shared library is not found, the linker will issue a warning and continue with the link.
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/28158/showart_1972040.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP