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

std.net.curl doesn't work with -static #10629

Open
trikko opened this issue Jan 23, 2025 · 0 comments
Open

std.net.curl doesn't work with -static #10629

trikko opened this issue Jan 23, 2025 · 0 comments

Comments

@trikko
Copy link
Contributor

trikko commented Jan 23, 2025

Compiling an app that uses curl with musl+ldc+alpine results in a single working static (portable!) executable. However, std.net.curl does not work correctly because it attempts to load the dynamic library libcurl.so.

The main reason is that the check at this line fails, likely because dlopen does not work in static binaries, and thus the symbol is incorrectly not detected. I guess it works with static symbols on dynamic executable?

Incidentally, a simple program using etc.c.curl works because the symbols are present, as can be confirmed by analyzing the executable file.

Perhaps a different check should be used (e.g., __traits(compiles)?), but the entire structure would then need to be adjusted accordingly.

Linked libs: "-lcurl", "-lunistring", "-lbrotlicommon", "-lbrotlienc", "-licuuc", "-licudata", "-lcares_static", "-lnghttp2", "-lidn2", "-lpsl", "-lssl", "-lcrypto", "-lzstd", "-lbrotlidec", "-lz"

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

1 participant