This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] [COMMITTED] Fix bootstrap on powerpc-apple-darwin
Matt Austern <austern@apple.com> writes:
> Like Benjamin, I'm still seeing a bootstrap failure. From the
> traceback, it looks to me like the failure I'm seeing is probably
> still related to the bug your patch addressed:
> (gdb) where
> #0 0x9009ec18 in abort ()
> #1 0x000b7e1c in c_common_no_more_pch () at
> ../../fsf-mainline/gcc/c-pch.c:404
> #2 0x000b7e1c in c_common_no_more_pch () at
> ../../fsf-mainline/gcc/c-pch.c:404
> #3 0x0001eb84 in c_lex_with_flags (value=0x7260c8, cpp_flags=0x0) at
> ../../fsf-mainline/gcc/c-lex.c:424
> #4 0x0001ebec in c_lex (value=0x7260c8) at
> ../../fsf-mainline/gcc/c-lex.c:435
Try this patch.
Ian
Index: host-darwin.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/host-darwin.c,v
retrieving revision 1.9
diff -p -u -r1.9 host-darwin.c
--- host-darwin.c 12 Mar 2004 19:45:49 -0000 1.9
+++ host-darwin.c 13 Mar 2004 01:18:06 -0000
@@ -180,16 +180,19 @@ darwin_rs6000_gt_pch_use_address (void *
if (munmap (pch_address_space + sz, sizeof (pch_address_space) - sz) != 0)
fatal_error ("couldn't unmap pch_address_space: %m\n");
- mmap_result = mmap (addr, sz,
- PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED,
- fd, off);
+ if (ret)
+ {
+ mmap_result = mmap (addr, sz,
+ PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED,
+ fd, off);
- /* The file might not be mmap-able. */
- ret = mmap_result == (void *) MAP_FAILED;
+ /* The file might not be mmap-able. */
+ ret = mmap_result == (void *) MAP_FAILED;
- /* Sanity check for broken MAP_FIXED. */
- if (ret && mmap_result != addr)
- abort ();
+ /* Sanity check for broken MAP_FIXED. */
+ if (ret && mmap_result != addr)
+ abort ();
+ }
return ret;
}