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 static wget2 binary for Linux? #293

Open
yfdyh000 opened this issue Sep 10, 2023 · 1 comment
Open

How to build static wget2 binary for Linux? #293

yfdyh000 opened this issue Sep 10, 2023 · 1 comment

Comments

@yfdyh000
Copy link

./wget2: error while loading shared libraries: libwolfssl.so.32: cannot open shared object file: No such file or directory

I've tried the ./configure --enable-static --disable-shared, ./configure --enable-static --disable-shared CFLAGS="-static -static-libgcc" and more in Ubuntu on WSL2, it looks not works.
I don't see how to build the 'gnutls' or 'openssl' with --with-ssl=, it needs some kind of dependence.

I what to run wget2 in a Kubernetes task without administrative privileges.

https://gitlab.com/gnuwget/wget2/-/issues/482

@rockdaboot
Copy link
Owner

First of all, I never found a simple way to create a fully static wget2 executable.
glibc has a long-term issue that prevents fully static builds.
The fallback to muslc (on Alpine Linux) needs a custom static build of libgnutls (I never found the time to come up with a Dockerfile).

On Ubuntu, install libgnutls28-dev. It contains the static library libgnutls.a. You should not need --with-ssl - GnuTLS is picked as first choice by ./configure.
As said befoire, your wget2 executable will possibly not be fully static (e.g. glibc eventually uses ldopen() to dynamically load secondary libraries). But maybe it works in your environments, if they are not too different.

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