curl/lib
Viktor Szakats db135f8d72
macos: add workaround for gcc, non-c-ares, IPv6, compile error
Apple macOS SDK 13.0 and later are increasingly incompatible with gcc,
which started causing CI errors with the 20240701.9 revision of the
`macos-latest` (= `macos-14-arm64`) runner image.

This error is happening inside an Apple SDK header. We use the header
for calling a function in a resolver-related hack, in non-c-ares, IPv6
builds. You can avoid the problem by using c-ares or disabling IPv6
(or using clang, llvm, or a compatible gcc + SDK combination).

This patch fixes affected builds by declaring the ncessary framework
function manually, and not including the problematic header.

This workaround is ugly, doesn't cover all combinations, and fragile.

Other options are to disable this resolver-related hack for GCC, or to
replace it with a solution that doesn't rely on Apple SDK.

If you are aware of a stable fix or workaround, let us know.

gcc 12.4.0 + macOS SDK 14.0 (Xcode 15.0.1) error example:
```
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:54,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/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:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/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)));}
      | ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h:127:1: error: attributes should be specified before the declarator in a function definition
  127 | CF_INLINE CFOptionFlags CFUserNotificationSecureTextField(CFIndex i) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) {return ((CFOptionFlags)(1UL << (16 + i)));}
      | ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h:128:1: error: attributes should be specified before the declarator in a function definition
  128 | CF_INLINE CFOptionFlags CFUserNotificationPopUpSelection(CFIndex n) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) {return ((CFOptionFlags)(n << 24));}
      | ^~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/9787982387/job/27025351601?pr=14096#step:7:18

The exact conditions are fuzzy. Oddly enough gcc 12.3.0 and the SDK
same as above are _compatible_:
https://github.com/curl/curl/actions/runs/9791701214/job/27036037162

Also notice that similar errors can also happen in SecureTransport
builds, due to the SDK headers required.

Ref: https://github.com/curl/curl/pull/14097#issuecomment-2208639046
Ref: https://github.com/curl/curl/pull/14091#issuecomment-2205870854
Cherry-picked from #14097
Closes #14119
2024-07-08 12:03:46 +02:00
..
vauth code: language cleanup in comments 2024-07-01 22:58:55 +02:00
vquic code: language cleanup in comments 2024-07-01 22:58:55 +02:00
vssh code: language cleanup in comments 2024-07-01 22:58:55 +02:00
vtls code: language cleanup in comments 2024-07-01 22:58:55 +02:00
.checksrc
.gitattributes
.gitignore build: remove MacOSX-Framework script 2024-04-08 22:46:51 +02:00
altsvc.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
altsvc.h lib: tidy up types and casts 2024-06-05 14:02:39 +02:00
amigaos.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
amigaos.h
arpa_telnet.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
asyn-ares.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
asyn-thread.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
asyn.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
base64.c lib: silence -Wsign-conversion in base64, strcase, mprintf 2024-04-24 23:29:30 +02:00
bufq.c bufq: writing into a softlimit queue cannot be partial 2024-03-03 17:35:47 +01:00
bufq.h bufq: remove duplicate word in comment 2024-05-08 19:12:03 +02:00
bufref.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
bufref.h
c-hyper.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
c-hyper.h http: expect 100 rework 2024-03-18 12:41:56 +01:00
cf-h1-proxy.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
cf-h1-proxy.h
cf-h2-proxy.c multi: fix pollset during RESOLVING phase 2024-07-02 11:17:38 +02:00
cf-h2-proxy.h
cf-haproxy.c connection: shutdown TLS (for FTP) better 2024-06-10 13:08:12 +02:00
cf-haproxy.h
cf-https-connect.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
cf-https-connect.h
cf-socket.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
cf-socket.h socket: support binding to interface *AND* IP 2024-06-04 23:47:54 +02:00
cfilters.c lib: graceful connection shutdown 2024-06-26 08:33:17 +02:00
cfilters.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
CMakeLists.txt cmake: enable SOVERSION for Cygwin and CMAKE_DLL_NAME_WITH_SOVERSION 2024-06-13 19:30:39 +02:00
config-amigaos.h
config-dos.h
config-mac.h
config-os400.h lib: merge ENABLE_QUIC C macro into USE_HTTP3 2024-04-13 08:33:27 +00:00
config-plan9.h build: prefer USE_IPV6 macro internally (was: ENABLE_IPV6) 2024-04-13 08:33:26 +00:00
config-riscos.h build: prefer USE_IPV6 macro internally (was: ENABLE_IPV6) 2024-04-13 08:33:26 +00:00
config-win32.h build: prefer USE_IPV6 macro internally (was: ENABLE_IPV6) 2024-04-13 08:33:26 +00:00
config-win32ce.h
conncache.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
conncache.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
connect.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
connect.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
content_encoding.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
content_encoding.h
cookie.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
cookie.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_addrinfo.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_addrinfo.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_base64.h
curl_config.h.cmake code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_ctype.h
curl_des.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_des.h
curl_endian.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_endian.h
curl_fnmatch.c lib: tidy up types and casts 2024-06-05 14:02:39 +02:00
curl_fnmatch.h
curl_get_line.c lib: convert Curl_get_line to use dynbuf 2024-02-07 09:22:10 +01:00
curl_get_line.h lib: convert Curl_get_line to use dynbuf 2024-02-07 09:22:10 +01:00
curl_gethostname.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_gethostname.h
curl_gssapi.c
curl_gssapi.h
curl_hmac.h
curl_krb5.h
curl_ldap.h
curl_md4.h
curl_md5.h
curl_memory.h
curl_memrchr.c
curl_memrchr.h
curl_multibyte.c curl_multibyte: remove access() function wrapper for Windows 2024-05-07 02:28:10 -04:00
curl_multibyte.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_ntlm_core.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_ntlm_core.h
curl_path.c curl_path: make Curl_get_pathname use dynbuf 2024-05-08 10:10:12 +02:00
curl_path.h curl_path: make Curl_get_pathname use dynbuf 2024-05-08 10:10:12 +02:00
curl_printf.h
curl_range.c
curl_range.h
curl_rtmp.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_rtmp.h curl_version_info: provide librtmp version 2024-04-15 16:48:34 +02:00
curl_sasl.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_sasl.h
curl_setup_once.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_setup.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_sha256.h
curl_sha512_256.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_sha512_256.h SHA-512/256: implement hash algorithm 2024-02-20 11:35:56 +01:00
curl_sspi.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_sspi.h
curl_threads.c windows: fix UWP builds, add GHA job 2024-06-05 00:52:24 +02:00
curl_threads.h windows: fix UWP builds, add GHA job 2024-06-05 00:52:24 +02:00
curl_trc.c ftp: add tracing support 2024-05-10 23:39:48 +02:00
curl_trc.h ftp: add tracing support 2024-05-10 23:39:48 +02:00
curlx.h curl: use curl_getenv instead of the curlx_ version 2024-03-30 22:45:47 +01:00
cw-out.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
cw-out.h cw-out: improved error handling 2024-04-16 15:52:10 +02:00
dict.c lib: xfer_setup and non-blocking shutdown 2024-06-11 13:41:03 +02:00
dict.h
dllmain.c dllmain: Call OpenSSL thread cleanup for Windows and Cygwin 2024-04-24 04:04:25 -04:00
doh.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
doh.h build: untangle UNITTESTS and DEBUGBUILD macros 2024-05-27 21:15:50 +02:00
dynbuf.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
dynbuf.h
dynhds.c build: untangle UNITTESTS and DEBUGBUILD macros 2024-05-27 21:15:50 +02:00
dynhds.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
easy_lock.h
easy.c multi: fix pollset during RESOLVING phase 2024-07-02 11:17:38 +02:00
easygetopt.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
easyif.h build: untangle CURLDEBUG and DEBUGBUILD macros 2024-05-28 08:12:00 +02:00
easyoptions.c tcpkeepalive: add CURLOPT_TCP_KEEPCNT and --keepalive-cnt 2024-06-12 09:31:17 +02:00
easyoptions.h
escape.c lib: tidy up types and casts 2024-06-05 14:02:39 +02:00
escape.h
file.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
file.h
fileinfo.c
fileinfo.h
fopen.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
fopen.h
formdata.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
formdata.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
ftp.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
ftp.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
ftplistparser.c llist: add Curl_llist_append() 2024-04-11 09:00:51 +02:00
ftplistparser.h
functypes.h
getenv.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
getinfo.c docs: misc language polish 2024-07-01 16:45:17 +02:00
getinfo.h
gopher.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
gopher.h
hash.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
hash.h multi: add multi->proto_hash, a key-value store for protocol data 2024-05-26 00:15:01 +02:00
headers.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
headers.h http: move headers collecting to writer 2024-02-26 09:44:15 +01:00
hmac.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
hostasyn.c
hostip4.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
hostip6.c
hostip.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
hostip.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
hostsyn.c
hsts.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
hsts.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http1.c lib: tidy up types and casts 2024-06-05 14:02:39 +02:00
http1.h
http2.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http2.h
http_aws_sigv4.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http_aws_sigv4.h
http_chunks.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http_chunks.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http_digest.c
http_digest.h
http_negotiate.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http_negotiate.h
http_ntlm.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http_ntlm.h
http_proxy.c connection: shutdown TLS (for FTP) better 2024-06-10 13:08:12 +02:00
http_proxy.h
http.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
idn.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
idn.h idn: add native AppleIDN (icucore) support for macOS/iOS 2024-04-17 00:24:09 +02:00
if2ip.c if2ip: make the buf_size arg a size_t 2024-04-30 14:22:11 +02:00
if2ip.h if2ip: make the buf_size arg a size_t 2024-04-30 14:22:11 +02:00
imap.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
imap.h
inet_ntop.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
inet_ntop.h lib: tidy up types and casts 2024-06-05 14:02:39 +02:00
inet_pton.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
inet_pton.h
krb5.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
ldap.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
libcurl.rc (lib)curl.rc: set debug flag also for CURLDEBUG and UNITTESTS 2024-05-22 08:38:12 +02:00
libcurl.vers.in
llist.c llist: add Curl_llist_append() 2024-04-11 09:00:51 +02:00
llist.h llist: add Curl_llist_append() 2024-04-11 09:00:51 +02:00
macos.c macos: add workaround for gcc, non-c-ares, IPv6, compile error 2024-07-08 12:03:46 +02:00
macos.h
Makefile.am build: untangle CURLDEBUG and DEBUGBUILD macros 2024-05-28 08:12:00 +02:00
Makefile.inc mbedTLS: implement CURLOPT_SSL_CIPHER_LIST option 2024-04-24 14:30:37 +02:00
Makefile.mk build: prefer USE_IPV6 macro internally (was: ENABLE_IPV6) 2024-04-13 08:33:26 +00:00
Makefile.soname
md4.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
md5.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
memdebug.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
memdebug.h lib: tidy up types and casts 2024-06-05 14:02:39 +02:00
mime.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
mime.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
mprintf.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
mqtt.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
mqtt.h mqtt, remove remaining use of data->state.buffer 2024-01-27 12:42:19 +01:00
multi.c multi: pollset assertion only when IP connected 2024-07-05 17:00:58 +02:00
multihandle.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
multiif.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
netrc.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
netrc.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
nonblock.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
nonblock.h
noproxy.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
noproxy.h noproxy: patterns need to be comma separated 2024-06-01 12:25:13 +02:00
openldap.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
optiontable.pl curldown: Fix email address in Copyright 2024-02-28 11:28:10 +01:00
parsedate.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
parsedate.h
pingpong.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
pingpong.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
pop3.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
pop3.h lib: add Curl_xfer_write_resp_hd 2024-04-11 09:29:21 +02:00
progress.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
progress.h
psl.c
psl.h
rand.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
rand.h
rename.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
rename.h
request.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
request.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
rtsp.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
rtsp.h http: remove "struct HTTP" 2024-06-12 16:04:53 +02:00
select.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
select.h multi: prepare multi_wait() for future shutdown usage 2024-06-10 13:11:05 +02:00
sendf.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
sendf.h transfer: do not use EXPIRE_NOW while blocked 2024-06-13 15:13:43 +02:00
setopt.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
setopt.h setopt: warn on Curl_set*opt() uses not using the return value 2024-05-12 17:27:51 +02:00
setup-os400.h os400: make it compilable again 2024-06-13 11:30:55 +02:00
setup-vms.h docs: misc language polish 2024-07-01 16:45:17 +02:00
setup-win32.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
sha256.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
share.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
share.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
sigpipe.h
slist.c
slist.h
smb.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
smb.h lib: further send/upload handling polish 2024-03-04 08:42:56 +01:00
smtp.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
smtp.h lib: further send/upload handling polish 2024-03-04 08:42:56 +01:00
sockaddr.h build: prefer USE_IPV6 macro internally (was: ENABLE_IPV6) 2024-04-13 08:33:26 +00:00
socketpair.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
socketpair.h socketpair: provide Curl_socketpair only when !CURL_DISABLE_SOCKETPAIR 2024-06-07 10:47:15 +02:00
socks_gssapi.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
socks_sspi.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
socks.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
socks.h
speedcheck.c
speedcheck.h
splay.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
splay.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
strcase.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
strcase.h
strdup.c
strdup.h
strerror.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
strerror.h
strtok.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
strtok.h
strtoofft.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
strtoofft.h docs: misc language polish 2024-07-01 16:45:17 +02:00
system_win32.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
system_win32.h system_win32: add missing curl.h include 2024-06-26 10:05:32 +02:00
telnet.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
telnet.h
tftp.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
tftp.h
timediff.c
timediff.h docs: misc language polish 2024-07-01 16:45:17 +02:00
timeval.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
timeval.h
transfer.c transfer: avoid polling socket every transfer loop 2024-07-04 23:02:41 +02:00
transfer.h transfer: do not use EXPIRE_NOW while blocked 2024-06-13 15:13:43 +02:00
url.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
url.h lib: graceful connection shutdown 2024-06-26 08:33:17 +02:00
urlapi-int.h build: untangle UNITTESTS and DEBUGBUILD macros 2024-05-27 21:15:50 +02:00
urlapi.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
urldata.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
version_win32.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
version_win32.h
version.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
warnless.c
warnless.h warnless: delete orphan declarations 2024-05-14 16:37:11 +02:00
ws.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
ws.h docs: misc language polish 2024-07-01 16:45:17 +02:00