[Mesa-dev] LLVMInitializeAMDGPU* undefined?

Chih-Wei Huang cwhuang at android-x86.org
Fri Mar 11 02:09:38 UTC 2016

2016年3月10日 下午6:47於 "Marek Olšák" <maraeo at gmail.com>寫道:
> Those functions are only supported by LLVM 3.7 and later, and if you
> have such a version, the AMDGPU backend must be enabled in your LLVM
> build.

Yes, I knew that.
But seems you misunderstood my question.

It's a compile time error instead of a linking time error:

external/mesa/src/gallium/drivers/radeon/radeon_llvm_emit.c: In
function 'init_r600_target':
error: implicit declaration of function
error: implicit declaration of function 'LLVMInitializeAMDGPUTarget'
error: implicit declaration of function 'LLVMInitializeAMDGPUTargetMC'
error: implicit declaration of function

cc1: some warnings being treated as errors

Some proposed patches on the mesa side:

(add a header to declare the functions)

(disable implicit declaration warnings)

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)?

> On Thu, Mar 10, 2016 at 10:04 AM, Chih-Wei Huang
> <cwhuang at android-x86.org> wrote:
> > Hi devs,
> > On building 64-bit Android-x86 mesa with amdgpu support,
> > we got some errors about the symbols LLVMInitializeAMDGPU*
> > are not defined. (missing prototypes)
> >
> > It's easy to fix the errors by adding the definition of
> > the function prototypes.
> > However, I'm curious in which side it should be fixed?
> > The mesa or llvm?
> >
> > Does the llvm forgot to provide a header for these functions?
> > Or the functions are internal APIs of llvm that should not be used
> > by mesa directly?
> >
> > Any comment?

More information about the mesa-dev mailing list