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

Tracking issue for Darwin stdenv LLVM update: LLVM 16 -> LLVM 18 #309365

Open
3 tasks
reckenrode opened this issue May 5, 2024 · 1 comment
Open
3 tasks

Tracking issue for Darwin stdenv LLVM update: LLVM 16 -> LLVM 18 #309365

reckenrode opened this issue May 5, 2024 · 1 comment
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

Comments

@reckenrode
Copy link
Contributor

reckenrode commented May 5, 2024

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 using dlsym.

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 use static [[__maybe_unused__]], which is not valid C23.

Packages that use gettext with autoreconfHook will have m4/extern-inline.m4 clobbered. If running autoreconf 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 though static _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.

@reckenrode reckenrode added 0.kind: packaging request Request for a new package to be added and removed 0.kind: packaging request Request for a new package to be added labels May 5, 2024
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/darwin-updates-news/42249/13

@Qyriad Qyriad added 6.topic: darwin Running or building packages on Darwin 6.topic: stdenv Standard environment labels May 6, 2024
@lf- lf- added the 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related label May 26, 2024
@rrbutani rrbutani added the 5. scope: tracking Long-lived issue tracking long-term fixes or multiple sub-problems label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

5 participants