[LLVMbugs] [Bug 9281] New: Relocatable PCH support broken

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Feb 21 10:44:58 PST 2011


           Summary: Relocatable PCH support broken
           Product: clang
           Version: 2.8
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: alistair.low at fusemail.com
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=6198)
 --> (http://llvm.org/bugs/attachment.cgi?id=6198)
Patch to clang.

I tried to create a relocatable PCH as part of a project built on top of clang
but there were some problems - The PCH would always contain absolute paths
instead of relative ones, so it would fail when we tried to use it later. 

After some debugging, I noticed that the PCHGenerator constructor takes a
string pointer isysroot that is deleted before the PCHGenerator uses it (as a
pointer to a local variable is passed in), and thus a later comparison using it
fails. The Path::makeAbsolute() function in LLVM also fails to flip the back
slashes, which also breaks the same comparison.

The details are a bit sketchy as I worked on this a few weeks ago but didn't
get around to filing a bug until now. I have attached the patch that we made to
fix it for us though.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list