[PATCH] D61909: Add Clang shared library with C++ exports

2019-07-11 Thread Heejin Ahn via Phabricator via cfe-commits
aheejin added a comment. `CLANG_LINK_CLANG_DYLIB=ON` does not seem to work with `LLVM_INSTALL_TOOLCHAIN_ONLY=ON`. I filed a bug report: https://bugs.llvm.org/show_bug.cgi?id=42575 Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61909/new/

Re: [PATCH] D61909: Add Clang shared library with C++ exports

2019-07-02 Thread Kim Gräsman via cfe-commits
The Clang module libraries are all called libClang[A-Z][a-zA-Z]+.{a,so}, so libclangcpp doesn't conflict with that, but I wonder if a dash would set it apart even more clearly: libclang-cpp. Or something like clang-all to show that it houses all clang modules? Bikesheds are the best sheds. -

Re: [PATCH] D61909: Add Clang shared library with C++ exports

2019-07-02 Thread Sylvestre Ledru via cfe-commits
libclangcpp ? I think it is a pretty common pattern. On debian, apt-cache search 'lib.*cpp'  returns a bunch of libraries (libhdf5-cpp, libroscpp2d, libjsonrpccpp-dev, libmysqlcppconn7v5, libsvncpp3, libtercpp0v5, libyaml-cpp-dev, etc) S Le 02/07/2019 à 01:22, Chris Bieneman a écrit : The

Re: [PATCH] D61909: Add Clang shared library with C++ exports

2019-07-01 Thread Chris Bieneman via cfe-commits
The question is, what *should* it be called. While yes, the 's' in 'so' is shared, the "dylib" and "dll" extensions on Darwin and Windows have the same meaning too. The problem is libclang.so is already taken. I'm not attached to the name in any way, so I'm open to suggestions. We do have

[PATCH] D61909: Add Clang shared library with C++ exports

2019-07-01 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment. In D61909#1563678 , @sylvestre.ledru wrote: > For now, it isn't part of the debian packaging. > > https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/blob/snapshot/debian/rules#L563 > it is removed as packaging phase as I

[PATCH] D61909: Add Clang shared library with C++ exports

2019-06-30 Thread Sylvestre Ledru via Phabricator via cfe-commits
sylvestre.ledru added a comment. For now, it isn't part of the debian packaging. https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/blob/snapshot/debian/rules#L563 it is removed as packaging phase as I have been told it isn't ready. Anyway, the lib should not keep this name. By definition, on

[PATCH] D61909: Add Clang shared library with C++ exports

2019-06-30 Thread Kim Gräsman via Phabricator via cfe-commits
kimgr added a comment. @sylvestre.ledru @beanz After this change, the Debian packaging on apt.llvm.org is basically broken. See https://bugs.llvm.org/show_bug.cgi?id=42432. I'm sure this can be fixed in packaging, but I don't know enough about it to know exactly what to do. At any rate I

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-22 Thread Sylvestre Ledru via Phabricator via cfe-commits
sylvestre.ledru added inline comments. Comment at: tools/clang-shlib/CMakeLists.txt:8 + +add_clang_library(clang_shared + SHARED can we agree on a different name? we already have licbclang which is a shared library. Maybe libclangcpp.so ?

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-21 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D61909#1510975 , @E5ten wrote: > @beanz But if libclang_shared is intended to be a shippable binary and > BUILD_SHARED_LIBS is only intended to be an option used in developer builds, > and libclang_shared while not causing

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-21 Thread Ethan Sommer via Phabricator via cfe-commits
E5ten added a comment. @beanz But if libclang_shared is intended to be a shippable binary and BUILD_SHARED_LIBS is only intended to be an option used in developer builds, and libclang_shared while not causing conflicts (thanks for the info on how that works by the way) would be redundant in a

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-21 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D61909#1510955 , @E5ten wrote: > @beanz Well I took libclang_shared as effectively an equivalent to the > libLLVM.so that's created with that dylib option, and when BUILD_SHARED_LIBS > is enabled that library is not created, in

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-21 Thread Ethan Sommer via Phabricator via cfe-commits
E5ten added a comment. @beanz Well I took libclang_shared as effectively an equivalent to the libLLVM.so that's created with that dylib option, and when BUILD_SHARED_LIBS is enabled that library is not created, in fact the option to create that library conflicts with BUILD_SHARED_LIBS. Also

Re: [PATCH] D61909: Add Clang shared library with C++ exports

2019-05-21 Thread Chris Bieneman via cfe-commits
I don't want building libclang_shared to be disabled when `BUILD_SHARED_LIBS=On`. libclang_shared fulfills a completely different purpose from `BUILD_SHARED_LIBS`. -Chris > On May 21, 2019, at 12:20 PM, Ethan Sommer via Phabricator > wrote: > > E5ten added a comment. > > @beanz Wouldn't

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-21 Thread Ethan Sommer via Phabricator via cfe-commits
E5ten added a comment. @beanz Wouldn't fixing this by adding OR BUILD_SHARED_LIBS to if(ARG_SHARED) in AddClang.cmake and to if (NOT LLVM_ENABLE_PIC) in clang-shlib/CMakeLists.txt to prevent making libclang_shared when BUILD_SHARED_LIBS is enabled make more sense? Repository: rC Clang

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-21 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. @E5ten, I just pushed r361271, which should resolve your issue. I have a better longer-term fix in mind that I'll put up for review this week. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61909/new/ https://reviews.llvm.org/D61909

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-21 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. @E5ten, I see what is going on. Give me 30 minutes and I’ll have a fix pushed. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61909/new/ https://reviews.llvm.org/D61909 ___ cfe-commits mailing

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-21 Thread Ethan Sommer via Phabricator via cfe-commits
E5ten added a comment. I might be doing something wrong but this seems to have broken BUILD_SHARED_LIBS for me in that even with that enabled clang is built as a bunch of static libraries linked into a shared one like this patch is supposed to make it do, while I thought that BUILD_SHARED_LIBS

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-18 Thread Sylvestre Ledru via Phabricator via cfe-commits
sylvestre.ledru added a comment. @beanz Great doc, thanks! I will see what I could use for Debian/Ubuntu packages (as we have a lot users and packages organized in a specific way, it isn't always easy to make huge changes) Repository: rC Clang CHANGES SINCE LAST ACTION

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-17 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. @sylvestre.ledru, I’ve added you on D62040 , which is an attempt to document best practices for generating releases. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61909/new/ https://reviews.llvm.org/D61909

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-17 Thread Sylvestre Ledru via Phabricator via cfe-commits
sylvestre.ledru added a comment. ok, it should probably be installed in that case (it is currently in usr/lib/llvm-9/lib/libclang_shared.so.9 ) by the way, the name of lib isn't super explicit :/ Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61909/new/

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-17 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. I would leave it out of any distribution (at least for now). Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61909/new/ https://reviews.llvm.org/D61909 ___ cfe-commits mailing list

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-17 Thread Sylvestre Ledru via Phabricator via cfe-commits
sylvestre.ledru added a comment. @beanz @tstellar I am wondering what to do wrt apt.llvm.org should it be part of libclang or create a libclang++ package what do you think? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61909/new/

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-16 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC360946: Add Clang shared library with C++ exports (authored by cbieneman, committed by ). Changed prior to commit: https://reviews.llvm.org/D61909?vs=199508=199912#toc Repository: rC Clang CHANGES

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-16 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. I will land this patch as-is today. I'll try and get a doc patch out for review today or tomorrow. @winksaville, I'm going to add a section to the document about building LLVM as a shared library for inclusion with tool distributions. That still shouldn't be done with

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-16 Thread Wink Saville via Phabricator via cfe-commits
winksaville added a comment. Just to be clear, I have nothing to do with any distribution except as a user (Arch Linux) so please take what I say and request with a huge grain of salt. As mentioned I have filed a bug against the clang package in Arch

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-16 Thread Tom Stellard via Phabricator via cfe-commits
tstellar accepted this revision. tstellar added a comment. This revision is now accepted and ready to land. LGTM. We can add CLANG_LINK_CLANG_DYLIB as a follow-up patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61909/new/

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-16 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D61909#1505083 , @winksaville wrote: > Please add documentation if you want people to use it :) I won't disagree that it should be documented, and I already started. I do want to point out though that your motivation starting

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-16 Thread Wink Saville via Phabricator via cfe-commits
winksaville added a comment. In D61909#1505046 , @beanz wrote: > There is a simpler example distribution configuration, but sadly there isn't > documentation. That is something I can fix. Please add documentation if you want people to use it :) In the

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-16 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. I should note, this and many more aspects of the build system were topics I discussed in a talk at the 2016 LLVM Dev meeting when we switched off autoconf: https://www.youtube.com/watch?v=StF77Cx7pz8 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-16 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. There is a simpler example distribution configuration, but sadly there isn't documentation. That is something I can fix. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61909/new/ https://reviews.llvm.org/D61909

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-16 Thread Wink Saville via Phabricator via cfe-commits
winksaville added a comment. > Distributions only get libclang_shared if they run the `install` target which > installs all of LLVM & Clang. The point of `LLVM_DISTRIBUTION_COMPONENTS` is > to allow people constructing distributions to choose which pieces they want > to install without

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-15 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D61909#1503642 , @winksaville wrote: > Sorry, maybe I didn't make myself clear. I understood you fine. I don't think you understand the guidance for building distributions of LLVM. Distributions only get libclang_shared if

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-15 Thread Wink Saville via Phabricator via cfe-commits
winksaville added a comment. In D61909#1503483 , @beanz wrote: > In D61909#1503433 , @winksaville > wrote: > > > IMHO "`BUILD_CLANG_DYLIB`" is needed. As you have it now libclang_shared.so > > is always builds on

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-15 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D61909#1503433 , @winksaville wrote: > IMHO "`BUILD_CLANG_DYLIB`" is needed. As you have it now libclang_shared.so > is always builds on UNIX systems, which I believe means that all linux > distros would have both increasing

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-15 Thread Wink Saville via Phabricator via cfe-commits
winksaville added a comment. IMHO "`BUILD_CLANG_DYLIB`" is needed. As you have it now libclang_shared.so is always builds on UNIX systems, which I believe means that all linux distros would have both increasing their sizes. I think the default should be "always" `build libclang*.a` as it is

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-15 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D61909#1502446 , @winksaville wrote: > Questions: > > - Should we only build `libclang_shared.so` if `LLVM_BUILD_LLVM_DYLIB` is ON? `LLVM_BUILD_LLVM_DYLIB` is actually not the important option to think about because it has no

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-14 Thread Wink Saville via Phabricator via cfe-commits
winksaville added a comment. Questions: - Should we only build `libclang_shared.so` if `LLVM_BUILD_LLVM_DYLIB` is ON? - Should we use link clang-9 to libclang_shared.so when `LLVM_LINK_LLVM_DYLIB` is ON? - Or maybe we should define `BUILD_CLANG_DYLIB` and `LINK_CLANG_DYLIB` or ... ?

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-14 Thread Wink Saville via Phabricator via cfe-commits
winksaville added a comment. I did some quick testing. I used cmake and ninja to build `llvm` and enabled `clang;lld;compiler-rt` subprojects: $ cd build-beanz-clang-shlib-2-add-debug-BUILD-LINK_DYNLIB-ON $ cmake ../llvm -G Ninja '-DLLVM_ENABLE_PROJECTS=clang;lld;compiler-rt'

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-14 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 199508. beanz added a comment. Changed to lowercase 'c' to match other clang libraries. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61909/new/ https://reviews.llvm.org/D61909 Files:

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-14 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. @winksaville whether or not PIC is required for shared libraries varies by platform. These days LLVM defaults to -fPIC, and I'm not sure we actually support running LLVM without -fPIC on systems that require shared libraries to be PIC. Repository: rG LLVM Github

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-14 Thread Wink Saville via Phabricator via cfe-commits
winksaville added a comment. You mention that you're using OBJECT libraries so objects aren't built mutliples times and in my current tests the number of steps increased by only 3, it went from 4353 to 4356, when using this patch, which is great! What I see in my testing of the patch is that

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-14 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment. Thanks for working on this, I have wanted something like this for a while. It would also be nice to have a CLANG_LINK_CLANG_DYLIB option like we have for llvm, but this can be a follow on patch, and I would be happy to help with this if needed.

[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-14 Thread Chris Bieneman via Phabricator via cfe-commits
beanz created this revision. beanz added reviewers: tstellar, winksaville. Herald added a subscriber: mgorny. Herald added a project: clang. This patch adds a libClang_shared library on *nix systems which exports the entire C++ API. In order to support this on Windows we should really refactor