LLVM & Co have one trouble for source based linux distributions like gentoo
For building LLVM we just build LLVM.
But for building Clang we must again build LLVM, and then build Clang.
This'is not such big problem, if we're talking about these two package.
But even now if we want build debug versions, these rebuilding take pretty long time
And now if we want build subproject of LLVM like LLDB we must again build LLVM, and then build Clang, and now we can build LLDB.
Size of the folder which was used to build LLVM + Compiler_RT + Clang + LLDB + Test-Suite in debug configuration equals to:
$ du -hs build
Who want to rebuild all it every time when need change USE flags?
Except LLDB still have Clang-Tools-Extra. and other subproject like Compiler_RT and may be more in future
Now for build clang must:
1) build LLVM two time
2) build Clang
if want build LLDB: LLVM 3 time, Clang two time
if make a separate package for compiller rt:
LLVM 4 time, Compiler RT 3 time and Clang 2 time
Sorry for my English.
Steps to Reproduce:
1. USE=debug emerge clang
2. go to drink coffee
Several possible solutions to the problem:
1) use one big ebuild "llvm-pack" and with USE flags choose what part of LLVM project need to build. this is not solve problem of rebuild all LLVM projects, but now this process happens every time we rebuild the Clang.
2) install the source files in /usr/src/llvm configure and builds there, and if need new llvm package, install them in subfolder of LLVM build system and rerun make without reconfiguration
3) may be other solutions to the problem?
Don't we actually use installed llvm in clang build? I think we did but something may have changed in the meantime.
*** Bug 426808 has been marked as a duplicate of this bug. ***
I have committed a testing version of joined ebuild in ::mgorny. I'd appreciate some testing of it since I'm low on time and resources, and I haven't even tried building with USE=-clang.
I'll be happy to commit it and backport the change to older version(s) as soon as I get some test confirmations and voyageur's approval.
For me, builddir/tools/clang didn't have a Makefile so make failed. I fixed it by changing the line 'emake -C tools/clang' to 'emake clang-only'
I'll try to add support for lldb.
Created attachment 354028 [details]
llvm cmake ebuilds & patches
Switched to cmake and added lldb and lld. NOT TESTED!
(In reply to Hristo Venev from comment #5)
> Created attachment 354028 [details]
> llvm cmake ebuilds & patches
> Switched to cmake and added lldb and lld. NOT TESTED!
See bug 456322 and related bugs :).
Basically fixed in -3.3-r1 and -9999 but may need readdressing at a wider scope.