libasync icon indicating copy to clipboard operation
libasync copied to clipboard

epoll on ARM should not pack epoll_event_t

Open vl-01 opened this issue 8 years ago • 5 comments

This struct's alignment has popped up again to cause you some more grief :)
This time it needs to be UNpacked. Details in the link.

http://bugzilla.gdcproject.org/show_bug.cgi?id=214

vl-01 avatar Mar 06 '16 20:03 vl-01

I hadn't realized libasync could build for ARM ? Have you tested it with align(8) to see if you can successfully run a web server on a Raspberry Pi?

etcimon avatar Mar 06 '16 22:03 etcimon

vibe.d won't compile on the Pi (lacks memory) but libasync does with GDC 5 (memutils fails to build with a forward reference error on older versions) but I had to modify core.atomic to make it work (GDC rejects an attempted implicit conversion between a class reference and an integer, I don't remember offhand where in libasync this is triggered). I've tested with align(8), and epoll + libasync runs correctly on the Raspberry Pi. I'm able to stream a log from the Pi to a desktop using AsyncTCP. Without align(8), the event loop segfaults when it tries to switch on the event type.

vl-01 avatar Mar 07 '16 00:03 vl-01

Nice, but wouldn't it be possible to cross-compile from an ARM emulator like Qemu?

etcimon avatar Mar 07 '16 01:03 etcimon

Maybe. The code makes use of a RPi-specific lib though, and I'm not sure how that would work with an emulator. Also I haven't used cross-compilation before, so I thought it'd make more sense initially to attempt the most straightforward and familiar build method. At least to convince myself that the code would run at all.

vl-01 avatar Mar 07 '16 01:03 vl-01

It's good to know, I have a project for a decentralized social network that I thought I would have to use the Edison chip for, maybe I'll move towards ARM instead and it would help reduce the costs

etcimon avatar Mar 07 '16 01:03 etcimon