Please do not merge this patch.
I'd like some feedback on the solution I adopted here.
This patch changes fundamentally how bolt is built.
Problem: Bolt does not support standalone builds and depends heavily on
internal LLVM headers and object files.
Previously, all the required headers were getting copied and the rest of
the code except bolt was removed.
This solution has the advantage of reducing the amount of objects being
built, but increases the effort humans have to spent when updating the
source code whenever bolt adds a new dependency.
Instead of removing the source code, this patch tries to follow a closer
approach that is supported by bolt and only removes the cmake
entries leading to unnecessary libraries being built via the patch
rm-llvm-libs.diff. This solution increases build time, but may not
require any modifications in future updates.
If bolt starts depending on any of the removed libraries, the patch must
be updated. The removal of new libraries is not required, but it's
recommended in order to keep build time as low as possible.
For the record, after applying this patch, an Intel(R) Core(TM)
i7-11850H built bolt in ~26 minutes.