From owner-cvs-src@FreeBSD.ORG Sat Dec 6 17:16:01 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ED3AD16A4CE; Sat, 6 Dec 2003 17:16:01 -0800 (PST) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C75B43F85; Sat, 6 Dec 2003 17:16:01 -0800 (PST) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by canning.wemm.org (Postfix) with ESMTP id E70C32A7EA; Sat, 6 Dec 2003 17:16:00 -0800 (PST) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.6.3 04/04/2003 with nmh-1.0.4 To: Daniel Eischen In-Reply-To: Date: Sat, 06 Dec 2003 17:16:00 -0800 From: Peter Wemm Message-Id: <20031207011600.E70C32A7EA@canning.wemm.org> cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/amd64/gen makecontext.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2003 01:16:02 -0000 Daniel Eischen wrote: > On Thu, 4 Dec 2003, Peter Wemm wrote: > > > peter 2003/12/04 17:36:44 PST > > > > FreeBSD src repository > > > > Modified files: > > lib/libc/amd64/gen makecontext.c > > Log: > > "Fix" makecontext() so that the C code begins execution with its > > ABI-required stack alignment. C code expects that the push of the > > return address disturbed the 16 byte alignment and it will take correctiv e > > measures to fix it before making another call. Of course, if its wrong > > to start with, then all hell breaks loose. Essentially we "fix" this > > by making the stack alignment odd to start with. > > Hey, you didn't include this little bit of knowledge in your amd64 "notes" > that you sent me ;-) Heh. I never get it right. I've had to resort to things like this: assert((((long)__builtin_frame_address(0)) & 15 == 0), "misaligned stack!"); The trick of course is that gcc-3.3.3 is broken and __builtin_frame_address(0) doesn't actually work unless you compile *also* with -fno-omit-frame-pointer on amd64. Anyway, thats the only way I've ever been able to get this stuff sorted out. :-) Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5