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

Supports static linking for curl engine #3981

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

dtretyakov
Copy link
Contributor

Subsystem
Client, curl engine

Motivation
We need a way to support consistent set of features across all native platforms. Fixes KTOR-6754

Solution
We're using scripts to update cinterop for the following platforms:

  • linuxX64/linuxArm64
  • macosX64/macosArm64
  • mingwX64

@dtretyakov
Copy link
Contributor Author

dtretyakov commented Feb 8, 2024

The following builds are failing:

Static libcurl compilation

Linux:

   LIBS:            -lcares -lpthread -lnghttp3 -lnghttp2 -lidn2 -lunistring -lssh2 -lssh2 -lssl -lcrypto -lssl -lcrypto -lssl -ldl -lcrypto -ldl -lz -lpsl -lssl -lcrypto -lssl -ldl -pthread -lcrypto -ldl -pthread -lzstd -lzstd -lbrotlidec -lbrotlidec -lbrotlicommon -lz
...
+ make -j 10 LDFLAGS=-static -all-static -Wl,-s --ld-path=/usr/bin/x86_64-linux-gnu-ld -L/data/curl-x86_64/lib -L/data/curl-x86_64/lib64

macOS:

   LIBS:            -lcares -lpthread -lresolv -lnghttp3 -lnghttp2 -lidn2 -liconv -lunistring -liconv -lssh2 -lssh2 -lssl -lcrypto -lssl -lcrypto -lssl -lcrypto -lz -lpsl -lssl -lcrypto -lssl -lcrypto -lzstd -lzstd -lbrotlidec -lbrotlidec -lbrotlicommon -lz
...
 -static -all-static -Wl,-s -framework CoreFoundation -framework SystemConfiguration'

Windows:

   LIBS:            -lcares -lws2_32 -liphlpapi -lnghttp3 -lnghttp2 -lnormaliz -lssh2 -lssh2 -lws2_32 -lssl -lcrypto -lws2_32 -lssl -lcrypto -lssl -lcrypto -lws2_32 -lgdi32 -lcrypt32 -lpsl -lbcrypt -ladvapi32 -lcrypt32 -lssl -lcrypto -lssl -lcrypto -lws2_32 -lgdi32 -lcrypt32 -lgdi32 -lzstd -lzstd -lbrotlidec -lbrotlidec -lbrotlicommon -lws2_32
...
+ make -j 10 LDFLAGS=-static -all-static -Wl,-s -L/opt/llvm-mingw/x86_64-w64-mingw32/lib -L/data/curl-x86_64/lib -L/data/curl-x86_64/lib64 CFLAGS=-Wno-error=shorten-64-to-32 -O3

Copy link
Member

@e5l e5l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ld.lld: error: undefined symbol: explicit_bzero

@dtretyakov, could you check the build?

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

Successfully merging this pull request may close these issues.

2 participants