[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-15 Thread Wink Saville via Phabricator via cfe-commits
winksaville abandoned this revision. winksaville added a comment. Abandoning, @beanz has proposed a better solution, D61909 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61804/new/ https://reviews.llvm.org/D61804

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-14 Thread Wink Saville via Phabricator via cfe-commits
winksaville added a comment. Sorry, the two previous comments were meant for D61909 and I've moved them. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61804/new/ https://reviews.llvm.org/D61804

[PATCH] D61804: Support building shared and static libraries simultaneously

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 ... ? Repository

[PATCH] D61804: Support building shared and static libraries simultaneously

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' -DCMAKE_INSTA

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-14 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. @winksaville that was my bad. I left off the new files in the commit because I forgot `git-diff` doesn't grab untracked files... I've uploaded the patch as a D61909 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION http

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-13 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. @winksaville I asked why on Arch Linux, extra/clang is built with `-DBUILD_SHARED_LIBS=ON` while extra/llvm extra/lldb are built with `-DBUILD_SHARED_LIBS=ON` https://bugs.archlinux.org/task/60512 . I think `extra/clang` is just not suitable for development. If you real

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-13 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment. > ! In D61804#149 , @beanz wrote: > I apologize that I missed your thread on the dev list, because that would > have been a much better place to have this conversation. Having gone back and > read it now, it sounds to me lik

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-13 Thread Wink Saville via Phabricator via cfe-commits
winksaville added a comment. @beanz I found what I think is the reason libclang_shared.so isn't being created. I added a bunch of debug output using `message` to add_llvm_subdirectory: 1041 function(add_llvm_subdirectory project type name) 1042message(STATUS "add_llvm_subdirectory ${pr

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-13 Thread Wink Saville via Phabricator via cfe-commits
winksaville added a comment. In D61804#1500445 , @winksaville wrote: > In D61804#1500409 , @beanz wrote: > > > My change should not have decreased build time from trunk, nor should it > > have reduced the number of

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-13 Thread Wink Saville via Phabricator via cfe-commits
winksaville added a comment. In D61804#1500409 , @beanz wrote: > My change should not have decreased build time from trunk, nor should it have > reduced the number of build steps. That patch should generate > lib/libClang_shared.so, which will export the

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-13 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. My change should not have decreased build time from trunk, nor should it have reduced the number of build steps. That patch should generate lib/libClang_shared.so, which will export the C++ API. libClang is unchanged since changing it would break existing clients of the l

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-13 Thread Wink Saville via Phabricator via cfe-commits
winksaville added a comment. > Arch Linux is in an unsupported state, and your patch isn't the way forward. OK, I'll filed a bug, https://bugs.archlinux.org/task/62624 > Let's rewind. > > Why do "some people like shared libraries"? There are usually two reasons > people cite for linking shared

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-13 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D61804#1499275 , @winksaville wrote: > When you say you don't think the build system should do this, what do you > mean? `llvm_add_library` supports both, because there are places where we consciously choose to build both. Tha

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-13 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment. Not sure if this would be relevant for your use case, but it would be really nice to have a libCLANG.so with all the C++ symbols, like we do for llvm. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61804/new/ https://revie

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-12 Thread Wink Saville via Phabricator via cfe-commits
winksaville updated this revision to Diff 199172. winksaville added a comment. Change default to be CLANG_ENABLE_STATIC_LIBRARIES=ON CLANG_ENABLE_SHARED_LIBRARIeS=OFF Suggested by @beanz Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61804/new/ ht

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-12 Thread Wink Saville via Phabricator via cfe-commits
winksaville marked an inline comment as done. winksaville added a comment. In D61804#1499267 , @beanz wrote: > As an additional note, Arch linux should not be building clang with > `BUILD_SHARED_LIBS` nor should it be distributing those ,so files. That is

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-12 Thread Wink Saville via Phabricator via cfe-commits
winksaville added a comment. In D61804#1499259 , @beanz wrote: > I question the general utility of this patch, and I don't really think this > does anything we want the build system doing. When you say you don't think the build system should do this, wh

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-12 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. As an additional note, Arch linux should not be building clang with `BUILD_SHARED_LIBS` nor should it be distributing those ,so files. That isn't a supported configuration for Clang deployment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://re

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-12 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. I question the general utility of this patch, and I don't really think this does anything we want the build system doing. If you specify `STATIC` and `SHARED` to `llvm_add_library` it creates the shared library target as the one that everything links against, which is ex

[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-10 Thread Wink Saville via Phabricator via cfe-commits
winksaville created this revision. winksaville added reviewers: tstellar, morehouse, gottesmm, chapuni. Herald added subscribers: llvm-commits, cfe-commits, mgorny. Herald added projects: clang, LLVM. I ran into the need for both while trying to compile zig (https://ziglang.org) on my Arch Linux s