QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 4342|回复: 3

请教一个菜问题,LDFLAGS="-Wl,-rpath 这个参数起到什么作用

[复制链接]
发表于 2010-8-12 07:31:35 | 显示全部楼层 |阅读模式
RT LDFLAGS="-Wl,-rpath 这个参数起到什么作用,在交叉编译中经常用到。
发表于 2010-8-12 08:56:11 | 显示全部楼层
http://sourceware.org/binutils/docs-2.20/ld/Options.html#Options
是这个么?

-rpath=dir
    Add a directory to the runtime library search path. This is used when linking an ELF executable with shared objects. All -rpath arguments are concatenated and passed to the runtime linker, which uses them to locate shared objects at runtime. The -rpath option is also used when locating shared objects which are needed by shared objects explicitly included in the link; see the description of the -rpath-link option. If -rpath is not used when linking an ELF executable, the contents of the environment variable LD_RUN_PATH will be used if it is defined.

    The -rpath option may also be used on SunOS. By default, on SunOS, the linker will form a runtime search patch out of all the -L options it is given. If a -rpath option is used, the runtime search path will be formed exclusively using the -rpath options, ignoring the -L options. This can be useful when using gcc, which adds many -L options which may be on NFS mounted file systems.

    For compatibility with other ELF linkers, if the -R option is followed by a directory name, rather than a file name, it is treated as the -rpath option.
回复

使用道具 举报

 楼主| 发表于 2010-8-12 09:10:44 | 显示全部楼层
CLFS编译gcc4.5.1遇到困难,先用--without-ppl --without-cloog编译完成gcc4.5.1,然后回头重新编译ppl和cloog的最新版本,版本号比SVN的CLFS还要高,直接编译目标GCC失败,又只好回头重编译交叉目录的GCC,结果通过了,我猜想或许第一次编译ppl和cloog就应该使用最新的版本,因为gcc编译with-ppl会出错。
看来不管是LFS还是CLFS的资料都不是很正确啊。
只好回到EGLIBC-2.12 继续。。。

[ 本帖最后由 haulm 于 2010-8-12 09:11 编辑 ]
回复

使用道具 举报

发表于 2010-8-12 16:52:47 | 显示全部楼层
举酱油路过……
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-2 10:18 , Processed in 0.040750 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表