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