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

Update ipif-posix.c #1

Merged
merged 1 commit into from
Jun 12, 2015
Merged

Update ipif-posix.c #1

merged 1 commit into from
Jun 12, 2015

Conversation

paoloo
Copy link
Contributor

@paoloo paoloo commented Jun 12, 2015

struct missing.

struct missing.
@jvburnes
Copy link
Owner

Thanks Paoloo. It's been a while since I worked on that part of the code. I'm not sure how it got damaged, nor how you found it. I'm also surprised the code built yesterday with that in it. Are you compiling on Linux or one of the BSDs?

@paoloo
Copy link
Contributor Author

paoloo commented Jun 12, 2015

First of all, thank you for your amazing work. I aways loved Inferno OS/plan9 and LUA, know I have both of them together.
I'm compiling on ubuntu linux 14.04.02 LTS and on freeBSD 11.0-CURRENT.
I'm trying to write first a linux version, but it's giving me a lot of trouble. I'm rewriting the whole 'make' process to help, because luaJIT doesn't compile by itself on linux with this makefile(it does, if you enter luajit directory ./autogen.sh; ./configure; make), and is tied (too hard) to MacOSX.

@jvburnes
Copy link
Owner

Paoloo,

Your welcome. I'm happy that there's some interest. The idea became an obsession to me a little over a year ago.

The fact that you're on Linux explains a lot. That file was probably not built or used on OSX.

Until I convert the sources completely over to libuv the porting process will be a bit of a hack. Each platform has a specific set of files under it's emulation config. If you give me a day or so I think I can modify the premake files and the platform dependent code to build under Linux. I'll make some notes as to what needs to be done so that each platform can use them.

Any suggestions about what to do about portability fixes until libuv is fully integrated? I hate to do a lot of portability hacks before then. Maybe OSX and Linux. Stand by and I'll check the code out on my Ubuntu server.

jvburnes added a commit that referenced this pull request Jun 12, 2015
@jvburnes jvburnes merged commit d2f6e1f into jvburnes:master Jun 12, 2015
@jvburnes
Copy link
Owner

Paoloo .. I read the sources more closely for the patched file. On OSX the relevant code was #ifdef 'd out. That's why it compiled on OSX.

@paoloo
Copy link
Contributor Author

paoloo commented Jun 12, 2015

Nice, I'll wait your rewrite the premake and, after that, I'll work over it.
Something I've realized trying to build linux version, it does build the 32 bits, but not 64. It builds but it doesn't work.
Building 64 bits version gives:

  • styx/platform/Linux/os.c:16:10: fatal error: 'fpuctl.h' file not found

Building 32 bits(in a 32 bits ubuntu server) gives:

  • sh: line 1: 7960 Floating point exception(core dumped)

After a little research, I've found out that the problem is the way gcc/clang deals with division by zero protection... It optimizes the original asm inside Linux/386/include/fpuctl.h to avoid division by zero. The solution is use the "volatile" directive on Linux/386/include/fpuctl.h and add (: “=a” (fcr)) as return.

@jvburnes
Copy link
Owner

Thanks. It's probably related to having the wrong build options. Hang in
there.

On Fri, Jun 12, 2015 at 8:52 AM, Paolo Oliveira notifications@github.com
wrote:

Nice, I'll wait your rewrite the premake and, after that, I'll work over
it.
Something I've realized trying to build linux version, it does build the
32 bits, but not 64. It builds but it doesn't work.
Building 64 bits version gives:

  • styx/platform/Linux/os.c:16:10: fatal error: 'fpuctl.h' file not
    found

Building 32 bits(in a 32 bits ubuntu server) gives:

  • sh: line 1: 7960 Floating point exception(core dumped)

After a little research, I've found out that the problem is the way
gcc/clang deals with division by zero protection... It optimizes the
original asm inside Linux/386/include/fpuctl.h to avoid division by zero.
The solution is use the "volatile" directive on Linux/386/include/fpuctl.h
and add (: “=a” (fcr)) as return.


Reply to this email directly or view it on GitHub
#1 (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.

2 participants