As I said, i was compiling Node JS (v8, libuv, openssl, etc) on x86 arch on Haiku.
I have succesfully created a obviously experimental binary of Node, by implementing most missing headers and functions as dummy code on a separate file (i.e. placeholders) and showing params on stdout to see what goes on.
Apart from some tweaking on includes not existing in Haiku , all the code that prevents libuv from working compiling seems to be some defines and the epoll backend, which could be implemented as you said above and in other threads, using some custom library like kqueue, native code or whatever is required to.
I know it wouldnt be performant as a native kernel solution, but having a working prototype to play with is feasible, it being standalone, part of node or whatever usage that may appear.
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i586-pc-haiku"...Dwarf Error: wrong version in compilation unit header (is 4, should be 2) [in module /boot/home/Desktop/p/node-master/out/Release/node]
(gdb) run
Starting program: /boot/home/Desktop/p/node-master/out/Release/node
Error while mapping shared library sections:
commpage: No such file or directory.
Error while reading shared library symbols:
commpage: No such file or directory.
[WARNING][UNIMPLEMENTED][epoll_create1] params=> flags: 524288
[WARNING][UNIMPLEMENTED][epoll_create1] params=> flags: 524288
[WARNING][UNIMPLEMENTED][epoll_create1] params=> flags: 524288
[WARNING][UNIMPLEMENTED][epoll_ctl] params=> epfd: 0, op 1, fd 16 event 1892911284
[WARNING][UNIMPLEMENTED][epoll_ctl] params=> epfd: 0, op 1, fd 18 event 1892911284
[WARNING][UNIMPLEMENTED][epoll_pwait] params=> epfd 0, events, 1892911296 maxevents 1024, timeout -1, sigmask 0
node: ../deps/uv/src/unix/linux-core.c:291:uv__io_poll: timeout != -1
Thread 2941 called debugger(): timeout != -1
Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to team /boot/home/Desktop/p/node-master/out/Release/node (2939) thread pthread func (2941)]
0x69931114 in ?? ()
(gdb)
Yes i know this is hacky code, nothing more than a toy. Just giving my 2 cents.
Also, found some troubles at Haiku missing getpriority / setpriority methods, that are required by the code. I see that there is a pending change to implement them (by yourself?) here https://dev.haiku-os.org/ticket/2817 but i guess that the implementation is not yet in the “almost rc1” system i’m on. Please if i’m wrong with this, tell me about it.