LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   Impossible to compile kernel source (http://www.linuxquestions.org/questions/debian-26/impossible-to-compile-kernel-source-894036/)

kususe 07-27-2011 05:46 AM

Impossible to compile kernel source
 
When I try to compile kernel source (directly downloaded by kernel.org, decompressed in /usr/src), an errore is returned on stdout:

Code:

HOSTCC  scripts/basic/fixdep
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2

suggestions??

Thanks in advance.

Dutch Master 07-27-2011 06:17 AM

Did you install the build-essential package?

knudfl 07-27-2011 07:04 AM

( 'build-essential' is a 5kB package, that installs g++ and make ! )


In Debian Wheezy/Sid, only the system gcc will know the location of libgcc_s.
→ /lib/i386-linux-gnu/libgcc_s.so.1 or /lib/x86_64-linux-gnu/libgcc_s.so.1

Other "gcc", added from e.g. Debian Squeeze, will look for /lib/libgcc_s.so.1

So what is your OS, and which gcc is used for the above ? ?

..

kususe 07-28-2011 11:11 AM

I use a stable version of Debian (but I admit I've modified my sources.list with Wheezy repo).
I found
Code:

libgcc_s
in
Code:

/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/libgcc_s.so
but also in
Code:

/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.4/libgcc_s.so
Note that my file is different named by your one. And it's placed in another path.
I tried to delete one of them and put the other one in the directory you've indicate me in your post, but the error remains.

@Dutch Master: yes :D

knudfl 07-28-2011 12:23 PM

A temporary workaround, that usually works is :
cd /usr/local/lib/
# ln -s /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/<version>/libgcc_s.so

Sorry for libgcc_s.so.1 : I guess, I was rather sleepy.


My question from post #3 hasn't been answered ? ?
"" .. which gcc is used for the above ""

..

kususe 07-29-2011 04:45 AM

Ehm...
I'm sorry..What do you want to know exactly?

knudfl 07-29-2011 07:13 AM

The reason to ask for the gcc version :

It looks like you have a mix of a Squeeze gcc and a Wheezy libgcc.
( And that's probably not a good idea ? )

Compiling a new kernel : it will often want the same compiler
used again when you later have to add a new module.

My suggestion is to use a genuine Squeeze gcc install.

kususe 07-29-2011 09:02 AM

[Solved]
 
Oh yes, I've understood.
But..I upgraded Debian (using apt-get), I installed kernel-source (using apt-get install..) and now the problem is solved, because it seems I manage to customize the kernel using menuconfig.

However, is there a way to prove you idea?

knudfl 07-31-2011 12:18 AM

Quote:

However, is there a way to prove you idea ?
You mean, if a package is a Wheezy package ?
The full version number is visible is Synaptic.

Squeeze libgcc1 : 4.4.5-8 http://packages.debian.org/squeeze/libgcc1
Wheezy libgcc1 : 4.6.1-4
Sid libgcc1 : 4.6.1-5


All times are GMT -5. The time now is 02:00 PM.