File:  [NetBSD Developer Wiki] / wikisrc / tutorials / clang.mdwn
Revision 1.4: download - view: text, annotated - select for diffs
Thu Jan 4 20:45:01 2018 UTC (2 years, 9 months ago) by gdt
Branches: MAIN
CVS tags: HEAD
add link to head llvm builds

    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: \todo: review this entire page.
    5: 
    6: Since NetBSD 6, the base system has included clang, but it is not
    7: built or used by default.
    8: 
    9: \todo Explain if there are or aren't plans to enable it by default, or
   10: to switch, keeping in mind that compiler support varies by architecture.
   11: 
   12: There are three steps that can be taken with clang; each depends on the previous.
   13: 
   14: # Building clang
   15: 
   16: To build clang as part of the build, set
   17: 
   18:     MKLLVM=yes
   19: 
   20: in mk.conf before running "build.sh release".
   21: 
   22: This will build clang, which will appear in /usr/bin/clang and also
   23: build libraries that clang needs.  NetBSD itself will not be built
   24: with clang, but you will be able to use clang to build programs.
   25: 
   26: # Using clang to build the NetBSD base system
   27: 
   28: In addition, set
   29: 
   30:     HAVE_LLVM=yes
   31: 
   32: to cause clang to be used instead of gcc.
   33: 
   34: # Not building gcc
   35: 
   36: On a system that builds clang and uses it to build the base system,
   37: you can refrain from building gcc, by additionally adding:
   38: 
   39:     MKGCC=no
   40: 
   41: # status
   42: 
   43: On NetBSD-current, clang builds successfully on several architectures.
   44: These builds are with all three of the above flags enabled.
   45: 
   46: https://releng.netbsd.org/builds/HEAD-llvm/

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