用gcc为rx600编译

时间:2018-11-20 10:00:48

标签: c gcc cross-compiling

我有一个使用renasas的gcc编译器(从现在开始在rx-elf-gcc上)为RX600进行编译的项目。但是我想知道,我是否应该能够使用标准gcc进行编译?如果可以,怎么办?

我正在为该项目制作一个docker容器,如果我不必安装renesas的编译器,安装它并提供激活代码等,我会更愿意。

我找到了这份文档,这使我开始 https://gcc.gnu.org/onlinedocs/gcc-7.3.0/gcc/RX-Options.html

然后我希望能够做类似的事情:

$ gcc -mcpu=rx600 -mlittle-endian-data dummy.c

但是它给出了错误:

gcc: warning: ‘-mcpu=’ is deprecated; use ‘-mtune=’ or ‘-march=’ instead
gcc: error: unrecognized command line option ‘-mlittle-endian-data’

我尝试改用-mtune,但是rx似乎不是有效的选择

$ gcc -mtune=rx600 dummy.c
cc1: error: bad value (‘rx600’) for ‘-mtune=’ switch
cc1: note: valid arguments to ‘-mtune=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 bonnell atom silvermont slm knl intel x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2 generic

那么,我可以在安装中添加新的硬件模型吗?还是这些模型只是将我重定向到rx-elf-gcc?

作为旁注:

$ gcc --version
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ rx-elf-gcc --version
rx-elf-gcc (GCC_Build_20180315) 4.8.4.201801-GNURX
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

以及以下作品:

$ rx-elf-gcc -mcpu=rx600 -mlittle-endian-data -c dummy.c

0 个答案:

没有答案