ARM64 – Catastrophic Compile Errors with 4.10-rc1 – and a Fix..
Tried compiling Kernel 4.10-rc1 for aarch64, and got – literally – hundreds of errors:
...... ./include/linux/sched.h:3299: Error: unknown mnemonic `return' -- `return test_ti_thread_flag(task_thread_info(tsk),flag)' ./include/linux/sched.h:3300: Error: junk at end of line, first unrecognized character is `}' ./include/linux/sched.h:3302: Error: unknown mnemonic `static' -- `static inline void set_tsk_need_resched(struct task_struct*tsk)' ./include/linux/sched.h:3303: Error: junk at end of line, first unrecognized character is `{' ./include/linux/sched.h:3304: Error: unknown mnemonic `set_tsk_thread_flag' -- `set_tsk_thread_flag(tsk,1)' ./include/linux/sched.h:3305: Error: junk at end of line, first unrecognized character is `}' ./include/linux/sched.h:3307: Error: unknown mnemonic `static' -- `static inline void clear_tsk_need_resched(struct task_struct*tsk)' ./include/linux/sched.h:3308: Error: junk at end of line, first unrecognized character is `{' ./include/linux/sched.h:3309: Error: unknown mnemonic `clear_tsk_thread_flag' -- `clear_tsk_thread_flag(tsk,1)' ./include/linux/sched.h:3310: Error: junk at end of line, first unrecognized character is `}' ./include/linux/sched.h:3312: Error: unknown mnemonic `static' -- `static inline int test_tsk_need_resched(struct task_struct*tsk)' ./include/linux/sched.h:3313: Error: junk at end of line, first unrecognized character is `{' ./include/linux/sched.h:3314: Error: unknown mnemonic `return' -- `return unlikely(test_tsk_thread_flag(tsk,1))' ./include/linux/sched.h:3315: Error: junk at end of line, first unrecognized character is `}' ./include/linux/sched.h:3317: Error: unknown mnemonic `static' -- `static inline int restart_syscall(void)' ./include/linux/sched.h:3318: Error: junk at end of line, first unrecognized character is `{' ./include/linux/sched.h:3319: Error: unknown mnemonic `set_tsk_thread_flag' -- `set_tsk_thread_flag(current, 0)' ./include/linux/sched.h:3320: Error: unknown mnemonic `return' -- `return -513' ./include/linux/sched.h:3321: Error: junk at end of line, first unrecognized character is `}' ./include/linux/sched.h:3323: Error: unknown mnemonic `static' -- `static inline int signal_pending(struct task_struct*p)' ./include/linux/sched.h:3324: Error: junk at end of line, first unrecognized character is `{' ./include/linux/sched.h:3325: Error: unknown mnemonic `return' -- `return unlikely(test_tsk_thread_flag(p,0))' ./include/linux/sched.h:3326: Error: junk at end of line, first unrecognized character is `}' ./include/linux/sched.h:3328: Error: unknown mnemonic `static' -- `static inline int __fatal_signal_pending(struct task_struct*p)' ./include/linux/sched.h:3329: Error: junk at end of line, first unrecognized character is `{' ./include/linux/sched.h:3330: Error: unknown mnemonic `return' -- `return unlikely(sigismember(&p->pending.signal,9))' ./include/linux/sched.h:3331: Error: junk at end of line, first unrecognized character is `}' ./include/linux/sched.h:3333: Error: unknown mnemonic `static' -- `static inline int fatal_signal_pending(struct task_struct*p)' ./include/linux/sched.h:3334: Error: junk at end of line, first unrecognized character is `{' ./include/linux/sched.h:3335: Error: unknown mnemonic `return' -- `return signal_pending(p)&&__fatal_signal_pending(p)' ./include/linux/sched.h:3336: Error: junk at end of line, first unrecognized character is `}' ./include/linux/sched.h:3338: Error: unknown mnemonic `static' -- `static inline int signal_pending_state(long state,struct task_struct*p)' ./include/linux/sched.h:3339: Error: junk at end of line, first unrecognized character is `{' ./include/linux/sched.h:3340: Error: unknown mnemonic `if' -- `if (!(state&(1|128)))' ./include/linux/sched.h:3341: Error: unknown mnemonic `return' -- `return 0' ./include/linux/sched.h:3342: Error: unknown mnemonic `if' -- `if (!signal_pending(p))' ./include/linux/sched.h:3343: Error: unknown mnemonic `return' -- `return 0' ./include/linux/sched.h:3345: Error: unknown mnemonic `return' -- `return (state&1)||__fatal_signal_pending(p)' ./include/linux/sched.h:3346: Error: junk at end of line, first unrecognized character is `}' ./include/linux/sched.h:3358: Error: unknown mnemonic `static' -- `static inline int _cond_resched(void){return 0' ./include/linux/sched.h:3358: Error: junk at end of line, first unrecognized character is `}' ./include/linux/sched.h:3366: Error: unknown mnemonic `extern' -- `extern int __cond_resched_lock(spinlock_t*lock)' ./include/linux/sched.h:3373: Error: unknown mnemonic `extern' -- `extern int __cond_resched_softirq(void)' ./include/linux/sched.h:3380: Error: unknown mnemonic `static' -- `static inline void cond_resched_rcu(void)' ./include/linux/sched.h:3381: Error: junk at end of line, first unrecognized character is `{' ./include/linux/sched.h:3387: Error: junk at end of line, first unrecognized character is `}' ./include/linux/sched.h:3389: Error: unknown mnemonic `static' -- `static inline unsigned long get_preempt_disable_ip(struct task_struct*p)' - and many more..
The problems only occurs with ARM64/aarch64. I have tested ARMv7 kernel compiles, and these appear to be OK (and x86 is OK too..)
There is a ‘revert’ patch to fix this – although the longer-term solution may be different: http://lkml.iu.edu/hypermail/linux/kernel/1612.3/00280.html
I have applied this, and it appears to fix the compile errors (Odroid C2)..
Robert Gadsdon. December 26, 2016.
Comments
ARM64 – Catastrophic Compile Errors with 4.10-rc1 – and a Fix.. — No Comments