[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libjit] Stack alignment in 32-bit MinGW builds

From: Aleksey Demakov
Subject: Re: [Libjit] Stack alignment in 32-bit MinGW builds
Date: Mon, 20 Aug 2018 22:57:35 +0300

It should be possible with some not very big effort.

Besides I would like to make a new libjit release now. With all the
bugfixes accumulated over the years and before making very large
breaking changes such as new register allocator. I just wanted to make
sure it works on cygwin or mingw32 before the release. You seem to be
able to build on mingw32?


On Mon, Aug 20, 2018 at 10:19 PM Eli Zaretskii <address@hidden> wrote:
> While working on integration of libjit with Emacs, I discovered a
> problem with stack alignment in functions invoked from JIT-compiled
> code on x86 (32-bit) Windows systems.  MS-Windows only guarantees
> 4-byte alignment of the stack in 32-bit programs.  While MinGW GCC
> takes care to align the stack on 8-byte boundary at program startup,
> it assumes that this is enough to keep the stack in all the functions
> 8-byte aligned.  JIT-compiled code seems to break that, because when
> it calls back into Emacs functions, the stack is not necessarily
> aligned on a 8-byte boundary.  (Emacs needs that to be able to create
> stack-based Lisp objects, which must be 8-byte aligned.)
> Is it possible to have the JIT code make sure the stack is 8-byte
> aligned, either always or as a special feature (like some special call
> in the function's prologue)?  This would allow to arrange for a 8-byte
> aligned stack in all Emacs functions when JIT compilation is used.
> Thanks.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]