Error When Compiling Linux Kernel 3.2 for Arm

Error when compiling Linux kernel 3.2 for ARM

Your kernel version (3.2.0) is too old and not compatible with used gcc (gcc-5). You may use gcc-4 to compile kernel, or use newer kernel version.

Your kernel has special include in linux/compiler-gcc.h header
http://lxr.free-electrons.com/source/include/linux/compiler-gcc.h?v=3.2#L91

 91 #define __gcc_header(x) #x
92 #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
93 #define gcc_header(x) _gcc_header(x)
94 #include gcc_header(__GNUC__)

It will include different files for different gcc versions (GNUC is major version of gcc). It supports gcc-3 and gcc-4, but not gcc-5:

http://lxr.free-electrons.com/source/include/linux/?v=3.2

C file  compiler-gcc.h  3705 bytes
C file compiler-gcc3.h 631 bytes
C file compiler-gcc4.h 2073 bytes
C file compiler-intel.h 746 bytes
C file compiler.h 8628 bytes

You may try to rewrite compiler-gcc4.h to compiler-gcc5.h, but you should understand how to do this. You may not just copy gcc4 to gcc5, there will incorrect macro.

The compiler-gcc5.h was added only to linux kernel version 3.18: http://lxr.free-electrons.com/source/include/linux/compiler-gcc5.h?v=3.18 (not in 3.17 http://lxr.free-electrons.com/source/include/linux/compiler-gcc5.h?v=3.17)

Older linaro compiler (before gcc-5) is https://releases.linaro.org/components/toolchain/binaries/4.9-2016.02/

And according to JJ Hakala comment, there is the compiler-gcc5 header in last version of 3.2.* kernel, the 3.2.81: https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.81.tar.gz - just change wget command and tar xjf to this version and retry.

glibc configure doesn't recognize Linux header files

--with-headers=/home/teo.samarzija/linux-5.7.6/include

This looks like a checked-out kernel tree. You need to install the kernel tree first and specify that location, using a command like this:

make -C /home/teo.samarzija/linux-5.7.6 ARCH=arm64 \
INSTALL_HDR_PATH=/home/teo.samarzija/linux-5.7.6-installed/usr \
headers_install

(You still have to set CC et al. appropriate to pick up the cross-compiler.)

And the use --with-headers=/home/teo.samarzija/linux-5.7.6-installed/usr/include.

ARM-linux4.3.2, can't open socket with PF_PACKET type

Do you have CONFIG_PACKET defined in your kernel config? That's required for AF_PACKET.



Related Topics



Leave a reply



Submit