From: "David Leimbach" <leimy2k@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu>
Subject: Re: [9fans] OS X threads + dynamic linking
Date: Sat, 22 Apr 2006 09:35:35 -0700 [thread overview]
Message-ID: <3e1162e60604220935x1c95f223sd295b1c6fdb772a0@mail.gmail.com> (raw)
In-Reply-To: <0ad26600f43ce6f44c61e6f6d78ed116@swtch.com>
On 4/21/06, Russ Cox <rsc@swtch.com> wrote:
> > Actually, this code violates the ABI. The stack needs to be aligned
> > on a 16byte address.
> >
> > http://developer.apple.com/documentation/DeveloperTools/Conceptual/LowLevelABI/index.html
> >
> > So the assembly block should be:
> >
> > asm(
> > "pushal\n"
> > "movl 8(%ebp), %ebx\n"
> > "movl 12(%ebp), %eax\n"
> > "xchgl %esp, %eax\n"
> > "subl $0xc, %esp\n" //need to align the stack... can't just pushl
> > "pushl %eax\n"
> > "call *%ebx\n"
> > "popl %esp\n"
> > "popal\n"
> > );
> >
> > Just don't compile with -Os because gcc freaking inlines runonstack.
> > Whom to throttle for that one?
>
> The real version doesn't use inline assembly, so it's not a problem.
> I just wanted a single file demonstrating the problem.
>
> After aligning the stack pointer properly, the x86 OS X code
> now in CVS does appear to work.
>
> Thanks very much for tracking this down.
>
Hey no problem... I want to use it on my new system :) Thanks for
"making it go".
> Russ
>
>
prev parent reply other threads:[~2006-04-22 16:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-21 5:43 Russ Cox
2006-04-21 5:05 ` quanstro
2006-04-21 6:21 ` Russ Cox
2006-04-21 6:24 ` Don Bailey
2006-04-21 7:37 ` Russ Cox
2006-04-21 7:00 ` Don Bailey
2006-04-21 7:55 ` David Leimbach
2006-04-21 16:24 ` David Leimbach
2006-04-21 19:05 ` "Nils O. Selåsdal"
2006-04-22 1:54 ` Russ Cox
2006-04-22 16:35 ` David Leimbach [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3e1162e60604220935x1c95f223sd295b1c6fdb772a0@mail.gmail.com \
--to=leimy2k@gmail.com \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).