haulm 发表于 2010-8-12 07:31:35

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

RT LDFLAGS="-Wl,-rpath 这个参数起到什么作用,在交叉编译中经常用到。

jiangtao9999 发表于 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.

haulm 发表于 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的资料都不是很正确啊。 :evil:
只好回到EGLIBC-2.12 继续。。。

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

jiangtao9999 发表于 2010-8-12 16:52:47

举酱油路过……
页: [1]
查看完整版本: 请教一个菜问题,LDFLAGS="-Wl,-rpath 这个参数起到什么作用