LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 906|回复: 3

CC="$LFS_TGT-gcc -B/tools/lib/" \中-B含义不解

[复制链接]
发表于 2010-7-14 19:28:02 | 显示全部楼层 |阅读模式
二次编译Binutils时CC="$LFS_TGT-gcc -B/tools/lib/",后面configure又带了参数--with-lib-path=/tools/lib。不知道-B/tools/lib/的作用,还有-B是什么含义,望指点迷津!
发表于 2010-7-19 16:18:34 | 显示全部楼层
man手册的解释

-Bprefix
           This option specifies where to find the executables, libraries,
           include files, and data files of the compiler itself.

           The compiler driver program runs one or more of the subprograms
           cpp, cc1, as and ld.  It tries prefix as a prefix for each program
           it tries to run, both with and without machine/version/.

           For each subprogram to be run, the compiler driver first tries the
           -B prefix, if any.  If that name is not found, or if -B was not
           specified, the driver tries two standard prefixes, which are
           /usr/lib/gcc/ and /usr/local/lib/gcc/.  If neither of those results
           in a file name that is found, the unmodified program name is
           searched for using the directories specified in your PATH environ-
           ment variable.

           The compiler will check to see if the path provided by the -B
           refers to a directory, and if necessary it will add a directory
           separator character at the end of the path.

           -B prefixes that effectively specify directory names also apply to
           libraries in the linker, because the compiler translates these
           options into -L options for the linker.  They also apply to
           includes files in the preprocessor, because the compiler translates
           these options into -isystem options for the preprocessor.  In this
           case, the compiler appends include to the prefix.

           The run-time support file libgcc.a can also be searched for using
           the -B prefix, if needed.  If it is not found there, the two
           standard prefixes above are tried, and that is all.  The file is
           left out of the link if it is not found by those means.

           Another way to specify a prefix much like the -B prefix is to use
           the environment variable GCC_EXEC_PREFIX.

           As a special kludge, if the path provided by -B is [dir/]stageN/,
           where N is a number in the range 0 to 9, then it will be replaced
           by [dir/]include.  This is to help with boot-strapping the com-
           piler.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-7-20 09:46:19 | 显示全部楼层
很是感谢,知道了
回复 支持 反对

使用道具 举报

一剑光寒十五州 该用户已被删除
发表于 2010-7-23 22:22:37 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

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