Difference between revisions of "Kernel Build"
From LinuxMIPS
(Formatting fixes.) |
(More formatology) |
||
| Line 1: | Line 1: | ||
| − | + | First get Linux/MIPS kernel sources, for example from [[Net_Resources#Anonymous_CVS|CVS]]. In the next step we need to configure the kernel sources by running <tt>make config</tt>, <tt>make menuconfig</tt>, <tt>make xconfig</tt> | |
| − | + | == Common problems == | |
| − | + | === Problems caused by non-Linux/MIPS toolchain === | |
| − | + | ||
| − | + | <pre> | |
| + | make[1]: Entering directory `/usr/src/linux-mips/arch/mips/kernel' mips_4KC-gcc | ||
| + | -D__ASSEMBLY__ -D__KERNEL__ -I/usr/eldk/usr/src/linux-mips/include | ||
| + | -D_MIPS_SZLONG=32 -D_MIPS_SZPTR=32 -D_MIPS_SZINT=32 -g -G 0 -mno-abicalls | ||
| + | -fno-pic -pipe -c -o entry.o entry.S | ||
| − | + | entry.S: Assembler messages: | |
| − | + | entry.S:225: Error: unrecognized opcode `reg_s $8,164($29)' | |
| − | + | entry.S:226: Error: unrecognized opcode `reg_s $8,164($29)' | |
| + | </pre> | ||
| − | _MIPS_SZLONG etc. are normally defined by the gcc compiler driver. That is they | + | _MIPS_SZLONG etc. are normally defined by the gcc compiler driver. That is they should never be defined by the application itself. The precense of such kludgery usually indicates the use of a [[toolchain]] that wasn't configured for a Linux/MIPS target. |
| − | should never be defined by the application itself. | + | |
| − | == Ld dies with signal 6 == | + | === Ld dies with signal 6 === |
| − | + | <pre> | |
| + | collect2: ld terminated with signal 6 [Aborted] | ||
| + | </pre> | ||
This is a known bug in some ''very'' old binutils versions. You will have to upgrade to at least binutils 2.8.1 plus very current patches. With Linux 2.4 or newer binutils 2.13.2.1 or newer is probably recommended. | This is a known bug in some ''very'' old binutils versions. You will have to upgrade to at least binutils 2.8.1 plus very current patches. With Linux 2.4 or newer binutils 2.13.2.1 or newer is probably recommended. | ||
| − | == Linux 2.6 build fails early == | + | === Linux 2.6 build fails early === |
| − | <code> | + | <code><pre> |
| − | + | $ make | |
| − | + | CHK include/linux/version.h | |
| − | + | HOSTCC scripts/basic/fixdep | |
| − | + | HOSTCC scripts/basic/split-include | |
| − | + | HOSTCC scripts/basic/docproc | |
| − | + | CC scripts/mod/empty.o | |
| − | + | gcc: cannot specify -o with -c or -S and multiple compilations | |
| − | + | make[2]: *** [scripts/mod/empty.o] Error 1 | |
| − | + | make[1]: *** [scripts/mod] Error 2 | |
| − | + | make: *** [scripts] Error 2 | |
| − | </code> | + | </pre></code> |
There are two possible causes for this failure known: | There are two possible causes for this failure known: | ||
* Make sure you have set CONFIG_CROSSCOMPILE or add <code>CROSS_COMPILE=<[[Endianess#GNU_Configuration_Names|target]]></code> to the make invocation. | * Make sure you have set CONFIG_CROSSCOMPILE or add <code>CROSS_COMPILE=<[[Endianess#GNU_Configuration_Names|target]]></code> to the make invocation. | ||
* A few early Linux 2.6 kernels had a bug which would always result in this error message. In this case you really should upgrade. | * A few early Linux 2.6 kernels had a bug which would always result in this error message. In this case you really should upgrade. | ||
Revision as of 13:07, 19 May 2005
First get Linux/MIPS kernel sources, for example from CVS. In the next step we need to configure the kernel sources by running make config, make menuconfig, make xconfig
Contents |
Common problems
Problems caused by non-Linux/MIPS toolchain
make[1]: Entering directory `/usr/src/linux-mips/arch/mips/kernel' mips_4KC-gcc -D__ASSEMBLY__ -D__KERNEL__ -I/usr/eldk/usr/src/linux-mips/include -D_MIPS_SZLONG=32 -D_MIPS_SZPTR=32 -D_MIPS_SZINT=32 -g -G 0 -mno-abicalls -fno-pic -pipe -c -o entry.o entry.S entry.S: Assembler messages: entry.S:225: Error: unrecognized opcode `reg_s $8,164($29)' entry.S:226: Error: unrecognized opcode `reg_s $8,164($29)'
_MIPS_SZLONG etc. are normally defined by the gcc compiler driver. That is they should never be defined by the application itself. The precense of such kludgery usually indicates the use of a toolchain that wasn't configured for a Linux/MIPS target.
Ld dies with signal 6
collect2: ld terminated with signal 6 [Aborted]
This is a known bug in some very old binutils versions. You will have to upgrade to at least binutils 2.8.1 plus very current patches. With Linux 2.4 or newer binutils 2.13.2.1 or newer is probably recommended.
Linux 2.6 build fails early
$ make
CHK include/linux/version.h
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/split-include
HOSTCC scripts/basic/docproc
CC scripts/mod/empty.o
gcc: cannot specify -o with -c or -S and multiple compilations
make[2]: *** [scripts/mod/empty.o] Error 1
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
There are two possible causes for this failure known:
- Make sure you have set CONFIG_CROSSCOMPILE or add
CROSS_COMPILE=<target>to the make invocation. - A few early Linux 2.6 kernels had a bug which would always result in this error message. In this case you really should upgrade.