richardhundt / shine

A Shiny Lua Dialect
Other
231 stars 18 forks source link

sem_post missing, maybe more #62

Closed dvv closed 10 years ago

dvv commented 10 years ago

Cloned master, built with

[dvv@pagocmb lib]$ uname -a
Linux pagocmb 3.15.5-2-ARCH #1 SMP PREEMPT Fri Jul 11 07:56:02 CEST 2014 x86_64 GNU/Linux
[dvv@pagocmb lib]$ gcc --version
gcc (GCC) 4.9.1
[dvv@pagocmb lib]$ ld --version
GNU ld (GNU Binutils) 2.24

Installed, got

[dvv@pagocmb sample]$ shine httpd.shn
Error: error loading module 'sys.ffi' from file '/usr/local/lib/shine/sys.so':
        /usr/local/lib/shine/sys.so: undefined symbol: sem_post
stack traceback:
        [C]: at 0x00454140
        [C]: in function 'require'
        [string "core"]: in function 'import'
        [string "async.loop"]: in main chunk
        [C]: in function 'require'
        [string "core"]: in function 'import'
        [string "async"]: in main chunk
        [C]: in function 'require'
        [string "core"]: in function 'import'
        httpd.shn:1: in main chunk
        [string "shine"]: in main chunk
        [string "shine"]: in main chunk
        [C]: at 0x004537f0

What can be wrong?

TIA, --Vladimir

dvv commented 10 years ago

Fix is to use

LPTHREAD=-pthread -lrt

for linux.

dvv commented 10 years ago

doh!

[dvv@pagocmb shine]$ shine sample/httpd.shn
server listening on http://127.0.0.1:8000/

and

[dvv@pagocmb sample]$ ln -s ../lib
[dvv@pagocmb sample]$ shine httpd.shn
server listening on http://127.0.0.1:8000/

Seems like ./lib/sys/ffi must exists on $PWD. I must have missed something...

dvv commented 10 years ago

ok. this fixes:

LDFLAGS=-lm -ldl -pthread -lanl -lrt

-pthread -lrt needed for sys.so et al., -lanl for net.so.

Folks, please, do confirm/void the bug and the fix.

richardhundt commented 10 years ago

I've tweaked the linux build. Tested on ubuntu 12.10 32 bit. Can you confirm that it works for you?

dvv commented 10 years ago

Fine now. Thanks!