Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build a static CBM binary ? #6

Open
quaggalinux opened this issue Mar 4, 2023 · 2 comments
Open

How to build a static CBM binary ? #6

quaggalinux opened this issue Mar 4, 2023 · 2 comments

Comments

@quaggalinux
Copy link

Would you tell me how to build a static CBM binary in ubuntu or alpine?

Thank you!

@quaggalinux quaggalinux changed the title How to build a static nethogs binary ? How to build a static CBM binary ? Mar 4, 2023
@flajr
Copy link

flajr commented Mar 6, 2023

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.

@quaggalinux
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants