Curl is a tool and libcurl is a library for transferring data with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TFTP, SCP, SFTP, TELNET, DICT, LDAP, LDAPS, FILE, IMAP, SMTP, POP3, RTSP and RTMP. libcurl offers a myriad of powerful features
Перейти к файлу
Viktor Szakats e91fcbac7d
macos: undo `availability` macro enabled by Homebrew gcc
Homebrew gcc builds starting with 12.4.0, 13.3.0 and 14.1.0 enabled
the `availability` attribute.

This broke builds because the way the Apple SDK uses attributes (when
available) are incompatible with how gcc accepts them. Causing these
errors:
```
  error: attributes should be specified before the declarator in a function definition
  error: expected ',' or '}' before
```

Upstream commits implementing the `availability` macro:
gcc-12: fd5530b7cb
gcc-13: cb7e4eca68
gcc-14: ff62a10886

The project above is a Darwin gcc compatibility pack, that is applied
to Homebrew gcc builds.

This patch works by redefining the `availability` macro to an invalid
value, making `__has_attribute(availability)` checks fail, stopping
Apple SDK from inserting the incompatible attributes.

It also replaces the previous, local workaround for `lib/macos.c`.

Example with gcc 12.4.0 with macOS SDK 14.0 (Xcode 15.0.1):
```
In file included from <path-to-sdk>/MacOSX14.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:54,
                 from <path-to-sdk>/MacOSX14.0.sdk/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStoreCopySpecific.h:30,
                 from /Users/runner/work/curl/curl/lib/macos.c:33,
                 from /Users/runner/work/curl/curl/build/lib/CMakeFiles/libcurl_shared.dir/Unity/unity_0_c.c:244:
<path-to-sdk>/MacOSX14.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h:126:1: error: attributes should be specified before the declarator in a function definition
  126 | CF_INLINE CFOptionFlags CFUserNotificationCheckBoxChecked(CFIndex i) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) {return ((CFOptionFlags)(1UL << (8 + i)));}
      | ^~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/9787982387/job/27025351601?pr=14096#step:7:18

The gcc vs. llvm/clang incompatibility possibly tracked here upstream:
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108796
More info:
  https://github.com/llvm/llvm-project/issues/81767
  8433baadec
  https://discourse.llvm.org/t/changing-attribute-ast-printing-location-for-gcc-compatibility/73215
  https://reviews.llvm.org/D159362

Follow-up to db135f8d72 #14119
Ref: https://github.com/curl/curl/pull/14091#issuecomment-2222703468
Fixes #13700
Cherry-picked from #14097
Closes #14155
2024-07-12 00:32:39 +02:00
.circleci
.github ISSUE_TEMPLATE/docs: add a separate GitHub issue template for documentation 2024-07-11 23:56:20 +02:00
CMake build: tidy up `__builtin_available` feature checks (Apple) 2024-07-10 11:42:46 +02:00
LICENSES
docs DISTROS: add AlmaLinux package source link 2024-07-11 12:52:58 -07:00
include
lib macos: undo `availability` macro enabled by Homebrew gcc 2024-07-12 00:32:39 +02:00
m4 configure: fix `SystemConfiguration` detection 2024-07-10 11:30:40 +02:00
packages winbuild: MS-DOS batch tidy-ups 2024-07-02 19:26:15 +02:00
plan9
projects
scripts reuse: switch to REUSE 3.2 and REUSE.toml 2024-07-05 20:47:48 +02:00
src curl: follow-up to fix categories in --help 2024-07-05 14:44:43 -07:00
tests test1175: scan libcurl-errors.md, not the generated .3 version 2024-07-09 23:13:40 +02:00
winbuild winbuild: MS-DOS batch tidy-ups 2024-07-02 19:26:15 +02:00
.azure-pipelines.yml
.cirrus.yml CI: bump FreeBSD Python packages 2024-07-09 23:31:27 +02:00
.dcignore
.dir-locals.el
.git-blame-ignore-revs
.gitattributes winbuild: MS-DOS batch tidy-ups 2024-07-02 19:26:15 +02:00
.gitignore
.mailmap
CHANGES
CMakeLists.txt cmake: detect `libidn2` also via `pkg-config` 2024-07-10 11:42:47 +02:00
COPYING
Dockerfile Dockerfile: update debian:bookworm-slim to 39868a6 2024-07-03 08:39:27 +02:00
GIT-INFO.md GIT-INFO.md: remove version requirements 2024-07-08 23:06:05 +02:00
Makefile.am winbuild: MS-DOS batch tidy-ups 2024-07-02 19:26:15 +02:00
Makefile.dist
README
README.md
RELEASE-NOTES RELEASE-NOTES: synced 2024-07-09 23:19:02 +02:00
REUSE.toml reuse: fix typo in comment 2024-07-06 02:39:24 +02:00
SECURITY.md
acinclude.m4 build: tidy up `__builtin_available` feature checks (Apple) 2024-07-10 11:42:46 +02:00
appveyor.sh CI: simplify running curl with DLLs 2024-07-10 11:30:39 +02:00
appveyor.yml
buildconf
buildconf.bat
configure.ac configure: limit `SystemConfiguration` test to non-c-ares, IPv6 builds 2024-07-10 11:42:46 +02:00
curl-config.in
libcurl.def
libcurl.pc.in
maketgz
renovate.json

README.md

curl logo

Curl is a command-line tool for transferring data specified with URL syntax. Find out how to use curl by reading the curl.1 man page or the MANUAL document. 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.3 man page to learn how.

You can find answers to the most frequent questions we get in the FAQ document.

Study the COPYING file for distribution terms.

Contact

If you have problems, questions, ideas or suggestions, please contact us by posting to a suitable mailing list.

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.

Git

To download the latest source from the Git server, do this:

git clone https://github.com/curl/curl.git

(you will get a directory named curl created, filled with the source code)

Security problems

Report suspected security problems via our HackerOne page and not in public.

Notice

Curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan. This notice is included here to comply with the distribution terms.

Backers

Thank you to all our backers! 🙏 Become a backer.

Sponsors

Support this project by becoming a sponsor.