Xo is experimental. The source is now public on GitHub, or try Xo in your browser.
Menu · XO1505

Docs

XO1505: the LLVM backend's clang is older than 16

error · reported by the build

The LLVM backend (--backend=llvm) compiles its IR with clang: $XO_CLANG, else clang on PATH, or --cc. The generated code reads thread locals through llvm.threadlocal.address, which LLVM 16 added: an older clang leaves it an undefined function and the link fails (undefined reference to llvm.threadlocal.address.p0). The build reads clang --version and stops before generating code. Apple’s clang numbers its versions apart from LLVM’s and is not checked. The native backends, the default, do not use clang.

Example

$ clang --version
clang version 15.0.7
$ xo build --backend=llvm .
XO1505: the LLVM backend needs clang 16 or later, but /usr/bin/clang is clang 15

Fix

# install clang 16 or newer and point Xo at it:
XO_CLANG=/usr/lib/llvm-19/bin/clang xo build --backend=llvm .
# or use the native backend, which does not run clang:
xo build .

Run xo explain XO1505 for this text in a terminal, or see section 10.6 of the specification.