jvburnes / node9

A portable hybrid distributed OS based on Inferno, LuaJIT and Libuv
MIT License
408 stars 32 forks source link

Update ipif-posix.c #1

Closed paoloo closed 9 years ago

paoloo commented 9 years ago

struct missing.

jvburnes commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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:

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

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 commented 9 years ago

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 https://github.com/jvburnes/node9/pull/1#issuecomment-111517551.