[hellogcc] Re: [hellogcc] OpenRisc的gcc需要-mor32-newlib参数,在./gcc/config/or32/or32.opt里面有具体描述。

  • From: Yao Qi <qiyaoltc@xxxxxxxxx>
  • To: hellogcc@xxxxxxxxxxxxx
  • Date: Thu, 7 Apr 2011 22:22:52 +0800

2011/4/7 Liu <proljc@xxxxxxxxx>:
> yao说lib_spec啥的,我也不理解。虽然找到了:
> or32.h:#undef LIB_SPEC
> or32.h:#define LIB_SPEC "%{!mor32-newlib*:"

你没有贴全吧。

> 从听人说啥spec也不知道是啥,谁出来扫盲?

LIB_SPEC其实就是规定,在不同的参数下,link的时候使用什么lib。

例如config/xtensa/elf.h

#define LINK_SPEC \
 "%{shared:-shared} \
  %{!shared: \
    %{!static: \
      %{rdynamic:-export-dynamic} \
    %{static:-static}}}"

这个意思就是,如果是shared, 就在link的时候加上 -shared; 如果不是shared,也不是static,link的时候,加
-export-dynamic; 如果是static, link的时候加 -static

#define STARTFILE_SPEC \
  "crt1-sim%O%s crt0%O%s crti%O%s crtbegin%O%s _vectors%O%s"

这个就规定了,start 文件有那些,一般的elf 目标,可能就有 crti.o crtbegin.o
这里多一些。

#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend%O%s crtn%O%s"

end文件有哪些。 这里有crtend.o crtn.o。 我记得我在buzz上介绍过 crti.o crtbegin.o crtend.o
crtn.o的作用。

> GCC里面这些概念还真不少,虽然就是个配置啥的,但是确实影响工作啊!
>



-- 
Yao Qi <qiyaoltc AT gmail DOT com>
http://sites.google.com/site/duewayqi/

Other related posts: