On Sat, Aug 05, 2006 at 03:37:31PM -0400, Robert Connolly wrote:
> On Friday 04 August 2006 06:17, Alex Merry wrote:
> > On Thu, Aug 03, 2006 at 09:15:48PM -0400, Robert Connolly wrote:
> > > With the hardened specs I tried building and testing Glibc with
> > > CC="gcc -no-pie -fno-pic -fno-pie -norelro -nonow -no-fortify" CXX="g++
> > > ..." and got about a dozen test Errors. This shouldn't be. These flags
> > > should be equivalent to vanilla.
> >
> > Same. I managed to get rid of about a fifth to a quarter of the errors
> > with -no-pie -fno-PIE -DFORTIFY=0, which cancelled all the flags shown
> > by "gcc -v" on a dummy.c file (although running gcc -v -fno-PIE showed
> > it was running gcc with -fPIE and -fno-PIE on the same command line).
> 
> I didn't know -fno-PIE was a valid flag, I should probably add it.

It might not be, and that might explain the weird behaviour. The gcc
manpage just says "Most of these [-f and -W options] have both positive
and negative forms; the negative form of -ffoo would be -fno-foo." On
the other hand, it didn't balk at the option.

> 
> I have been trying one thing at a time, like -fpic in gcc specs, then 
> building 
> glibc, then replacing the specs with vanilla for make check. -fpic, -z relro, 
> and -z combreloc are no problem... make check passes perfectly (just the 
> posix/annexc.out ignored).

I completely forgot about the -z options.

> 
> -D_FORTIFY_SOURCE=2 won't let glibc build, let alone testsuite. I added 
> a !D_LIBC* condition to exclude D_FORTIFY_SOURCE, and it would build, but 
> testsuite failed. Maybe -D_FORTIFY_SOURCE can be added to all the utilities 
> but not the libraries, or everything but libc.so and/or ld.so, but I'm not 
> sure yet.

So that's why -D_FORTIFY_SOURCE=0 didn't affect the tests...

Alex :-)


-- 
Pippin
Computer Monkey to the Pelican
www.oxrev.org.uk, www.corpusjcr.org, www.rev.org.uk

Attachment: pgp0G3UPDSlOJ.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