Tracking issue for Darwin stdenv LLVM update: LLVM 16 -> LLVM 18 #309365
Labels
5. scope: tracking
Long-lived issue tracking long-term fixes or multiple sub-problems
6.topic: darwin
Running or building packages on Darwin
6.topic: llvm/clang
Issues related to llvmPackages, clangStdenv and related
6.topic: stdenv
Standard environment
This is the tracking issue for this year’s LLVM update for Darwin. Linux is already on LLVM 17, but both will be going to LLVM 18. My goal with this issue is to document common problems as well as their fixes. I’ve encountered a few breaking changes so far that have common solutions. Unlike last year’s update, the Darwin stdenv is in pretty good shape. It’s other packages that need fixed.
The target is to do the update early after the release of 24.05, so there is time to fix problems.
Previous tracking issue: #234710
error: non-private labels cannot appear between .cfi_startproc / .cfi_endproc pairs
This is due to llvm/llvm-project@d506aa4. It affects GCC and compiler-rt versions from LLVM 17 and earlier.
error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
This is a GCC bug when bootstrapping against newer versions of libc++. It is fixed upstream, but the patches are not yet available on a released version of GCC 6 through GCC 13.
undefined symbol:
__availability_version_check
LLVM 17 weakly links
_availability_verison_check
, but it is not available in the SDK until 10.15. This error shouldn’t happen because it has been fixed, but if it does, the fix is to revert back to finding the symbol at runtime usingdlsym
.C23 attributes expose bugs in attribute macros
Clang 18 adds support for C23 attributes, which gnulib will use preferentially. Unfortunately, older versions of gnulib either don’t try or don’t detect correctly whether the compiler supports
inline
in headers. This results in trying to usestatic [[__maybe_unused__]]
, which is not valid C23.Packages that use gettext with autoreconfHook will have
m4/extern-inline.m4
clobbered. If runningautoreconf
is not strictly necessary, the issue can be fixed by dropping the hook. Otherwise, the update to gettext should fix the issue.Another example is darwin.system_cmds, which attempts to use
static [[noreturn]]
. Even thoughstatic _Noreturn
is valid in C11,_Noreturn
is deprecated in C23, and[[noreturn]]
is intended to replace_Noreturn
,static [[noreturn]]
is not valid C23. The fix is to use[[noreturn]] static
instead.Incompatible vendored dependencies
Some vendored dependencies are incompatible with clang 18. If the issue has been fixed upstream (and in nixpkgs) and the package supports it, switch the vendored dependency to the fixed package in nixpkgs. Otherwise, you’ll have to patch the vendored dependency to fix the issue.
The text was updated successfully, but these errors were encountered: