Forum Discussion
Altera_Forum
Honored Contributor
8 years ago --- Quote Start --- Hi, Please add -D name option switches like
nios2-linux-uclibc-gcc -c -D __ASSEMBLY__ -D __KERNEL__ -I/home/developer/altera/nios2-linux/linux-2.6/include -I/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/include -I/home/developer/altera/nios2-linux/uClinux-dist/linux-2.6.x/include /home/developer/altera/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S. Some include files are used as mixed C and assembly codes. So there is the# ifndef __ASSEMBLY__ macro like
14# define _ASM_NIOS2_PTRACE_H
15
16# include <uapi/asm/ptrace.h>
17
18 /* This struct defines the way the registers are stored on the
19 stack during a system call. */
20
21# ifndef __ASSEMBLY__
22 struct pt_regs {
23 unsigned long r8; /* r8-r15 Caller-saved GP registers */
24 unsigned long r9;
25 unsigned long r10;
26 unsigned long r11;
27 unsigned long r12;
28 unsigned long r13;
. Kazu --- Quote End --- That takes me back where I started:
$ nios2-linux-uclibc-gcc -c -D __ASSEMBLY__ -D __KERNEL__ -I/home/developer/altera/nios2-linux/linux-2.6/include -I/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/include -I/home/developer/altera/nios2-linux/uClinux-dist/linux-2.6.x/include /home/developer/altera/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S
/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S: Assembler messages:
/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S:138: Error: expecting control register
/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S:138: Error: unknown register r5
/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S:546: Error: expecting control register
/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S:546: Error: unknown register r6