This should be quite simple but for the life of me I can't find a solution. I am trying to install an old Linux kernel (3.14) together with the latest version of OpenWRT from "master" branch. I have managed to get everything working up to the point of compiling the kernel.
In file included from include/linux/compiler.h:54:0, from include/uapi/linux/stddef.h:1, from include/linux/stddef.h:4, from /home/osboxes/openwrt/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/linux-3.14/include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/page-flags.h:8, from kernel/bounds.c:9: include/linux/compiler-gcc.h:106:1: fatal error: linux/compiler-gcc7.h: No such file or directory #include gcc_header(__GNUC__) ^~~~ compilation terminated. /home/osboxes/openwrt/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/linux-3.14/./Kbuild:35: recipe for target 'kernel/bounds.s' failed make: *** [kernel/bounds.s] Error 1 Makefile:884: recipe for target 'prepare0' failed make: *** [prepare0] Error 2 make: Leaving directory '/home/osboxes/openwrt/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/linux-3.14'
I suspect this kernel requires to be compiled with only gcc3 or gcc4 (in the directory where it's trying to look for 'compiler-gcc7.h', there is 'compiler-gcc3.h' and 'compiler-gcc4.h'). How can I tell Openwrt to use gcc4 for this kernel? Something like:
make V=s gcc=4
If I can get it to work with gcc4, I am sure everything will compile fine. Also, I got the kernel from OpenWrt, by modifying makefile, so it is supported. Just the gcc bit messing things up. I have tried installing gcc4 on my system, it didn't help. I even set 'alias gcc=/usr/bin/gcc4' to ensure its the one being used, didn't help me a bit.