Kernel compilation not finding .config file - linux

EDIT: Solved it, check my comment below.
I'm trying to compile a kernel with make O=$BUILD
Where build is the build path: BUILD=~/lab/build
But then I get this error:
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[3]: *** [silentoldconfig] Error 1
make[2]: *** [silentoldconfig] Error 2
make[1]: *** No rule to make target `include/config/auto.conf', needed by`include/config/kernel.release'. Stop.
Before I compiled I used the old config file for the new kernel by copying it to my kernel folder:
cp -vi /boot/config-3.13.0-45-generic .config
and then i ran:
make oldconfig
and entered all defaults.
How can I fix the error?

I got it to compile now by doing
make O=$BUILD oldconfig and also by doing a make mrproper in my kernel directory, and then running make O=$BUILD again.

Related

Generating the Linux kernel .config file is making the source folder unclean

I am currently trying to rebuild a linux kernel, and I'm experimenting some difficulties.
I have modified the .config using make menuconfig.
...
make[1]: Entering directory '/home/doe/build/linux'
CHK include/config/kernel.release
GEN ./Makefile
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
Using /home/doe/workspace/linux as source for kernel
/home/doe/workspace/linux is not clean, please run 'make mrproper'
in the '/home/doe/workspace/linux' directory.
/home/doe/workspace/linux/Makefile:1027: recipe for target 'prepare3' failed
make[1]: *** [prepare3] Error 1
...
Then I tried to run make mrproper. It works well and deletes my .config file from my build folder. Without surprise I cannot build because a .config file is missing.
I did a make defconfig followed by a make -j 8, just to try to build with some basic config file.
...
HOSTCC scripts/mod/file2alias.o
HOSTLD scripts/mod/modpost
HOSTCC arch/x86/tools/relocs_32.o
HOSTCC arch/x86/tools/relocs_64.o
HOSTCC arch/x86/tools/relocs_common.o
Using /home/doe/workspace/linux as source for kernel
/home/doe/workspace/linux is not clean, please run 'make mrproper'
in the '/home/doe/workspace/linux' directory.
/home/doe/workspace/linux/Makefile:1027: recipe for target 'prepare3' failed
make[1]: *** [prepare3] Error 1
make[1]: *** Waiting for unfinished jobs....
HOSTLD arch/x86/tools/relocs
make[1]: *** wait: No child processes. Stop.
Makefile:152: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
How am I supposed to build if generating a .config makes the source folder unclean ?
You should check whether the "include/config" directory exists in your kernel source.
The prepare3 target checks the '.config' file and the 'include/config' directory. You could find this by searching "prepare3" in the Makefile

While building kernel image i am getting this error while doing make -j4 (Using ubuntu)

lib/mpi/generic_mpih-lshift.o:/home/shubh/Root/XENO_WS/linux-3.8.13/lib/mpi/mpi-inline.h:110: first defined here
scripts/Makefile.build:443: recipe for target 'lib/mpi/mpi.o' failed
make[2]: *** [lib/mpi/mpi.o] Error 1
scripts/Makefile.build:454: recipe for target 'lib/mpi' failed
make[1]: *** [lib/mpi] Error 2
Makefile:791: recipe for target 'lib' failed
make: *** [lib] Error 2
make: *** Waiting for unfinished jobs....
How can I resolve this? When I am doing same steps in OpenSUSE it is not giving any error. I followed these steps:
make mrproper
make oldconfig
make -j4
then I get the error in between this.
So you use gcc of version 5, which is incompatible with Linux kernel version you want to compile. – Tsyvarev
It is resolve now. I build the kernel with lower version of gcc. – sam1006

MPFR installation can't find gmp-impl.h

I'm trying to install MPFR on cygwin.
I successfully ran "./configure --with-gmp-build=../gmp-5.1.3" and it doesn't gave me any error.
But when I ran "make install", it fails and gives following error.
In file included from exceptions.c:23:0:
mpfr-impl.h:71:24: fatal error: gmp-impl.h: No such file or directory
compilation terminated.
Makefile:674: recipe for target `exceptions.lo' failed
make[2]: *** [exceptions.lo] Error 1
make[2]: Leaving directory `/cygdrive/d/chamila/mpfr-3.1.2/src'
Makefile:798: recipe for target `install' failed
make[1]: *** [install] Error 2
make[1]: Leaving directory `/cygdrive/d/chamila/mpfr-3.1.2/src'
Makefile:385: recipe for target `install-recursive' failed
make: *** [install-recursive] Error 1
I added gmp location to path as well. What is wrong here? How can I solve this?
Don't use the --with-gmp-build option (unless you know what you're doing) and don't use relative paths with configure. If you have installed GMP in directory DIR, just use --with-gmp=DIR.

gcc make install error

I try to compile gcc with make install and it gives me this:
make[1]: Entering directory `/media/BOSS/sources/gcc-build'
/bin/bash ../gcc-4.8.1/mkinstalldirs /tools /tools
/bin/bash: line 3: cd: ./fixincludes: No such file or directory
make[1]: *** [install-fixincludes] Error 1
make[1]: Leaving directory `/media/BOSS/sources/gcc-build'
make: *** [install] Error 2
I am currently compiling it for lfs also I am in a seprate directory on a 32 bit computer
It seems the issue is caused by the target install. So my advice is to check the line in MakeFile which relates to [install].
Perhaps you may want to share more details for better solutions.

make[1]: arm-linux-gcc: Command not found in ubuntu [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
what is arm-linux-gcc and how to install this in ubuntu
While I'm trying this command
$ make ARCH=arm devkit8000 defconfig
I get this error:
make[1]: arm-linux-gcc: Command not found
make[1]: arm-linux-gcc: Command not found
scripts/kconfig/conf -s arch/arm/Kconfig
***
*** You have not yet configured your kernel!
*** (missing kernel .config file)
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[3]: *** [silentoldconfig] Error 1
make[2]: *** [silentoldconfig] Error 2
make[1]: *** No rule to make target `devkit8000'. Stop.
make: *** [devkit8000] Error 2
How can i solve this error?
Do you have ARM toolchain installed? If there is no such package in Ubuntu you can download it from the internet and add it to your $PATH.
Take a look at what is arm-linux-gcc and how to install this in ubuntu
EDIT:
It might be, that your makefile is looking for different filenames, than you have.
Try locating arm-linux-gnueabi-gcc file. Go to that directory and you may create links for each file with arm-linux-gnueabi- prefix.
Try after sudo su:
ln -s arm-linux-gnueabi-gcc arm-linux-gcc
ln -s arm-linux-gnueabi-cc arm-linux-cc
etc.
Might help, but I do not guarantee. Usually works ;-)

Resources