This page covers the differences between CoreFoundation as found on Mac OS X ("CF") and CoreFoundation as found on Darwin ("CF-Lite").
At the time of this writing, the latest CF on Mac OS X is version 6.5.4 (CFBundleVersion 476.15, CFBundleShortVersionString 6.5.4, SourceVersion 4761500).
The latest published CF-Lite source is CF-476.15.tar.gz (CFBundleVersion 476, CFBundleShortVersionString 6.5). A binary root compiled through DarwinBuild is available from http://src.macosforge.org/Roots/9C31/CF.root.tar.gz.
An experimental binary root of CF-lite also compiled through DarwinBuild (but includes patches from 9F33pd1.plist) can be found here.
The PureFoundation project also provides patched binaries of CFLite. These combine patches necessary to fix some short-comings with CFLite with those needed by the cloned Foundation.framework, and as a result require the presence of that framework.
Notes: Please, read Apple CF-lite page for more information.
There is also OpenCFLite, a version of CFLite maintained by an couple of independent developers (blog) which aims to port it to Windows and Linux. As well as the platform-specific changes, this also includes a number of bug-fixes and feature enhancements. There is a good chance that in the near future the version of CFLite bundled for use with PureFoundation will be based on OpenCFLite rather than directly on Apple's CFLite.
Let's compare the number of symbols exported by CF and CF-Lite with `nm'.
nm -g CoreFoundation | grep -v "U " | cut -d " " -f 3 > CF.symbols
nm -g CoreFoundation | grep -v "U " | cut -d " " -f 3 > CF-Lite.symbols
wc -l CF*.symbols
diff CF.symbols CF-Lite.symbols | grep "^< " | wc -l
This shows that CF exports 1654 symbols.
The same test with CF-Lite shows that CF-Lite exports 1287 symbols.
Hence, CF-Lite contains about 78% of the symbols of the full CF, and about 22% were stripped away.
It is probably fair to assume that the Darwin sources should either not make use of the 28% of symbols that are missing from CF-Lite, or Apple should release the source for the missing symbols. See Current Blockers for a short list of some of the projects where these missing symbols (and the functions they represent) are causing us problems.
In this example, _NSInvalidArgumentException should be exported by CF. (Please note: using the latest PureDarwin darwinbuild patch will automatically build a version of CFLite which now exports this and other NS-domain exceptions.)
nm -an /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation | grep _NSInvalidArgumentException
0010111b S $ld$hide$os10.4$_NSInvalidArgumentException
0013b444 S _NSInvalidArgumentException
nm -an /System/Library/Frameworks/Foundation.framework/Foundation | grep _NSInvalidArgumentException
00272c70 S $ld$add$os10.4$_NSInvalidArgumentException
Here is a list of the 22% exported symbols that are missing from CF-Lite when compared to the full CF:
diff CF.symbols CF-Lite.symbols | grep "^< "
Whenever you encounter a message that includes one of the follwing symbol names, then it might well be due to the difference between CF and CF-Lite.
An old CF-Lite, CoreFoundation-262.tar.gz (source CoreFoundation-262-src.tar.gz) from 2002, exported the following symbols which the recent version of CF-Lite does no longer appear to export:
For developers >