ffcall, mac os x (10.6), and assembler

Bruce J. Carter cerfdog at gmail.com
Fri Nov 12 01:05:06 PST 2010


Hi,

I am working on porting ffcall to Mac OS X 10.6 and running into
issues locating up to date documentation.

For those that don't know what ffcall is, it is a language independent
foreign function interface, used, I think, primarily with LISP. The
ffcall interface has worked well with Mac OS X until the release of
10.6, which is all 64 bit Intel. The PPC and Intel 32 bit stuff was/is
fine. The x86_64 port for suse linux does not compile. The i386 port
is a good starting point. The issue I have is assembler directives.

Finding good information on writing assembly for a Mach-O 64 kernel is
not abundant. Specifically pulling (function pointers) off the stack
and out of registers. I figured out the file format, that was simple.
The hard part is finding the directives supported. There is
insufficient docs on YASM and NASM for x86_64 Mach-O. I have found
lots of docs at Apple, among other places, but many are out of date
including Apple's, I also have the Intel and AMD docs which are
excellent for the instructions and registers, but not the info I need.

I have attempted to compile for i386 and x86_64. Both fail for the
obvious reasons. Sorry if I sound a little ignorant and uninformed. It
has been 20 years since I mucked around with assembler and the Mach
kernel is a little different beast than straight BSD or linux.

Any clues, tips, hints would be greatly appreciated.

Cheers,

Bruce...


More information about the macports-dev mailing list