What | Removed | Added |
---|---|---|
Status | NEW | IN_PROGRESS |
Assignee | mardnh@gmx.de | msrb@suse.com |
Ok, updating pocl to libLLVM5 did solve my initial issue, but that was different issue than the one you are seeing. After I installed both pocl and beignet packages, I can see the same error as you: "Option 'enable-value-profiling' registered more than once!" The 'enable-value-profiling' is option from clang, specifically from the CodeGen component. It is registered in a constructor of a static variable in clang. It registers itself by calling a llvm function which stores it into a map that is also stored in a static variable in the llvm library. The issue here is that both pocl and beignet are linked with static libclangCodeGen.a and both link dynamically with libLLVM.so. So each of them has their own copy of clang's CodeGen. They both try to register the same option during initialization and end up saving it into the same map in the shared llvm library. The second attempt to register it fails. Compiling all clang and llvm libraries as static would be a solution, true. Similarly compiling them all as dynamic libraries would work too, but originally I thought we can not do that because using BUILD_SHARED_LIBS=ON is not supported and buggy and LLVM_LINK_LLVM_DYLIB=ON does not work with libclang. I've checked what other distributions do and I would like to try Fedora's approach: Combine it and build clang with BUILD_SHARED_LIBS=ON and everything else LLVM_LINK_LLVM_DYLIB=ON. That way we hopefully 1) solve this bug 2) avoid the bugs that BUILD_SHARED_LIBS=ON was causing 3) avoid building huge amount of static libraries. Martin, since pocl seems to be fine and this is a llvm issue, I am reassigning it to myself.