[HACK] Re: Who understands this code?

Greg Schafer gschafer at zip.com.au
Sat Mar 15 14:12:58 PST 2003


On Sat, Mar 15, 2003 at 10:50:25AM -0500, Donald Smith wrote:
> Greg Schafer wrote:
> >
> >Ok, this is a HACK but it's what I'm going to run with for the time being
> >unless someone can come up with something better. Works for me.
> >
> >Greg
> >
> >
> >------------------------------------------------------------------------
> >
> >diff -uNr gcc-3.2.2.orig/gcc/configure gcc-3.2.2/gcc/configure
> >--- gcc-3.2.2.orig/gcc/configure	2003-02-04 11:17:46.000000000 +1100
> >+++ gcc-3.2.2/gcc/configure	2003-03-15 10:35:01.000000000 +1100
> >@@ -4210,6 +4210,12 @@
> >   x = anonmap (pg);
> >   if (x == (char *)MAP_FAILED)
> >     perror_exit ("test 3 mmap 1", 14);
> >+
> >+/* HACK - repeat the first anonmap so as to avoid a subtle race condition
> >+   with a small (less than one memory page) ld.so.cache file that causes
> >+   the check to fail incorrectly.  */
> >+  x = anonmap (pg);
> >+
> >   y = anonmap (pg);
> >   if (y == (char *)MAP_FAILED)
> >     perror_exit ("test 3 mmap 2", 15);
> 
> Probably fine for a hack, tough I would check for success again by 
> copying the "if ... perror ..." lines also (or add your hack before the 
> first one).
> 
> BTW, now it will fail if the ld.so.cache file is two memory pages in 
> size ;-)

Arggghhhh!! I just woke and checked out the results of the overnight builds
and you are spot on :-(  When rebuilding Ch 6 again the ld.so.cache file is
now 6151 bytes in size and so it fscks up again....

This is an almighty pain in the buttocks. I'm tempted to pull out the dirty
hacks and just "rm /etc/ld.so.cache" before the gcc configure but I'd rather
just fix it properly by fixing the test to do the right thing.

Again I make the request, Don can you (or anyone else for that matter) cook
up a patch to fix that test properly?

It's just awkward and messy to apply the hack on the "when applicable"
occasions.

Greg
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list