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

binaries are small, dependencies are not #14

Closed
tomalok opened this issue Jul 8, 2020 · 4 comments
Closed

binaries are small, dependencies are not #14

tomalok opened this issue Jul 8, 2020 · 4 comments

Comments

@tomalok
Copy link
Contributor

tomalok commented Jul 8, 2020

log_proxy and log_proxy_wrapper are very small -- about 26 KiB each on an Alpine x86_64 host.

However, the lib dependencies that get pulled in, are well over 1 MiB...

# ldd /usr/bin/log_proxy_wrapper
	/lib/ld-musl-x86_64.so.1 (0x7f2ac7afa000)
	libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x7f2ac79f1000)
	libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f2ac7afa000)
	libpcre.so.1 => /usr/lib/libpcre.so.1 (0x7f2ac7995000)
	libintl.so.8 => /usr/lib/libintl.so.8 (0x7f2ac7988000)

# ls -lh /usr/lib/libglib-2.0.so.0.6400.4
-rwxr-xr-x    1 root     root     1019.6K Jul  4 11:50 /usr/lib/libglib-2.0.so.0.6400.4
# ls -lh /usr/lib/libintl.so.8.1.7
-rwxr-xr-x    1 root     root       41.8K Apr 19 16:02 /usr/lib/libintl.so.8.1.7
# ls -lh /usr/lib/libpcre.so.1.2.12
-rwxr-xr-x    1 root     root      361.7K Feb 13 11:04 /usr/lib/libpcre.so.1.2.12

Alpine Linux likes to keep things small. I'm curious if the total install size would be significantly less if statically compiled?

@thefab
Copy link
Member

thefab commented Jul 8, 2020

From my (little) experience about statically compiling with glib:

  • it's not easy and not really documented
  • i'm not sure glib is enough modular to get a "binary size" gain

but we are also interested in! (if a build/glib/makefile ninja read this and can provide some help)

@thefab
Copy link
Member

thefab commented Jul 10, 2020

I jut made a little test about static compiling:

1,8M	log_proxy
1,8M	log_proxy_wrapper

=> not better

@thefab
Copy link
Member

thefab commented Jul 10, 2020

just pushed to master a Makefile option: STATIC=yes for building static binaries

@thefab
Copy link
Member

thefab commented Jul 15, 2020

closing this

now released files are statically compiled

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

No branches or pull requests

2 participants