svaarala / duktape

Duktape - embeddable Javascript engine with a focus on portability and compact footprint
MIT License
5.96k stars 516 forks source link

libcrt0.o build error on Alpine Linux #2189

Closed sam0x17 closed 5 years ago

sam0x17 commented 5 years ago

Love this library. I am desperately trying to compile statically on alpine, however I keep running into:

ld: library not found for -lcrt0.o (this usually means you need to install the development package for libcrt0.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: execution of command failed with code: 1: `cc "${@}" -o '/Users/sam/workspace/blockvue-api/server'  -rdynamic -static  -lxml2 /usr/local/lib/libgmp.a -L/Users/sam/workspace/blockvue-api/lib/duktape/src/.build/lib -L/Users/sam/workspace/blockvue-api/lib/duktape/src/.build/include -lduktape -lm `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` -lz /usr/local/lib/libpcre.a /usr/local/Cellar/crystal/0.31.0_1/embedded/lib/libgc.a -lpthread /usr/local/Cellar/crystal/0.31.0_1/src/ext/libcrystal.a /usr/local/lib/libevent.a -liconv -ldl -L/usr/local/Cellar/crystal/0.31.0_1/embedded/lib -L/usr/lib -L/usr/local/lib`

I've searched all over the Alpine package repositories and I can't find anything that has libcrt0.o. There are plenty of crt0.o files, but they are all for weird architectures. I've tried a whole bunch of development packages, but I always get the same error. Please help!!

svaarala commented 5 years ago

What command line are you using to compile?

sam0x17 commented 5 years ago

I was building the crystal bindings in an alpine docker image. I was able to resolve my issue by remembering to run shards build rather than crystal build, however I also experienced a separate issue with shards build hanging on Alpine that I will be filing to the crystal community.

Thanks!

svaarala commented 5 years ago

Good that this worked out! :+1: