cbm
cbm copied to clipboard
How to build a static CBM binary ?
Would you tell me how to build a static CBM binary in ubuntu or alpine?
Thank you!
You forgot libtool
package:
apk update && apk --no-cache add git wget autoconf automake build-base linux-headers ncurses-dev ncurses-static libtool
Then building succeed, but static binary can be problematic, you have to figure it out yourself I am afraid.
@flajr, Thank you so much!
You are right, CBM output dynamically linked binary even when I used static compile. I hope someone will find out why.
/cbm/src # CC="gcc -static" LDFLAGS="-static" make
/cbm/src # file /cbm/src/cbm /cbm/src/cbm: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, with debug_info, not stripped