On Tue, 2014-10-21 at 09:50 -0700, Tom Stellard wrote:
[SNIP]
> > > + void
> > > + init_targets() {
> > > + static bool targets_initialized = false;
> > > + if (!targets_initialized) {
> > > + LLVMInitializeAllTargets();
> > > + LLVMInitializeAllTargetInfos();
> > > + LLVMInitializeAllTargetMCs();
> > > + LLVMInitializeAllAsmPrinters();
> > > + targets_initialized = true;
> > Hi,
> > this part causes linking errors when llvm is built using cmake (split
> > shared libraries)
> > In function `LLVMInitializeAllAsmPrinters':
> > /home/vesely/.local/include/llvm/Config/AsmPrinters.def:27: undefined
> > reference to `LLVMInitializeAArch64AsmPrinter'
> > ...
> > for all targets other than r600
> >
> > a quick fix would be to link against all LLVM libs (and let something
> > like -Wl,--as-needed sort it out)
> >
> > but i think it would be nicer to have a pipe callback to do the
> > building. is there something I'm missing with that approach?
> >
>
> Having a callback is an interesting idea. One downside I can see is
> that it would require to the pipe drivers to link against clang and LLVM.I thought we could do something like this: keep the frontend (CL -> IR) in clover add a pipe callback to do IR -> elf binary similar to what it was before adding SHADER_IR_NATIVE, but it could do the second stage of compilation without running the kernel. The pipe driver will then run binaries it produced. i thought this could be supported by all pipe drivers, and we could have binary program cache without needing PIPE_SHADER_IR_NATIVE. > > For the time being, I think the best fix would be to do conditional > initialization based on the targets that may actually be used. I can > write up a patch for this. Ideally we would link against as few target > libraries as possible. I think if we used --as-needed, we may end up > pulling in all the libraries due to the way the library dependencies work > (I'm not 100% sure about this, though). I think --as-needed could at least strip out non-backend libs, LLVMInitializeAll* will need all of the backends anyway (or selected backends after your patch). --as-needed also looked as a good alternative to hand picking LLVM_COMPONENTS in configure.ac, but I'm not sure how it is supported across platforms. jan > > -Tom > > [snip] > > -- > > Jan Vesely <[email protected]> > > > > > _______________________________________________ > > mesa-dev mailing list > > [email protected] > > http://lists.freedesktop.org/mailman/listinfo/mesa-dev > -- Jan Vesely <[email protected]>
signature.asc
Description: This is a digitally signed message part
_______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
