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

Build statically linked executables #775

Closed
peick opened this Issue Nov 28, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@peick
Copy link

peick commented Nov 28, 2018

To improve compatibility with different OS and older OS version, I would love to see statically linked executable of "weed".

@chrislusf

This comment has been minimized.

Copy link
Owner

chrislusf commented Nov 28, 2018

@chrislusf chrislusf closed this Nov 28, 2018

@peick

This comment has been minimized.

Copy link
Author

peick commented Nov 29, 2018

A statically linked executable is an executable that does not use any shared libraries.

At the moment the weed executable depends on these shared libraries:

$ ldd ./weed
	linux-vdso.so.1 (0x00007f13fd599000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f13fd155000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f13fcd64000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f13fd374000)

What I need is this:

$ ldd ./weed
	not a dynamic executable

In go you can easily achieve this with:

CGO_ENABLED=0 go build -ldflags "-extldflags -static"
@chrislusf

This comment has been minimized.

Copy link
Owner

chrislusf commented Nov 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.