LFS-6.6, Stage2, glibc, nscd.c:442

Andrew Benton b3nton at gmail.com
Tue Jun 8 05:09:46 PDT 2010


On 07/06/10 16:35, linux fan wrote:
> # Hack to solve glibc __stack_chk_guard cross compile (<  2.4 :)
> # this schpeel in LFS-6.6 ch5 gcc-pass1 and ch5 gcc-pass2 after unpack:
> glibc=$(ls  /lib/libc-*.so)
> read j1 v[0] v[1] v[2] j2<<<  ${glibc//[-.]/ }
> if (( v[0]<  2 )) || (( v[1]<  4 ))&&  [ -f gcc/configure ]; then

shouldn't that be 
if (( ${v[0]} <  2 )) && (( ${v[1]} < 4 ))

>    # kick it
>    sed -i -e '/# Test for stack protector support in target C library/ {
>        a\
> gcc_cv_libc_provides_ssp=yes
>      } ' gcc/configure

can be reduced to:

sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' ../gcc-4.5.0/gcc/configure

so the whole thing can be reduced to:

v=($(ls  /lib/libc-*.so | sed 's/[.-]/ /g'))
[ (( ${v[1]} <  2 )) && (( ${v[2]} < 4 )) ] &&
sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' ../gcc-4.5.0/gcc/configure

Sorry for picking nits. It looks good and solves a problem I had due to 
one of my deviations. 
Thanks

Andy




More information about the lfs-support mailing list