gcc - 编译6.3.0 gcc时声明冲突

标签 gcc compiler-errors

Ubuntu Xenial,x86_64
编译6.3.0 gcc

nativ gcc版本是5.4.0

错误来源:

g++ -c   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../gcc-6.3.0/gcc -I../../gcc-6.3.0/gcc/build -I../../gcc-6.3.0/gcc/../include  -I../../gcc-6.3.0/gcc/../libcpp/include  \
-o build/genmddeps.o ../../gcc-6.3.0/gcc/genmddeps.c

错误:
In file included from ./bconfig.h:3:0,
             from ../../gcc-6.3.0/gcc/genmddeps.c:18:
./auto-host.h:2321:16: error: declaration does not declare anything [-fpermissive]
 #define rlim_t long
            ^
In file included from ../../gcc-6.3.0/gcc/genmddeps.c:19:0:
../../gcc-6.3.0/gcc/system.h:488:23: error: conflicting declaration of C function ‘void* sbrk(int)’
 extern void *sbrk (int);
                   ^

我正在尝试从头开始编译gcc。我的配置选项是
../gcc-6.3.0/configure --target=arm-eabi --prefix=/local/development/arm-project/tools/ --enable-languages=c --with-newlib --without-headers

谁能帮忙调试吗?

最佳答案

尝试(并进行相应的编辑):

tar xzf gcc-6.3.0.tar.gz
cd gcc-6.3.0
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-6.3.0/configure --prefix=$HOME/GCC-6.3.0 --enable-languages=c,c++
make
make install

资料来源:Installing GCC

关于gcc - 编译6.3.0 gcc时声明冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42999290/

相关文章:

c - 为什么在这个例子中 strptime() 没有正确设置 tm_wday?

c++ - 如何在 os x 10.10 中使用 Homebrew 软件安装 gcc -4.8.4

c# - ToDouble() 不工作?

c++ - 在C++中对数组使用阶乘函数

c++ - 为什么 g++ 在编译时给我冲突错误?

gcc - 使用 GCC 编译器与 ActiveX 进行通信

c - 编写单个生产者/单个消费者队列的最有效方式

c++ - 你如何修复 C++ 预期的主表达式错误?

xcode - 命令 CompileAssetCatalog 失败,退出代码为非零

c - 如何解决 GCC C 代码中非静态声明之后的静态声明?