This page explains how to use clang with the NetBSD base system. See also [how to use clang to build packages](../pkgsrc/clang/). Since NetBSD 6, the base system has included clang, but it is not built or used by default. To use it, set in mk.conf MKGCC=no MKLLVM=yes HAVE_LLVM=yes CLANGBASE=/usr And run "build.sh release". This will apply for both pkgsrc and base. This will work on ARM, PowerPC, x86, and possibly SPARC64. MKGCC=no needed as building GCC alongside is not maintained. MKLLVM=yes builds LLVM libraries. HAVE_LLVM=yes controls clang being built CLANGBASE=/usr instructs pkgsrc where to look for the compiler # status On NetBSD-current, clang builds successfully on several architectures. These builds are with all three of the above flags enabled. https://releng.netbsd.org/builds/HEAD-llvm/