Sunday, February 10, 2008

xnu-792.25.20 (for 10.4.11)

The source code for 10.4.11 and 10.5.1 were published after MacWorld Expo 2008 over.
But I didn't try the compilation by now.
When I tried it first today, the compilation was failed. The reason why the fail was, very curiously, #ifdef was not terminated in several files. Therefore the fail is fixed just by adding '#endif' at the end of these files.
The patch is available at here.

Wednesday, December 26, 2007

Compile xnu on Leopard

After Lepard shipped, the darwin source code for leopard, version 9.0.0, is also out. The source code includes the kernel source, xnu. I tried its compilation, but I always failed without darwinbuild. The error message was as followed:

C++ IOUserClient.cpo
C++ AppleNMI.cpo
C++ AppleMacIO.cpo
C++ IOPMrootDomain.cpo
LD iokit
ld_classic: ./WKdmDecompress.o section's (__HIB,__debug_frame) has debug attribute (S_ATTR_DEBUG) which does not match previously loaded object's sections for this segment
ld_classic: ./IOHibernateRestoreKernel.o section's (__HIB,__debug_frame) has debug attribute (S_ATTR_DEBUG) which does not match previously loaded object's sections for this segment
collect2: ld returned 1 exit status
make[6]: *** [iokit.o] Error 1
make[5]: *** [build_all] Error 2
make[4]: *** [do_all] Error 2
make[3]: *** [build_all] Error 2
make[2]: *** [build_all] Error 2
make[1]: *** [build_all] Error 2
make: *** [all] Error 2

As a result, this is caused because some outdated commands are used for the compilation, such as seg_hack and kextsymtool. If you installed these command with kernel-tools-8J2135.root.tar.gz distributed at MacOS Forge, you would see the above message.

To install the new commands to be able to compile leopard xnu, you should complie cctools by yourself or install its binaries from http://src.macosforge.org/Roots/9A581/cctools.root.tar.gz.


Here is more detail to build the tools:

  1. Bulidng darwinbuild (you can skip this step if you have already it)


  2. $ cd ${somewhere}
    $ svn co http://svn.macosforge.org/repositorydarwinbuild/trunk darwinbuild
    $ make
    $ sudo make install

  3. Build necessary tools with darwinbuild

    $ cd ${another place}
    $ mkdir 9C31
    $ sudo darwinbuild -init 9C31
    $ sudo darwinbuild cctools