我正在进行为了vxworks而定制的交叉编译环境,参考的是如下这两个教程:
定制交叉编译环境-gcc https://cloud.tencent.com/developer/article/1398405
在Vx-Works平台实现交叉编译工具链的开发及优化研究 https://www.elecfans.com/emb/202003071176114.html
我的host环境是:x86_64-pc-cygwin
我的vxworks环境是:powerpc vxworks-6.9
前面按照流程一步步进行:
①安装一下binutils,然后把binutils的include/libiberty.h复制到vxworks的include文件夹中
②顺序安装了mpc,mpfr,gmp
③编译gcc
我先执行了./configure,如下:
./configure --target=$TARGET --prefix=$PREFIX --exec-prefix=$PREFIX --with-headers=/cygdrive/d/WindRiver/vxworks-6.9/target/h --with-libs=/cygdrive/d/WindRiver/vxworks-6.9/target/lib --with-included-gettext --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --with-gmp=/usr/local/gmp --with-mpfr=/usr/local/mpfr --with-mpc=/usr/local/mpc --with-isl=/usr/local/isl -v
然后执行make:
make LANGUAGES="c c++" all-gcc all-target-libgcc
然后报错以下error: missing binary operator before token "("
In file included from ../.././gcc/c/c-lang.cc:22:
../.././gcc/system.h:333:33: error: missing binary operator before token "("
333 | #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM(t)))
| ^
../.././gcc/system.h:541:19: note: in expansion of macro ‘INTTYPE_MAXIMUM’
541 | # define SIZE_MAX INTTYPE_MAXIMUM(size_t)
| ^~~~~~~~~~~~~~~
../.././gcc/hwint.h:123:5: note: in expansion of macro ‘SIZE_MAX’
123 | #if SIZE_MAX <= UINT_MAX
| ^~~~~~~~
../.././gcc/system.h:333:33: error: missing binary operator before token "("
333 | #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM(t)))
| ^
../.././gcc/system.h:541:19: note: in expansion of macro ‘INTTYPE_MAXIMUM’
541 | # define SIZE_MAX INTTYPE_MAXIMUM(size_t)
| ^~~~~~~~~~~~~~~
../.././gcc/hwint.h:126:7: note: in expansion of macro ‘SIZE_MAX’
126 | #elif SIZE_MAX <= ULONG_MAX
| ^~~~~~~~
make[1]: *** [Makefile:1198: c/c-lang.o] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/15861/Downloads/gcc-14.2.0/gcc-14.2.0/host-x86_64-pc-cygwin/gcc'
make: *** [Makefile:4678: all-gcc] Error 2
这问题几天了还是解决不了,真不知道什么问题,修改了INTTYPE_MAXIMUM函数也还是不行,一直报错,麻烦各位帮忙看看谢谢!