>  Reporter:  mfonseca  |       Owner:  [email protected]

>  While creating a x86 toolchain using lfs as a guideline, I noticed that a
>  "gcc -print-search-dirs" on my temporary toolchain printed out some
>  undesirable results.  It contained references to /usr/... and others that
>  I had assumed was handled by the gcc 4.1.2 spec patch.

Just because a dir appears in "gcc -print-search-dirs" output doesn't
necessarily mean it is actually searched. The whole "where does GCC
search" issue (ie: gcc/gcc.c) is well known as being an inconsistent mess.
See here for example:

http://gcc.gnu.org/ml/gcc-patches/2005-12/msg00685.html

You should perform some kind of sanity check. Something like this from the
DIY Next Gen build method is not perfect but might help:

# Sanity check - ensure host not being searched for libs
echo 'main(){}' | cc -x c -lbogus -v -Wl,--verbose - &> foo || :
if grep "^attempt to open /usr" foo; then
  echo Oops; exit 1
fi

Regards
Greg
-- 
http://www.diy-linux.org/

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-book
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to