laverdet/node-fibers — Issue #48: Compiling on BeagleBone
Author: alexkwolfe
Created: 2012-01-18 06:15:18+00:00
State: open

I'm trying to build and use fibers on a [BeagleBone](http://beagleboard.org/bone) board with node 0.6.x. I know it works on node 0.4.12 because the board ships with that version of node and with fibers installed.

The first problem I ran into is that platform.mk was passing the unsupported "-minline-all-stringops" flag. It was also passing "-m32" rather than the required "-marm".

Once I removed the former and adjusted the latter, the compile worked. However, when I try to run a simple script I get a segmentation fault.

````
# file `which node`
/usr/local/bin/node: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
````

Here's the output from the successful make:

````
fibers/src# make
g++ -march=armv7-a -mno-thumb-interwork -fno-tree-sink -Wno-psabi -Wall -Wno-deprecated-declarations -I/usr/local/include -I/usr/local/include/node -g -O3 -marm -DCORO_UCONTEXT -fPIC -c -o coroutine.o coroutine.cc
coroutine.cc:14:41: warning: converting to non-pointer type 'pthread_key_t' from NULL
coroutine.cc:15:40: warning: converting to non-pointer type 'pthread_key_t' from NULL
coroutine.cc: In constructor 'Coroutine::Coroutine()':
coroutine.cc:62:46: warning: passing NULL to non-pointer argument 5 of 'void coro_create(coro_context*, void (*)(void*), void*, void*, long int)'
coroutine.cc: In destructor 'Coroutine::~Coroutine()':
coroutine.cc:73:24: warning: statement has no effect
cc -march=armv7-a -mno-thumb-interwork -fno-tree-sink -Wno-psabi -Wall -Wno-deprecated-declarations -I/usr/local/include -I/usr/local/include/node -g -O3 -marm -DCORO_UCONTEXT -fPIC -c -o libcoro.o libcoro/coro.c
g++ -fPIC -shared -Wl,-Bdynamic -Wall -Wno-deprecated-declarations -I/usr/local/include -I/usr/local/include/node -g -O3 -marm -DCORO_UCONTEXT fibers.cc coroutine.o libcoro.o -o fibers.node -lpthread
````

Any help you can provide would be very much appreciated.