[OE-core] [meta-clang] LLVM shared library support

Khem Raj raj.khem at gmail.com
Thu Mar 9 21:06:00 UTC 2017


On Fri, Mar 3, 2017 at 12:09 PM, Khem Raj <raj.khem at gmail.com> wrote:
> On Fri, Mar 3, 2017 at 11:15 AM, Martin Kelly <mkelly at xevo.com> wrote:
>> Hi,
>>
>> I noticed that meta-clang builds only static LLVM libraries, unlike the
>> meta-oe version of LLVM 3.3, which builds shared libraries. In fact, this
>> appears to be the LLVM upstream default as well.
>>
>> What is the reason for the difference? Shared versions of LLVM would be
>> useful for reducing the size of programs linked to it and making smaller
>> filesystem images.
>
> meta-clang has only provided static compiler thus far, so using shared
> or static did not matter as much in fact it could be helping with
> faster compile
> times that we see with clang. However, there is no binding to keep it static
> link. Feel free to send a pull request to change it.

I did try this and I see a considerable slowdown in compiler speed. I changed
two things at a time so may be its the other

diff --git a/recipes-devtools/clang/clang_git.bb
b/recipes-devtools/clang/clang_git.bb
index 6c6e66a..7de2be1 100644
--- a/recipes-devtools/clang/clang_git.bb
+++ b/recipes-devtools/clang/clang_git.bb
@@ -73,7 +73,8 @@ EXTRA_OECMAKE_append_class-nativesdk = "\
                -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \
 "
 EXTRA_OECMAKE_append_class-target = "\
-               -DLLVM_ENABLE_PIC=False \
+               -DBUILD_SHARED_LIBS=ON \
+               -DLLVM_ENABLE_PIC=ON \
                -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \
                -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \
                -DLLVM_TARGETS_TO_BUILD=${@get_clang_target_arch(bb, d)} \

>
>>
>> Thanks,
>> Martin



More information about the Openembedded-core mailing list