求教个gcc问题

18 views
Skip to first unread message

echo

unread,
Sep 27, 2009, 2:35:30 AM9/27/09
to China Linux Fans
哪知道gcc中的-mbig选项在linux 下如何使用,我写了个测试程序,用:
gcc test.c -mbig 却提示:
cc1: 错误:无法识别的命令行选项“-mbig”

是否在加该选项前还需要加入其它的参数??

如果知道在unix下如何使用该选项那就更好!谢谢!

kemy.chen

unread,
Sep 27, 2009, 3:05:12 AM9/27/09
to china-li...@googlegroups.com
echo 写道:
问下你 gcc的这个参数-mbig 是什么意思 我还没用过 所以不知道你要问什么

kemy.chen

unread,
Sep 27, 2009, 3:06:53 AM9/27/09
to china-li...@googlegroups.com
echo 写道:
-M 生成文件关联的信息。包含目标文件所依赖的所有源代码
这个参数我才知道

王虎

unread,
Sep 27, 2009, 3:10:23 AM9/27/09
to china-li...@googlegroups.com
我没有用过这个参数啊,你 gcc --help 看看,或者 man gcc 看看吧。

2009/9/27 kemy.chen <kemy...@gmail.com>

熊锋

unread,
Sep 27, 2009, 3:40:17 AM9/27/09
to china-li...@googlegroups.com
解决字节序的大小端(little-endian, big-endian)

2009/9/27 kemy.chen <kemy...@gmail.com>


--
/**************************************/
Name: Xiong Feng
E-mail:linu...@gmail.com
MSN:linu...@hotmail.com
QQ:linu...@gmail.com
Address: GuangZhou.China
/**************************************/

熊锋

unread,
Sep 27, 2009, 3:44:44 AM9/27/09
to china-li...@googlegroups.com
man gcc 里面有,按着选项加上去,就找不到选项

2009/9/27 王虎 <ghost...@gmail.com>

Jacky

unread,
Sep 27, 2009, 6:07:41 AM9/27/09
to China Linux Fans

gcc的-m选项指定CPU选项。

你是用的ARM gcc就要
-mlittle-endian 或者 -mbig-endian
IA-64、MCore也这样。
RS/6000 和 PowerPC 就都可以:
-mlittle -mlittle-endian -mbig -mbig-endian
TI的TMS320C3x/C4x好象是:
-mbig -msmall

其实man gcc
输入:/\-mbig
回车就可以看到。

Jacky

unread,
Sep 27, 2009, 6:10:11 AM9/27/09
to China Linux Fans
On 9月27日, 下午2时35分, echo <linux0...@gmail.com> wrote:

gcc --version
把上述命令显示贴出来大家分析下。
i386版的gcc是没有-mbig -mlittle之类的选项的。

kemy.chen

unread,
Sep 27, 2009, 6:15:20 AM9/27/09
to china-li...@googlegroups.com
没用过这个选项

--
Sent from my mobile device

kemy.chen
bbs.cnsmartphone.com

Jacky

unread,
Sep 27, 2009, 6:26:16 AM9/27/09
to China Linux Fans
如果你是做嵌入式的,没听过这个,那就怕怕的了……

On 9月27日, 下午6时15分, "kemy.chen" <kemy.c...@gmail.com> wrote:
> 没用过这个选项

kemy.chen

unread,
Sep 27, 2009, 6:31:45 AM9/27/09
to china-li...@googlegroups.com
是嵌入式 确实没用过这个 也有可能写过一次进makefile 然后都是cp cp这样 ,就不知道会有这个选项

看来很多东西要补下了

On 9/27/09, Jacky <zhou...@gmail.com> wrote:

熊锋

unread,
Sep 27, 2009, 10:03:40 PM9/27/09
to china-li...@googlegroups.com
我的gcc version:
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)
 
cpu:
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU
 
我试着在rhel5下面用gcc -mi386 -mlittle-endian test.c
还是不能找到选项. 我想可能需要带些参数配合-mlittle-endian编译的,可man gcc中好像没看到哪有讲?


 
2009/9/27 Jacky <zhou...@gmail.com>

Jacky

unread,
Sep 28, 2009, 7:14:28 AM9/28/09
to China Linux Fans
gcc的i386的编译选项是没有big/little endian的,是不是因为i386系列CPU字节序问题是固定的呢?我不知道。只知道ARM
是需要设置的。

On 9月28日, 上午10时03分, 熊锋 <linux0...@gmail.com> wrote:
> 我的gcc version:
> gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)
>
> cpu:
> a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
> GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU
>
> 我试着在rhel5下面用gcc -mi386 -mlittle-endian test.c
> 还是不能找到选项. 我想可能需要带些参数配合-mlittle-endian编译的,可man gcc中好像没看到哪有讲?
>

> 2009/9/27 Jacky <zhoul...@gmail.com>


>
>
>
> > On 9月27日, 下午2时35分, echo <linux0...@gmail.com> wrote:
> > > 哪知道gcc中的-mbig选项在linux 下如何使用,我写了个测试程序,用:
> > > gcc test.c -mbig 却提示:
> > > cc1: 错误:无法识别的命令行选项"-mbig"
>
> > > 是否在加该选项前还需要加入其它的参数??
>
> > > 如果知道在unix下如何使用该选项那就更好!谢谢!
>
> > gcc的-m选项指定CPU选项。
>
> > 你是用的ARM gcc就要
> > -mlittle-endian 或者 -mbig-endian
> > IA-64、MCore也这样。
> > RS/6000 和 PowerPC 就都可以:
> > -mlittle -mlittle-endian -mbig -mbig-endian
> > TI的TMS320C3x/C4x好象是:
> > -mbig -msmall
>
> > 其实man gcc
> > 输入:/\-mbig
> > 回车就可以看到。
>
> --
> /**************************************/
> Name: Xiong Feng

> E-mail:linux0...@gmail.com <E-mail%3Alinux0...@gmail.com>
> MSN:linux0...@hotmail.com <MSN%3Alinux0...@hotmail.com>
> QQ:linux0...@gmail.com <QQ%3Alinux0...@gmail.com>
> Address: GuangZhou.China
> /**************************************/

Reply all
Reply to author
Forward
0 new messages