-   Debian (
-   -   Impossible to compile kernel source (

kususe 07-27-2011 06:46 AM

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


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


Thanks in advance.

Dutch Master 07-27-2011 07:17 AM

Did you install the build-essential package?

knudfl 07-27-2011 08: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/ or /lib/x86_64-linux-gnu/

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

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


kususe 07-28-2011 12:11 PM

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


but also in

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 01: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>/

Sorry for : 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 05:45 AM

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

knudfl 07-29-2011 08: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 10:02 AM

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 01:18 AM


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
Wheezy libgcc1 : 4.6.1-4
Sid libgcc1 : 4.6.1-5

All times are GMT -5. The time now is 09:30 AM.