海湾合作委员会突然停止工作

时间:2015-01-07 04:21:44

标签: c linux gcc debian

我注意到,突然之间,gcc拒绝编译许多项目。我试图编译linux 3.18-rc2和eglibc,但两次GCC都会发出大量错误。它似乎首先没有认识到这一点:

extern __pid_t fork (void) __THROWNL;

抱怨它:

In file included from scripts/basic/fixdep.c:109:0:
/usr/include/unistd.h: In function ‘fork’:
/usr/include/unistd.h:756:28: error: expected declaration specifiers before ‘__THROWNL’
/usr/include/unistd.h:764:16: error: storage class specified for parameter ‘vfork’
/usr/include/unistd.h:770:14: error: storage class specified for parameter ‘ttyname’
/usr/include/unistd.h:774:12: error: storage class specified for parameter ‘ttyname_r’
/usr/include/unistd.h:779:12: error: storage class specified for parameter ‘isatty’
/usr/include/unistd.h:785:12: error: storage class specified for parameter ‘ttyslot’
/usr/include/unistd.h:790:12: error: storage class specified for parameter ‘link’ 
/usr/include/unistd.h:796:12: error: storage class specified for parameter ‘linkat’
/usr/include/unistd.h:803:12: error: storage class specified for parameter ‘symlink’
/usr/include/unistd.h:809:16: error: storage class specified for parameter ‘readlink’ 
/usr/include/unistd.h:816:12: error: storage class specified for parameter ‘symlinkat’
/usr/include/unistd.h:820:16: error: storage class specified for parameter ‘readlinkat’ 
/usr/include/unistd.h:826:12: error: storage class specified for parameter ‘unlink’
/usr/include/unistd.h:830:12: error: storage class specified for parameter ‘unlinkat’
/usr/include/unistd.h:835:12: error: storage class specified for parameter ‘rmdir’
/usr/include/unistd.h:839:16: error: storage class specified for parameter ‘tcgetpgrp’
/usr/include/unistd.h:842:12: error: storage class specified for parameter ‘tcsetpgrp’
/usr/include/unistd.h:849:14: error: storage class specified for parameter ‘getlogin’
/usr/include/unistd.h:857:12: error: storage class specified for parameter ‘getlogin_r’
/usr/include/unistd.h:862:12: error: storage class specified for parameter ‘setlogin’

我试过" HOSTCC =' gcc -std = gnu99'相反,认为它可能没有识别代码中的许多GNU扩展,结果是相同的。编译一个简单的C程序确实有效:

$ echo "int main (void) {return 0;}" > silly.c && gcc -o silly silly.c
$ 

可能出了什么问题?

编辑:这是GCC的版本

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5) 

1 个答案:

答案 0 :(得分:2)

事实证明我的/ usr / include文件夹已损坏。没关系,问题已经消失。

感谢所有人。

我认为它发生了什么:我试图交叉构建EGLIBC并意外地在/ usr / include中安装了头文件。我必须腐败一些东西。