[blfs-dev] LLVM-Mesa interaction

Pierre Labastie pierre.labastie at neuf.fr
Tue Sep 8 13:24:43 PDT 2015


On 08/09/2015 16:30, Fernando de Oliveira wrote:
> Em 08-09-2015 10:43, Pierre Labastie escreveu:
>> Hi,
>>
>> If Mesa is built with the r600 gallium driver, it needs that the
>> r600 target be enabled for LLVM. Currently, the book instructions
>> have only "--enable-targets=host" in LLVM, while they have
>> GLL_DRV="nouveau,r300,r600,radeonsi,svga,swrast" in Mesa,
>> and Mesa build fails.
>> As noted in the mesa ticket for 10.6.6, and included in the book,
>> Mesa needs to be patched to build the r600 driver, but this is
>> another issue.
>> Removing r600 from this GLL_DRV allows Mesa to build (obviously
>> without the r600 driver), but I am not sure this is the best
>> alternative.
>> First, I think that a note should be added to the command
>> explanations in LLVM, telling that if the r600 GLL driver is needed,
>> target r600 should be added.
>> Then add a note to Mesa telling that r600 GLL driver should be
>> removed if r600 has not been built in LLVM.
>>
>> Please tell me whether it suits you.
>>
>> Pierre
>>
> 
> Agreed. I couldn't decide, and forgot to ask Ken if it would be OK to
> remove form Mesa and let the user decide, when he needed, because Ken
> explicitly mentioned r600 in two ocasions or more, in our discussion.
> That made me thinking that I could remove from GLL_DRV, because a user
> needing it would fill up the steps. Of course, Ken is much more than a
> user, so, your suggestion is probably the best one. But it would be good
> to hear Ken's opinion.
> 
> Again, I agree with you, but Ken may provide some better alternative.
> 

Hope Ken can see this...

OTOH, here is some added information about LLVM:

I've looked at llvm configure script:
--enable-targets=r600 is equivalent to --enable-targets=amdgpu
--enable-targets=host is equivalent to --enable-targets=x86 on i686 or x86_64
--enable-targets=cpp has nothing to do with clang++. If you build and use that
target, you'll generate C++ code obtained from the llvm assembly code
generated by the compiler. I found this explanation on the internet:
"The CPP backend creates LLVM API calls to create an AST that represent the
equivalent of the LLVM assembly." I haven't understood everything, but I think
that is not something useful for the book...

Also, the r600/amdgpu target is needed for radeonsi driver, and optional for
r600 driver, but mesa-10 cannot be built with it/them on llvm-3.7.0 (it needs
patches at least). OTOH, mesa-11 should be out within a few days (already at
rc3). I wonder whether updating to mesa-11 could be considered for BLFS-7.8. I
understand that Mesa impact a lot of other packages, but maybe not so many
outside "X window system environment" chapter. Note that radeonsi is needed
for Radeon Southern Islands and later gpu's (I have received all this
information in a private mail from a former editor).

Pierre


More information about the blfs-dev mailing list