Moving to Xcode: Share precompiled header binaries between targets.
Moving to Xcode: Share precompiled header binaries between targets.
- Subject: Moving to Xcode: Share precompiled header binaries between targets.
- From: j o a r <email@hidden>
- Date: Mon, 10 Nov 2003 16:37:03 +0100
Short version of my question: If you share precompiled header binaries
between targets, how do you verify - I mean *really* verify - that the
precompiled header binary is valid for the targets that use it but
didn't compile it?
========================================================================
We have now spent almost four man-days trying to move our project file
from Project Builder project file format over to using Xcode native
targets, and other features associated with that platform of
development tools (notably GCC 3.3). Were not nearly done yet.
We are very frustrated over bugs in Xcode, both serious performance
bugs and regular bugs. I'm a bit surprised that we don't see more
complaints on the mailing lists, but I assume that most people have
much smaller and less complicated project files than we do - as our
project is nine years old, contains around 5800 files divided into
around 150 targets.
We will try to pin-point these problems as bug reports via RadarWeb,
but to be able to continue the transition to Xcode there are a few
things that we probably will ask on this list directly.
My first question will be about PCH. As we moved to Xcode and GCC 3.3
we noted that compile times were much, much, slower - compiling the
entire project from scratch took about 2.7x as long time. Before we
upgraded to native targets I had already added a PCH file to the
project. It cut compile time significantly, but compiling the full
project still took about 1.8x longer than before the "upgrade" to
Xcode. (This is reported in case #3433078).
After upgrading to native targets I decided to attempt to share the
precompiled header binary between all targets in the project. It seemed
to work at first, as most targets compiled and only the first target
compiled the prefix header file. A few source files started to generate
errors though, I have included one such error below. I have read the
GCC 3.3 read me file about PCH:
<http://developer.apple.com/documentation/DeveloperTools/gcc-3.3/gcc/
Precompiled-Headers.html>
As far as I can tell the problem is probably caused by attempting to
use a precompiled header binary generated from an incompatible set of
defines or compiler flags.
In general, how are you supposed to work with PCH in Xcode? As we have
almost 150 targets I can't very well create a separate prefix header
file per target. Doing this would also ruin most of the performance
advantage of using them, at least for smaller targets. So we need to
think about sharing precompiled header binaries - but how do you verify
that the generated binary is really, REALLY, compatible between
targets?
The only thing that can cause an invalid precompiled header binary to
be used - and not rejected - is according to the documentation that I
fail this test: "Certain command-line options must be defined in the
same way as when the precompiled header was generated.". Since Xcode is
responsible for running the compiler, I assume that "all" I need to do
is make sure that the build style and target settings are the same - or
as similar as possible - for the targets that share a precompiled
header binary. Is that enough, or is there something else I need to
think about?
j o a r
========================================================================
CompileC
/Volumes/build/joar/tmp34/Orc.build/Orc.build/Objects-normal/ppc/
Parser.o Parser.m
setenv MACOSX_DEPLOYMENT_TARGET 10.2
cd /Volumes/build/joar/tmp34/Orc
/usr/bin/gcc-3.3 -c -F/Volumes/build/joar/tmp34
-I/Volumes/build/joar/tmp34/include -I/Volumes/build/joar/tmp34/Orc/
-I/Volumes/build/joar/tmp34/Orc/headers
-I/Volumes/build/joar/tmp34/Orc/headers/rt
-I/Volumes/build/joar/tmp34/Orc/RTCocoaDoff.subproj/
-I/Volumes/build/joar/tmp34/Orc/CalculatorEngine.bproj/
-I/Volumes/build/joar/tmp34/Orc/headers/orcsystem
-I/Volumes/build/joar/tmp34/Orc/OrcAdditions.subproj
-I/Volumes/build/joar/tmp34/Orc/OrcAdditions.subproj/C.subproj
-I/Volumes/build/joar/tmp34/Orc/OrcAdditions.subproj/AppKit.subproj
-I/Volumes/build/joar/tmp34/Orc/OrcAdditions.subproj/AppKit.subproj/
Categories.subproj
-I/Volumes/build/joar/tmp34/Orc/OrcAdditions.subproj/AppKit.subproj/
Subclasses.subproj
-I/Volumes/build/joar/tmp34/Orc/OrcAdditions.subproj/Foundation.subproj
-I/Volumes/build/joar/tmp34/Orc/OrcAdditions.subproj/
Foundation.subproj/Categories.subproj
-I/Volumes/build/joar/tmp34/Orc/OrcAdditions.subproj/
Foundation.subproj/Subclasses.subproj
-I/Volumes/build/joar/tmp34/Orc/OrcAdditions.subproj/
CoreGraphics.subproj
-I/Volumes/build/joar/tmp34/Orc/OrcAdditions.subproj/
WOAdditions.subproj
-I/Volumes/build/joar/tmp34/Orc.build/Orc.build/DerivedSources -arch
ppc -pipe -Wno-trigraphs -fpascal-strings -g -O0 -Wall -W
-Wno-unused-parameter -Wno-sign-compare -O0 -fmessage-length=0
-mtune=G4 -ffix-and-continue -mdynamic-no-pic
-Wp,-header-mapfile,/Volumes/build/joar/tmp34/Orc.build/Orc.build/
Orc.hmap -pipe -DMACOSX -include
/Volumes/build/joar/tmp34/Orc.build/Orc.build/../PrefixHeaders/
Orc_Prefix.pch /Volumes/build/joar/tmp34/Orc/Parser.m -o
/Volumes/build/joar/tmp34/Orc.build/Orc.build/Objects-normal/ppc/
Parser.o
{standard input}:8488:non-relocatable subtraction expression,
"L__CurrentRuneLocale$non_lazy_ptr" minus "L00000000035$pb"
{standard input}:8488:symbol: "L00000000035$pb" can't be undefined in a
subtraction expression
{standard input}:8487:non-relocatable subtraction expression,
"L__CurrentRuneLocale$non_lazy_ptr" minus "L00000000035$pb"
{standard input}:8487:symbol: "L00000000035$pb" can't be undefined in a
subtraction expression
{standard input}:8427:non-relocatable subtraction expression,
"L__DefaultRuneLocale$non_lazy_ptr" minus "L00000000035$pb"
{standard input}:8427:symbol: "L00000000035$pb" can't be undefined in a
subtraction expression
{standard input}:8426:non-relocatable subtraction expression,
"L__DefaultRuneLocale$non_lazy_ptr" minus "L00000000035$pb"
{standard input}:8426:symbol: "L00000000035$pb" can't be undefined in a
subtraction expression
{standard input}:unknown:Undefined local symbol L00000000035$pb
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.