This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

other/9830: [pch] not working on Solaris 9


>Number:         9830
>Category:       other
>Synopsis:       [pch] not working on Solaris 9
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 24 13:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Michael Teske
>Release:        gcc version 3.4 20030222 (experimental)
>Organization:
>Environment:
Solaris 9
>Description:
Under SOlaris 9, when trying to use any precompiled header, gcc/g++ bails out with a "had to relocate PCH"-error message.
This is because in the mmap-call in gt_pch_restore(), the MAP_FIXED falg is missing, causing Solaris to return a different address from the specified one. 
>How-To-Repeat:
Try to include a file whre a .pch-file exists, too.
>Fix:
Use this patch. One might have to check for solaris, though, since I don't know if MAP_FIXED is a generic mmap option.


*** ggc-common.c-orig   Mon Feb 24 11:47:34 2003
--- ggc-common.c        Mon Feb 24 14:23:31 2003
***************
*** 583,589 ****

  #if HAVE_MMAP_FILE
    addr = mmap (mmi.preferred_base, mmi.size,
!              PROT_READ | PROT_WRITE, MAP_PRIVATE,
               fileno (f), mmi.offset);
  #else
    addr = (void *)-1;
--- 583,589 ----

  #if HAVE_MMAP_FILE
    addr = mmap (mmi.preferred_base, mmi.size,
!              PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED ,
               fileno (f), mmi.offset);
  #else
    addr = (void *)-1;
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]