To enable known linker options dropping unused, dead, code and data from the executables built. Useful to reduce binary sizes for curl, libcurl shared lib and apps linking static libcurl. It's effective on both "unity" and non-unity builds. Aligning "unity" build sizes with default, non-unity ones. Supported platforms: Apple, MSVC, llvm/clang and GCC on all tested platforms: Linux, BSDs, Windows, MSYS2/Cygwin, Android, MS-DOS. Notes: - Static libraries grow 20-30% with non-Apple toolchains. This effect is controlled by separate, optional compiler flags on non-Apple. This patch enables them automatically for public binaries (libcurl and curl tool), and leaves them off for internal/test ones. - MSVC enables this option by default for 'Release' configurations. The curl build option has no effect on it. - Observed effect on VS2010 is negligible. VS2012+ is recommended. - Works with LTO, Fil-C. - No observed/conclusive effect on build speed. - On Windows with clang/gcc (mingw-w64/MSYS2/Cygwin) it also enables `-fno-asynchronous-unwind-tables` as a workaround to make the toolchain options actually work. Ref: https://sourceware.org/bugzilla/show_bug.cgi?id=11539 Thanks-to: Andarwinux Also: - GHA: enable in Linux and MinGW jobs to test it. Size changes: - linux aws-lc H3: curl: 2000000 -> 1937152, libcurl.a: 2065724 -> 2716532 bytes - macos clang HTTP-only: curl: 1364376 -> 128799 bytes, libcurl.a: unchanged - macos llvm MultiSSL: curl: 410056 -> 405720, libcurl.dylib: 1350336 -> 1348480 bytes - mingw schannel c-ares U: curl: 1588736 -> 1507328, libcurl-d.a: 3322040 -> 3884746 bytes bld: 34 -> 35MB - GHA: enable in MSVC and Apple jobs to reduce disk footprint, with no obvious downside. Size changes: - AppVeyor CI VS2019: curl: 2339840 -> 1295872, libcurl-d.dll: 3155968 -> 1900544 bytes bld: 161 -> 97MB - AppVeyor CI VS2022 clang-cl: curl: 2933248 -> 2332160, libcurl-d.lib: 4762688 -> 5511330 bytes bld: 133 -> 121MB - AppVeyor CI VS2022 HTTP-only: curl: 3514368 -> 2177024, libcurl-d.lib: 2538420 -> 3151740 bytes bld: 137 -> 83MB - GHA intel: curl: 2629120 -> 2023424, libcurl-d.lib: 4366652 -> 5350670 bytes bld: 86 -> 69MB - GHA arm64: curl: 2832896 -> 2063872, libcurl-d.lib: 4690616 -> 5597250 bytes bld: 82 -> 66MB Refs: https://maskray.me/blog/2021-02-28-linker-garbage-collection https://web.archive.org/web/20110811230637/msdn.microsoft.com/en-us/library/bxwfs976.aspx (VS2010) https://learn.microsoft.com/cpp/build/reference/opt-optimizations https://learn.microsoft.com/cpp/build/reference/gy-enable-function-level-linking Closes #20357 |
||
|---|---|---|
| .circleci | ||
| .github | ||
| CMake | ||
| docs | ||
| include | ||
| lib | ||
| LICENSES | ||
| m4 | ||
| projects | ||
| scripts | ||
| src | ||
| tests | ||
| .dir-locals.el | ||
| .editorconfig | ||
| .git-blame-ignore-revs | ||
| .gitattributes | ||
| .gitignore | ||
| .mailmap | ||
| acinclude.m4 | ||
| appveyor.sh | ||
| appveyor.yml | ||
| buildconf | ||
| CHANGES.md | ||
| CMakeLists.txt | ||
| configure.ac | ||
| COPYING | ||
| curl-config.in | ||
| Dockerfile | ||
| GIT-INFO.md | ||
| libcurl.pc.in | ||
| Makefile.am | ||
| README | ||
| README.md | ||
| RELEASE-NOTES | ||
| renovate.json | ||
| REUSE.toml | ||
| SECURITY.md | ||
curl is a command-line tool for transferring data from or to a server using URLs. It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS.
Learn how to use curl by reading the man page or everything curl.
Find out how to install curl by reading the INSTALL document.
libcurl is the library curl is using to do its job. It is readily available to be used by your software. Read the libcurl man page to learn how.
Open Source
curl is Open Source and is distributed under an MIT-like license.
Contact
Contact us on a suitable mailing list or use GitHub issues/ pull requests/ discussions.
All contributors to the project are listed in the THANKS document.
Commercial support
For commercial support, maybe private and dedicated help with your problems or applications using (lib)curl visit the support page.
Website
Visit the curl website for the latest news and downloads.
Source code
Download the latest source from the Git server:
git clone https://github.com/curl/curl
Security problems
Report suspected security problems via our HackerOne page and not in public.
Backers
Thank you to all our backers 🙏 Become a backer.
Sponsors
Support this project by becoming a sponsor.