tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Cross-compiling libLLVM requires version-matched llvm



> Date: Thu, 15 Jun 2023 11:05:28 +0000
> From: Taylor R Campbell <campbell+netbsd-tech-pkg%mumble.net@localhost>
> 
> Cross-compiling X these days requires Mesa which requires libLLVM.
> 
> libLLVM in turn requires running llvm-tblgen.  It can build
> llvm-tblgen internally for native builds, but it has no mechanism like
> CXX_FOR_BUILD for cross builds, for which it relies on a preinstalled
> llvm-tblgen, which comes from llvm.
> 
> However, libLLVM requires a version-matched llvm for llvm-tblgen, and
> there is version skew between lang/libLLVM (13.0.1) and lang/llvm
> (15.0.7).  What to do?
> 
> 1. Reimport llvm 13.0.1 as lang/llvm13 verbatim.  Problem: conflicts
>    with lang/llvm.
> 
> 2. Reimport llvm 13.0.1 as lang/llvm13, but put under a different
>    prefix like ${PREFIX}/llvm13.
> 
> 3. See if we can get by with a single version.  Problem: sounds
>    nontrivial; presumably there was a reason for the stern comment in
>    lang/llvm/Makefile about not updating libLLVM at the same time.

Perhaps there's a better option, since lang/libLLVM is already
basically a customized llvm build that puts llvm-config in a special
place, libexec/libLLVM/llvm-config: just do the same for llvm-tblgen
and install it in libexec/libLLVM/llvm-tblgen.

No need to track an extra package, no need to add to the maintenance
burden of lang/llvm by forcing mesa updates, and the maintenance
burden (and disk space cost) of dealing with the llvm-tblgen on top of
llvm-config is probably negligible.

I'll see if I can draft this.  

Meanwhile: we need to figure out how to make llvm-config usable as a
tool during cross-compilation; aside from that and some other minor
local changes waiting for TOOLBASE/LOCALBASE split after the freeze,
I've got all of modular-xorg cross-built (unprivileged) into binary
packages that install into /usr/pkg now.


Home | Main Index | Thread Index | Old Index