[Mesa-dev] LLVMInitializeAMDGPU* undefined?

Jan Vesely jan.vesely at rutgers.edu
Mon Mar 14 16:08:23 UTC 2016


On Mon, 2016-03-14 at 10:19 +0800, Chih-Wei Huang wrote:
> 2016-03-11 11:50 GMT+08:00 Jan Vesely <jan.vesely at rutgers.edu>:
> > 
> > On Fri, 2016-03-11 at 10:09 +0800, Chih-Wei Huang wrote:
> > > 
> > > cc1: some warnings being treated as errors
> > > 
> > > 
> > > But I'm still not sure whether if it should be fixed on the mesa
> > > side.
> > > 
> > > So my question is, what kind of fix do we want (i.e., acceptable
> > > by
> > > the upstream)?
> > this is the result of using llvm without AMDGPU backend. the header
> > "llvm-c/Target.h" includes "llvm/Config/Targets.def" and declares
> > functions based on backends listed there (selected at llvm build
> > time).
> > 
> > Your "llvm/Config/Targets.def" needs to include this line:
> > LLVM_TARGET(AMDGPU)
> Ah, thank you for pointed it out.
> Originally I thought adding Android.mk for AMDGPU is enough.
> I'll try to add this.
> 
> Anything else we need to do to "enable" AMDGPU backend?

Enable it in cmake configure :) (LLVM_TARGETS_TO_BUILD).
on a more serious note, I don't really know the details of llvm build
system, much less how it's done on android.

Targets.def is generated from Targets.def.in that includes
@LLVM_ENUM_TARGETS at . this macro is constructed by cmake by iterating
through the LLVM_TARGETS_TO_BUILD variable. (CMakeLists.txt:508).

Other places generate code based on configure. There are 40+ .in file
in llvm/clang so you might need to dig deeper.

regards,
Jan

> 
> > 
> > otherwise the functions are not declared.
> > probably the only patch needed on mesa side is to detect this at
> > configure time.
> Android doesn't need configure.
> What we need is to detect Android version then
> we know the llvm version it uses and what backends it has.
> The patch is already in android-x86 codebase but
> probably not submited to mesa-dev yet.
> 
> 
-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160314/cd8a3ba8/attachment-0001.sig>


More information about the mesa-dev mailing list