[Buildroot] [PATCH] package/clang: link libclang against libLLVM.so

Valentin Korenblit valentin.korenblit at smile.fr
Fri May 11 11:37:28 UTC 2018


Hi Thomas,

On 04/05/2018 17:05, Thomas Petazzoni wrote:
> Hello,
>
> On Fri,  4 May 2018 14:27:43 +0200, Valentin Korenblit wrote:
>> libclang.so is statically linking against all LLVM static libraries
>> instead of linking dynamically against libLLVM.so.
>>
>> This patch fixes this problem partially: libclang links against libLLVM.so
>> but the following LLVM libraries are still being linked statically:
>>
>> libLLVMOption.a
>> libLLVMMCParser.a
>> libLLVMProfileData.a
>> libLLVMBitReader.a
>> libLLVMBinaryFormat.a
>> libLLVMCore.a
>> libLLVMMC.a
>> libLLVMSupport.a
>> libLLVMDemangle.a
>>
>> This problem comes out when clang is not built as a subproject of
>> LLVM (llvm/tools/clang).
> Is this a problem you have discussed with upstream ? Has the patch
> you did on the clang CMakeLists.txt any chance from being accepted
> upstream ?

I didn't, because I was not really convinced about this patch. I've
just found the appropriate solution.

We need to set DLLVM_LINK_LLVM_DYLIB=ON in clang.mk. I'll send the
patch now.

>
> Thanks!
>
> Thomas

Best regards,

Valentin




More information about the buildroot mailing list