[HACK] Re: Who understands this code?

Donald Smith dss-lfs at cfl.rr.com
Sat Mar 15 07:50:25 PST 2003


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 ;-)

Don

-- 
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