• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Preccompiled header compatibility
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preccompiled header compatibility


  • Subject: Re: Preccompiled header compatibility
  • From: email@hidden (Stefan Haller)
  • Date: Mon, 31 Aug 2009 19:15:17 +0200

Chris Espinosa <email@hidden> wrote:

> On Aug 31, 2009, at 6:24 AM, Stefan Haller wrote:
>
> > I need to find out whether a precompiled header is compatible with the
> > current version of gcc that I'm building with. To do this, I remember
> > the version that the precompiled headers were built with (by using the
> > last line of the output of gcc -v), and when building again I check
> > that
> > it matches the current gcc; if it doesn't, I know I need to delete the
> > precompiled headers.
> >
> > This has worked well with Devtools updates in the past, but it failed
> > for the upgrade from Xcode 3.1.3 on 10.5 to Xcode 3.2 on Snow Leopard.
> > The build number returned by "gcc-4.0 -v" is the same for both:
> >
> >   gcc version 4.0.1 (Apple Inc. build 5493)
> >
> > but still the precompiled headers are incompatible.
> >
> > Is there some other information besides gcc -v that I can query for
> > this
> > purpose?
>
> The information that determines precompiled header compatibility is
> stored inside the precompiled header itself. Open ~/Library/Caches/
> Xcode/SharedPrecompiledHeaders/Foo-[UUID]/Foo.pch.gch.hash-criteria in
> any text editor, and you'll see the command-line options that it was
> built with.  Any difference in these command line options will cause
> the precompiled header to be regenerated.
>
> But in your case the most likely cause is one or the other of thses:
>
> - in Snow Leopard, the default compiler is gcc 4.2
> - in Snow Leopard, the Xcode tool chain runs in 64-bit mode
>
> Either of these would cause the precompiled headers to be regenerated.

Thanks.  I'm not using Xcode, but a Makefile-based build system.  Before
calling make, I need to trash the precompiled headers if they are not
compatible.  To find out if this is the case, I remember the
command-line options that the headers were built with, and the version
of gcc that was used to build them.  None of these have changed when I
upgraded to Xcode 3.2 (I explicitly call g++-4.0), so it must be the
64-bit thing then.

How do I determine whether gcc will run in 32-bit mode or 64-bit mode?
How does Xcode do it?  It doesn't even store the gcc version that was
used to build the precompiled headers (at least not in
.gch.hash-criteria).

Thanks,
   Stefan


--
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Preccompiled header compatibility
      • From: Chris Espinosa <email@hidden>
References: 
 >Re: Preccompiled header compatibility (From: Chris Espinosa <email@hidden>)

  • Prev by Date: Re: how do you go back
  • Next by Date: Re: Xcode 3.2 10.3.9 SDK Error
  • Previous by thread: Re: Preccompiled header compatibility
  • Next by thread: Re: Preccompiled header compatibility
  • Index(es):
    • Date
    • Thread