gcc 8.0 又改语法规范要求了?

编译内核报错:
In file included from arch/mips/kernel/syscall.c:17:
./include/linux/syscalls.h:195:18: error: ▒sys_mips_mmap▒ alias between functions of incompatible types ▒long int(long unsigned int, long unsigned int, long unsigned int, long unsigned int, long unsigned int, off_t)▒ {aka ▒long int(long unsigned int, long unsigned int, long unsigned int, long unsigned int, long unsigned int, long int)▒} and ▒long int(long int, long int, long int, long int, long int, long int)▒ [-Werror=attribute-alias]


这怎么解决?
<mock-chroot> sh-4.4# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/mips64el-redhat-linux/8/lto-wrapper
Target: mips64el-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --disable-multilib --with-system-zlib --cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-gnu-indirect-function --with-arch=mips64r2 --with-abi=64 --build=mips64el-redhat-linux
Thread model: posix
gcc version 8.0.1 20180222 (Red Hat 8.0.1-0.16) (GCC)
<mock-chroot> sh-4.4# make kernelversion

4.9.80-1.fc28.1.mips64el
<mock-chroot> sh-4.4#

已邀请:

xuchenghua

赞同来自:

看起来是语法要求更严格了,要么该代码,要么把这个warning变error的选项
”-Werror=attribute-alias“修改为
“-Wno-error=attribute-alias”。
 

要回复问题请先登录注册