Forum Discussion
Altera_Forum
Honored Contributor
20 years agoI don't know how far the changes of the official release go, but unless you are compiling for your host architecture, you need to provide a cross compiler and a architecture.
e.g. suppose I am running on a ia32 machine and want to compile a kernel for my machine I am running on, then I would do($ make mrproper)
$ make oldconfig
$ make dep
$ make
$ make modules All have a very good meaning (some are not absolutely needed in 2.6 kernels, but are provided here for completeness). mrproper removes ALL configuration of a previous build (back-up your .config if you want to keep it); you start from a clean slate. However, when I want to compile e.g. for PowerPC (run the kernel on a PowerPC, target) on my machine (which is still a ia32 arch), I need to provide more options: $ make ARCH=ppc CROSS_COMPILE=powerpc-linux- mrproper
etc ... the ARCH matches a dir in the arch dir of the kernel sources and the CROSS_COMPILE is the prefix for the compiler. Since you did not provide any of them in the first example, the build system is going to assume that you want to compile for your host arch with the default compiler (gcc). Since you provided a CROSS_COMPILE setting in the second example, the build system is going to prepend powerpc-linux- to gcc so you're going to use the powerpc-linux-gcc compiler. The build system will also figure out that you need the gcc compiler for creating some minor tools and utilities to build your kernel for your target, and for that you'll need your host compiler (gcc). Since you are using a less than ideal kernel development environment, you get those errors (last I know, Windows does not ship with gcc out of the box). I also have no clue if you need gcc in the shipped version of the nios2 devkit. In any case, I assume you need to adjust the settings to match your target: IIRC for Wintendo $ make ARCH=nios2nommu CROSS_COMPILE=nios2-elf- mrproper If you have questions like this (I've seen some along these lines over the last weeks), your first reaction should be the kernel build howto (http://www.digitalhermit.com/linux/kernel-build-howto.html)... This covers all the basic Linux kernel building questions. Also, search google for cross compiling. It will return some interesting info.