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.

So:
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 
found.

robert

Attachment: pgppZphlzqLSc.pgp
Description: PGP signature

-- 
http://linuxfromscratch.org/mailman/listinfo/hlfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to