Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed stack alignment for 32-bit OS's. Closes #31 #17

Merged
merged 1 commit into from
Sep 19, 2015

Conversation

waneck
Copy link
Member

@waneck waneck commented Sep 25, 2013

Finally were able to test it. -mstackrealign didn't work, but this one did it!

@ncannasse
Copy link
Member

I would prefer another way of testing 32 bit Linux since it might break on Windows, is there no flag in Makefile ?

@waneck
Copy link
Member Author

waneck commented Sep 25, 2013

I'm afraid there isn't. Will 'os' be always mingw on Windows when using the Makefile?

@ncannasse
Copy link
Member

might be cygwin or mingw, and also, are we sure that "shell" command is available on OSX?

@waneck
Copy link
Member Author

waneck commented Sep 26, 2013

I'll check on OSX, and will update the pull with cygwin or mingw tests. However this problem shouldn't happen only on Linux, so we might need to find a way to know if we're compiling to 64-bits on windows as well.

@ncannasse
Copy link
Member

Just to ping back on this issue : I think that using shell command will fail when using the makefile on windows, so we need to fix this before merging the PR. Can you look into it ?

@Simn
Copy link
Member

Simn commented Jul 6, 2015

(This seems to be linked to the wrong issue #31).

ncannasse added a commit that referenced this pull request Sep 19, 2015
Fixed stack alignment for 32-bit OS's. Closes #31
@ncannasse ncannasse merged commit 1fbb2b0 into HaxeFoundation:master Sep 19, 2015
@ppenzin
Copy link
Collaborator

ppenzin commented Jan 12, 2016

This will break with Clang, the flag is only supported by GCC. I will see what can be done though.

UPD: I mean it breaks with Clang :)

@ppenzin
Copy link
Collaborator

ppenzin commented Jan 14, 2016

Does anyone know what the correct issue for this is? That would help a lot

@ncannasse
Copy link
Member

The issue is because of the ABI for system calls. Before, it was valid to call any function using an alignment of 2bytes (32 bits), but some compilers requires now an alignment of 4 bytes (64 bits) even on 32 bits systems. The Neko JIT does perform 32 bits alignement, not 64 bits (which is the reason why it's disabled on OSX BTW, since the OSX ABI is 64 bits aligned from the start).

Using -mincoming-stack-boundary=2 will tell gcc that it needs to eventually realign the stack on 64 bits prior to any system call. I wonder if there's a clang/OSX flag for this, which means we could activate the JIT

@ppenzin
Copy link
Collaborator

ppenzin commented Jan 19, 2016

Clang has -mstack-alignment= argument, not sure if that would work (I am guessing it might work if it is similar to GCC's -mpreferred-stack-alignment), need to experiment.

@ncannasse
Copy link
Member

@ppenzin could you check it ? You only need to enable JIT in vm/jit_x86.c (remove the && !defined(NEKO_MAC)

@ppenzin
Copy link
Collaborator

ppenzin commented Jan 19, 2016

@ncannasse I'll try. Are there any extra tests that you would recommend
running?

On Tue, Jan 19, 2016 at 3:27 AM, Nicolas Cannasse [email protected]
wrote:

@ppenzin https://github.com/ppenzin could you check it ? You only need
to enable JIT in vm/jit_x86.c (remove the && !defined(NEKO_MAC)


Reply to this email directly or view it on GitHub
#17 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants