Diff for /wikisrc/tutorials/clang.mdwn between versions 1.1 and 1.8

version 1.1, 2017/12/30 18:34:03 version 1.8, 2018/11/07 06:56:34
Line 1 Line 1
 This page explainsse 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](tutorials/pkgsrc/clang/).  It works on ARM, PowerPC, x86, and possibly SPARC64, but is not built by default.  
   To use it, set in mk.conf.
 \todo: review this entire page.  
   
 Since NetBSD 6, the base system has included clang, but it is not  
 built or used by default.  
   
 \todo Explain if there are or aren't plans to enable it by default, or  
 to switch, keeping in mind that compiler support varies by architecture.  
   
 There are three steps that can be taken with clang; each depends on the previous.  
   
 # Building clang  
   
 To build clang as part of the build, set  
   
       MKGCC=no
     MKLLVM=yes      MKLLVM=yes
   
 in mk.conf before running "build.sh release".  
   
 This will build clang, which will appear in /usr/bin/clang and also  
 build libraries that clang needs.  NetBSD itself will not be built  
 with clang, but you will be able to use clang to build programs.  
   
 # Using clang to build the NetBSD base system  
   
 In addition, set  
   
     HAVE_LLVM=yes      HAVE_LLVM=yes
       CLANGBASE=/usr
   
 to cause clang to be used instead of gcc.  And run "build.sh release". This will apply for both pkgsrc and base.
   
 \todo It is not 100% clear if this stage works, vs having to set  
 MKGCC=no also.  
   
 # Not building gcc  
   
 On a system that builds clang and uses it to build the base system,  tunable                | explanation
 you can refrain from building gcc, by additionally adding:  -----------------------|----------------------------------------------------
   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
   
     MKGCC=no  # status
   
   [[NetBSD-current clang build status|https://releng.netbsd.org/builds/HEAD-llvm/]]

Removed from v.1.1  
changed lines
  Added in v.1.8


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb