[Mesa-dev] LLVMInitializeAMDGPU* undefined?

Emil Velikov emil.l.velikov at gmail.com
Fri Mar 11 23:12:39 UTC 2016


Hi Chih-Wei,

On 11 March 2016 at 02:09, Chih-Wei Huang <cwhuang at android-x86.org> wrote:
> 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:
>
The answer was actually spot on. If you don't build llvm with the
amdgpu backend (iirc the r600 backend just got renamed with llvm 3.7)
you will see compilation errors as the ones you reported.

Ideally one would wire up a check for android similar to the one we
have in configure.ac. Namely:


radeon_llvm_check() {
    if test ${LLVM_VERSION_INT} -lt 307; then
        amdgpu_llvm_target_name='r600'
    else
        amdgpu_llvm_target_name='amdgpu'
    fi
    ....
    if test true && $LLVM_CONFIG --targets-built | grep -iqvw
$amdgpu_llvm_target_name ; then
        AC_MSG_ERROR([LLVM $amdgpu_llvm_target_name not enabled in
your LLVM build.])
    ....
}



if test -n "$with_gallium_drivers"; then
    gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
    for driver in $gallium_drivers; do
    ....

        xr600)
            ....
            radeon_llvm_check "r600g"
            ....
           ;;
        xradeonsi)
            ....
           radeon_llvm_check "radeonsi"
            ....


Cheers,
Emil


More information about the mesa-dev mailing list