/tools requirements

Robert Connolly robert at linuxfromscratch.org
Fri Oct 9 19:44:13 PDT 2009

I'm starting this thread as a note list. This is a bit different than 
the "hlfs to clfs builds" thread, that related to issues 
building /cross-tools and /tools from an hlfs host.

I'm trying to harden x86_64 from the clfs chroot. I didn't harden /tools.

For Glibc applications, like iconv_prog, to build 
with -fPIE -pie, "/tools/lib/gcc/whatever-unknown-linux-gnu/?.?.?/crtend.o" 
needs to be built with -fPIC... /tools GCC needs to be compiled with -fPIC.

cp -vi gcc/config/i386/linux.h{,.orig}
sed 's/^\(#define CC1_SPEC.*\)\("\)$/\1 %{fno-pic|fpic|fPIC:;:-fPIC}\2/' \
    gcc/config/i386/linux.h.orig > gcc/config/i386/linux.h
... or
cp -vi gcc/config/i386/x86-64.h{,.orig}
sed 's/^\(#define CC1_SPEC.*\)\("\)$/\1 %{fno-pic|fpic|fPIC:;:-fPIC}\2/' \
        gcc/config/i386/x86-64.h.orig > gcc/config/i386/x86-64.h
... or add -fPIC to CFLAGS for GCC
... or use all of the above.

I doubt there will be more notes to add to this thread, but I'll add them if 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/hlfs-dev/attachments/20091009/4c2a9602/attachment.sig>

More information about the hlfs-dev mailing list