From e5e0f8bdb8405754de30ee467ee5feea48b594e6 Mon Sep 17 00:00:00 2001 From: Mauro Rossi Date: Thu, 10 Nov 2016 23:27:09 +0100 Subject: [PATCH] android: conditionally add LLVM_TARGET(AMDGPU) in device configs Adding LLVM_TARGET(AMDGPU) causes LLVMInitializeAMDPU* prototypes definition, but this needs to be controlled by defining FORCE_BUILD_AMDGPU, in order to avoid building errors in clients not having AMDGPU support like for example md.lc which is broken by LLVM_TARGET(AMDGPU) Mesa amd/common and gallium radeonsi will require to define FORCE_BUILD_AMDGPU in Android makefiles in order to materialize LLVMInitializeAMDGPU* prototypes --- device/include/llvm/Config/AsmParsers.def | 4 ++++ device/include/llvm/Config/AsmPrinters.def | 4 ++++ device/include/llvm/Config/Targets.def | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/device/include/llvm/Config/AsmParsers.def b/device/include/llvm/Config/AsmParsers.def index 93d1be497cd..3e6c25d60ff 100755 --- a/device/include/llvm/Config/AsmParsers.def +++ b/device/include/llvm/Config/AsmParsers.def @@ -31,6 +31,10 @@ #elif defined(__i386__) || defined(__x86_64__) LLVM_ASM_PARSER(X86) +#if defined(FORCE_BUILD_AMDGPU) + LLVM_ASM_PARSER(AMDGPU) +#endif + #if defined(FORCE_BUILD_ARM) LLVM_ASM_PARSER(ARM) LLVM_ASM_PARSER(AArch64) diff --git a/device/include/llvm/Config/AsmPrinters.def b/device/include/llvm/Config/AsmPrinters.def index f367c1037c7..1d8d9ea8e30 100755 --- a/device/include/llvm/Config/AsmPrinters.def +++ b/device/include/llvm/Config/AsmPrinters.def @@ -31,6 +31,10 @@ #elif defined(__i386__) || defined(__x86_64__) LLVM_ASM_PRINTER(X86) +#if defined(FORCE_BUILD_AMDGPU) + LLVM_ASM_PRINTER(AMDGPU) +#endif + #if defined(FORCE_BUILD_ARM) LLVM_ASM_PRINTER(ARM) LLVM_ASM_PRINTER(AArch64) diff --git a/device/include/llvm/Config/Targets.def b/device/include/llvm/Config/Targets.def index 82acbf8af2a..faac9659782 100755 --- a/device/include/llvm/Config/Targets.def +++ b/device/include/llvm/Config/Targets.def @@ -30,6 +30,10 @@ #elif defined(__i386__) || defined(__x86_64__) LLVM_TARGET(X86) +#if defined(FORCE_BUILD_AMDGPU) + LLVM_TARGET(AMDGPU) +#endif + #if defined(FORCE_BUILD_ARM) LLVM_TARGET(ARM) LLVM_TARGET(AArch64) -- 2.11.0