File:  [NetBSD Developer Wiki] / wikisrc / tutorials / clang.mdwn
Revision 1.5: download - view: text, annotated - select for diffs
Wed Nov 7 06:46:18 2018 UTC (20 months, 4 weeks ago) by maya
Branches: MAIN
CVS tags: HEAD
Simplify use of this page (so the mk.conf hunk can be copied, and
then explain it). mention supported archs.

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

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