On 30.12.2017 18:35, Greg Troxel wrote: > > I don't want to derail the "how to deal with gcc" discussion, but it > seems likely that using clang on older NetBSD results in a better > situation than using the older gcc, and it therefore seems useful to > improve notes about how to use clang. > > This page: > > https://wiki.netbsd.org/tutorials/pkgsrc/clang/ > > explains how to use the clang bundled with NetBSD with pkgsrc. > > > I wonder how well it works on various NetBSD versions if one does: > > start with no packages > build/install lang/clang from pkgsrc > set: PKGSRC_COMPILER=clang CLANGBASE=/usr/pkg > continue > > Is this something I should put in the wiki? Or is the above a bad thing > to do?? > Has anybody tried it, particularly, on 5, 6, or 7? > This setup works well and almost everything is buildable. The exceptions (at least a single one in pkgsrc) use GCC inline functions with a trampoline. Another problem is that some programs compile slowly due to bugs in the compiler (this is true for gforth). There is need to add HAVE_LLVM=yes in mk.conf(5) in order to feed clang with compatible command line options. I'm using personally a standalone clang setup with a standalone ccache: PKGSRC_COMPILER= ccache clang CCACHE_BASE= /usr/local CCACHE_DIR= /public/ccache_tmp CCACHE_LOGFILE= /tmp/ccache.txt PKG_CC= clang PKG_CXX= clang++ CLANGBASE= /usr/local HAVE_LLVM= yes
Attachment:
signature.asc
Description: OpenPGP digital signature