On Tue, Jan 01, 2019 at 03:34:47PM +0100, Martin Husemann wrote: > On Tue, Jan 01, 2019 at 02:22:54PM +0000, m...@netbsd.org wrote: > > I'm stuck between the hammer and the anvil here. > > I'd like NetBSD to use a recent MesaLib, the kind that uses LLVM. > > Can you explain how the MesaLib build uses llvm? > > This kinda sounds like you need a special build time binary that would > live in $TOOLDIR and it is not exactly clear how installing some headers > helps building this tool (as you can not assume a NetBSD build host). > > Martin
I haven't dug up too much into it in the past, so this was fun to discover: MesaLib is a compiler for turning agnostic representations like GLSL and SPIR-V into hardware appropriate ones. It has passes and intermediate formats (plural!) and everything. AMD drivers use LLVM as a step in the process, they defined an AMDGPU as a target architecture. I'm not sure how a JIT works, but swrast uses LLVM for its JIT. at least on the pkgsrc build, swrast and radeonsi are dynamically linked with libLLVM.