https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86460
Bug ID: 86460 Summary: GCC 8.1 cross-compiler fails to compile linux kernel Product: gcc Version: 8.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bneumeier at gmail dot com Target Milestone: --- I have an AMD64-to-mipsel GCC 8.1 with branch updates through 2018-06-30. When I try to compile Linux 4.17.4 with it, the build crashes at arch/mips/kernel/signal.c with the errors below. Similar issues occur in kernel/syscall.c, mm/cache.c, and elsewhere. I'm able to work around the issue by adding -Wno-error=attribute-alias. ----- In file included from arch/mips/kernel/signal.c:26: ./include/linux/syscalls.h:233:18: error: 'sys_sigsuspend' alias between functions of incompatible types 'long int(sigset_t *)' {aka 'long int(struct <anonymous> *)'} and 'long int(long int)' [-Werror=attribute-alias] asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ ^~~ ./include/linux/syscalls.h:222:2: note: in expansion of macro '__SYSCALL_DEFINEx' __SYSCALL_DEFINEx(x, sname, __VA_ARGS__) ^~~~~~~~~~~~~~~~~ ./include/linux/syscalls.h:211:36: note: in expansion of macro 'SYSCALL_DEFINEx' #define SYSCALL_DEFINE1(name, ...) SYSCALL_DEFINEx(1, _##name, __VA_ARGS__) ^~~~~~~~~~~~~~~ arch/mips/kernel/signal.c:547:1: note: in expansion of macro 'SYSCALL_DEFINE1' SYSCALL_DEFINE1(sigsuspend, sigset_t __user *, uset) ^~~~~~~~~~~~~~~ ./include/linux/syscalls.h:238:18: note: aliased declaration here asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ ^~~~~~~~ ./include/linux/syscalls.h:222:2: note: in expansion of macro '__SYSCALL_DEFINEx' __SYSCALL_DEFINEx(x, sname, __VA_ARGS__) ^~~~~~~~~~~~~~~~~ ./include/linux/syscalls.h:211:36: note: in expansion of macro 'SYSCALL_DEFINEx' #define SYSCALL_DEFINE1(name, ...) SYSCALL_DEFINEx(1, _##name, __VA_ARGS__) ^~~~~~~~~~~~~~~ arch/mips/kernel/signal.c:547:1: note: in expansion of macro 'SYSCALL_DEFINE1' SYSCALL_DEFINE1(sigsuspend, sigset_t __user *, uset) ^~~~~~~~~~~~~~~ ./include/linux/syscalls.h:233:18: error: 'sys_sigaction' alias between functions of incompatible types 'long int(int, const struct sigaction *, struct sigaction *)' and 'long int(long int, long int, long int)' [-Werror=attribute-alias] asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ ^~~ ./include/linux/syscalls.h:222:2: note: in expansion of macro '__SYSCALL_DEFINEx' __SYSCALL_DEFINEx(x, sname, __VA_ARGS__) ^~~~~~~~~~~~~~~~~ ./include/linux/syscalls.h:213:36: note: in expansion of macro 'SYSCALL_DEFINEx' #define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__) ^~~~~~~~~~~~~~~ arch/mips/kernel/signal.c:554:1: note: in expansion of macro 'SYSCALL_DEFINE3' SYSCALL_DEFINE3(sigaction, int, sig, const struct sigaction __user *, act, ^~~~~~~~~~~~~~~ ./include/linux/syscalls.h:238:18: note: aliased declaration here asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ ^~~~~~~~ ./include/linux/syscalls.h:222:2: note: in expansion of macro '__SYSCALL_DEFINEx' __SYSCALL_DEFINEx(x, sname, __VA_ARGS__) ^~~~~~~~~~~~~~~~~ ./include/linux/syscalls.h:213:36: note: in expansion of macro 'SYSCALL_DEFINEx' #define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__) ^~~~~~~~~~~~~~~ arch/mips/kernel/signal.c:554:1: note: in expansion of macro 'SYSCALL_DEFINE3' SYSCALL_DEFINE3(sigaction, int, sig, const struct sigaction __user *, act, ^~~~~~~~~~~~~~~ cc1: all warnings being treated as errors scripts/Makefile.build:312: recipe for target 'arch/mips/kernel/signal.o' failed -----