Toolchain build failures.

Charity charity at
Mon Jan 29 11:47:37 PST 2007

Charity wrote:
> Kevin Day wrote:
>> On 1/26/07, Charity <charity at> wrote:
>>> This is because -fstack-protector is failing. SSP is not built in the
>>> first gcc build. Support for it is supposed to be built into glibc-2.5,
>>> however, after some checking, it tells me "cannot find -lssp_nonshared"
>>> whenever I try to compile something with -fstack-protector. That means
>>> that gcc supports it, but it is not installed. How can I be sure it is
>>> installed in glibc? I made sure I am using the newly compiled gcc and
>>> the linker seems to be the new glibc.
>>> After some more research, it seems that something is going wrong with
>>> the first gcc build or glibc is not being linked to properly. I know
>>> HLFS is in development, but the link to the old stable version of the
>>> book is broken. I'm going to try rebuilding gcc after each step just to
>>> see if it builds. This should work right? If bootstrapping builds the
>>> compiler once, uses the first build to build a second and the second to
>>> build a third for comparison, then the compiler should be able to be
>>> built after the installation?
>> gcc (4.1) hardcodes both -lssp and -lssp_nonshared when
>> -fstack-protector is passed.
>> Instead of letting the linker decide on whether you are using
>> and libssp.a they felt the need to explicitly identify them
>> as different.
>> My approach was to use the patch below and rename
>> lib/libssp_nonshared.a to lib/libssp.a so that if for any reason I
>> needed libssp.a (such as gcc -static) I would be able to do such and
>> the linker would know what to do.
>> gcc-4.1.1-no_static_ssp-1.patch:
> That's not the whole problem. It can't find -lssp either. It's just 
> that  -lssp_nonshared happens to be listed first in the specs file. I'm 
> trying a new approach. I can't get the whole toolchain to build at once 
> after it's installed no matter what I try. It seems to mess up the 
> linking. I'm trying to follow the seperate build instructions just using 
> the newer gcc and binutils. Then I noticed the gcc build instructions 
> say it needs gmp and mpfr. It may not be absolutely needed, but it does 
> get rid of the error in the configure stage.
That seems to work. I followed the package and build oder of 
SVN-20060510 and just used most of the configure options and extra fixes 
from SVN-20061205. I'm now in the chroot environment and working on 
Chapter 6 without problems so far. I did have to add gmp and mpfr prior 
to anything else.

More information about the hlfs-dev mailing list