3

I am encountering a problem while trying to setup a cross-compiler for an old linux kernel.

cp -dpRf package/config/buildroot-config /tmp/buildroot/buildroot-2009.02/project_build_mips/uclibc/buildroot-config
(cd /tmp/buildroot/buildroot-2009.02/toolchain_build_mips/linux-2.6.15; \
     /usr/bin/make -j1 ARCH=mips \
        HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" \
        HOSTCXX="/usr/bin/g++" \
        INSTALL_HDR_PATH=/tmp/buildroot/buildroot-2009.02/toolchain_build_mips/linux headers_install; \
    )
make[1]: Entering directory `/tmp/buildroot/buildroot-2009.02/toolchain_build_mips/linux-2.6.15'
Makefile:486: .config: No such file or directory
make[1]: *** No rule to make target `headers_install'.  Stop.
make[1]: Leaving directory `/tmp/buildroot/buildroot-2009.02/toolchain_build_mips/linux-2.6.15'
make: *** [/tmp/buildroot/buildroot-2009.02/toolchain_build_mips/linux/.configured] Error 2

notice the make[1]: *** No rule to make target 'headers_install'. Stop. line. I made a search on stackoverflow and came across this thread: Setup buildroot for old kernels.

The guy faced the same problem as me. The answer, suggested using an old version of buildroot. Therefore I used buildroot-2009.02 which is the oldest version of buildroot, but still got the same result.

Please don't advise me to upgrade my kernel to a newer version, I must use particularly this version.

I would love to get explanation about what it says and maybe someone could help me fix it.

Thanks in advance.

Community
  • 1
  • 1
CodeNinja
  • 291
  • 5
  • 19
  • If you only have to cross-compile the kernel, then why do you need Buildroot? Back in the day of Linux 2.6.15 (circa 2006?), Buildroot was rather new and not that stable, and I was building the Linux kernel and rootfs without it. – sawdust Dec 19 '14 at 21:28
  • can you give me a reference to start with? – CodeNinja Dec 19 '14 at 21:40
  • The **README** file (as well as the **Documentation** directory) in your kernel source describes how to configure and compile the kernel. BTW I looked at an old Buildroot 20070706, and it lives up to its name: it only builds the root filesystem. **The old Buildroot does not build the Linux kernel.** So you seem to have no choice but to use the basic Linux kernel build procedure. – sawdust Dec 19 '14 at 22:17

1 Answers1

2

The error you show doesn't seem to be related to building the kernel, but rather it seems to be during the toolchain (= cross-compiler) build. The toolchain needs to install the kernel headers, which are used by the C library to create system calls. To do this, buildroot uses the 'headers_install' target of the kernel.

Unfortunately, this target was only introduced in Linux 2.6.18. So with your kernel version, you cannot use buildroot to build the cross compiler.

I also don't know how you're supposed to do build a cross-compiler for such an old kernel. You can try to use the original 'crosstool' project (not crosstool-NG, that is also too modern).

Arnout
  • 2,927
  • 16
  • 24
  • lol, thanks for the answer. I will try to do it. I also though about something else such as trying to make this `headers_install` makefile myself – CodeNinja Dec 30 '14 at 20:26
  • Is there an update? Were you successful in building a cross-compiler? If so, how? – bzupnick Oct 29 '15 at 08:54