Some possibly useful hacks for building xnu
Some possibly useful hacks for building xnu
- Subject: Some possibly useful hacks for building xnu
- From: Larry Meadows <email@hidden>
- Date: Mon, 10 Mar 2008 17:03:07 -0700
Hi, I've been lurking for a while. There was a post last year on
building the xnu kernel, missing ctfconvert, compress-man-pages, etc.
I got a (relatively) clean build of xnu-1228.3.13 with a bootable
(debug) kernel just recently and thought you all might find some of
this useful.
The compress-man-pages problem just needed a little hack in makedefs/
MakeInc.dir: compress-man-pages.pl seems to want a '-d' flag before
the directory name.
ctfconvert was a little more of a challenge.
Get the dtrace-48 tarball from the darwin source at http://
www.opensource.apple.com/darwinsource/. However, several files are
missing.
Get the libdwarf package from somewhere (I got version
libdwarf20060614 from an RPM somewhere). Unpack it into libdwarf at
the same level as libelf in the dtrace-48 package.
Get libibierty from somewhere (the apple libgcc8.1 package seems OK).
Unpack it somewhere and extract libiberty and include directories. I
stuck those under a directory dtrace-48/libiberty. Configure
libiberty but make sure getopt isn't included (by editing the
Makefile) and build libiberty.a
Configure libdwarf; I ran the autoconfig and then edited config.h by
hand. You want HAVE_ELF_H and HAVE_LIBELF_H. Edit the Makefile and
and includes to ../head and ../sys and a define -D_MIPS_SZLONG=64 and
build libdwarf.a
Then you need to build ctfconvert and ctfdump. I tried to do this
with xcode but it was a hassle with the new stuff that I needed. So I
created makefiles in libelf and in tools/ctfconvert. You need the
same flags that are in the xcode project for those directories plus
make sure you #define -D_MIPS_SZLONG=64 if including libdwarf.h . I
also put some symlinks in the head include directory for decl.h,
msg.h (in libelf) and dwarf.h, libdwarf.h (in libdwarf). Then link
ctfconvert.o and other objs to get ctfconvert, and dump.o and other
objs to get ctfdump.
This works well enough to build xnu without any of the ctf related
failures, and the files that come out seem to be well formed --
dwarfdump likes them, etc.
I have no idea if any of this was worthwhile but I hate obscure error
messages. If anyone wants a tarball of the whole mess let me know; I
wasn't too careful in documenting all the steps.
Now the only major annoyance in the build is a bunch of messages from
the final link about "can't find atom for N_GSYM stabs... dtrace...".
I think these are benign; the linker seems to expect debug
information for some dtrace probes that is of course not generated
since they are inserted with some hacky asm, not by the compiler.. It
probably doesn't show up in a non-debug build.
Cheers.
-- Larry <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden