[llvm] [BOLT] Enable standalone build (PR #97130)

Rafael Auler via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 14:08:59 PDT 2024


rafaelauler wrote:

Thanks for the context @h-vetinari . I got enough to be able to create my test, and it works nicely, thanks for your work @RossComputerGuy 

In my test, I:
1. Build LLVM once in a separate build folder, say `$build_llvm_dir`.
2. Build BOLT standalone by invoking cmake directly on `llvm-project/bolt`, and specifying the cmake variables `-DLLVM_BUILD_MAIN_SRC_DIR=$build_llvm_dir/lib/cmake/llvm -DLLVM_DIR=$build_llvm_dir/lib/cmake/llvm`

Then I run "`ninja install`" and it installs BOLT appropriately.

The only remaining concern I have then is that I don't think the `add_compile_definitions(CMAKE_INSTALL_FULL_LIBDIR="${CMAKE_INSTALL_FULL_LIBDIR}") `line and "`getLibPathByInstalled()`" actually works. In my local run, cmake was resolving that to `/lib64`, and because we call `root_path`, we would actually treat that as just "`/`" and essentially lose the cmake installation dir. But other than that, this patch looks good.

https://github.com/llvm/llvm-project/pull/97130


More information about the llvm-commits mailing list