ffcall, mac os x (10.6), and assembler
Bruce J. Carter
cerfdog at gmail.com
Fri Nov 12 11:16:45 PST 2010
Hi Josh,
Thanks, I had not thought of that yet. I know LispWorks has a FFI, but
did not think about SBCL and the others needing one. Doh!
Cheers,
Bruce...
On Fri, Nov 12, 2010 at 4:35 AM, Joshua Root <jmr at macports.org> wrote:
> On 2010-11-12 20:05 , Bruce J. Carter wrote:
>> 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.
>
> Not sure where else you could look for documentation if Apple's isn't
> sufficient, but you might want to have a look at libffi's code and talk
> to its developers, since it must solve many of the same problems.
>
> - Josh
>
More information about the macports-dev
mailing list