[llvm] [BOLT] Enable cross compilation of runtime libraries (PR #101180)
Peter Waller via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 3 06:44:55 PDT 2024
Gergely =?utf-8?q?Bálint?= <gergely.balint at arm.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/101180 at github.com>
https://github.com/peterwaller-arm commented:
The changes seem somewhat reasonable to me.
However:
* I think this should gracefully degrade to the current behaviour if cross compilers are unavailable. So perhaps it is necessary to test if the cross compiler can be executed, and if not, fall back to not building the runtime for that target. That would also get the CI passing.
* I'm assuming here that it's still useful to run bolt for targets where the runtimes are not available. It just means certain functionality would be unavailable, but this could still be useful in various testing scenarios.
* I think the cross compilers should be configurable with `BOLT_RT_C_COMPILER_${tgt}` or similar. It seems reasonable for them to default to the values you have specified. I wondered if there was a general way to specify a cross compiler for a given with cmake but I didn't find one, I only so far found reference to specifying `CMAKE_C_COMPILER` and friends assuming you are only building for a single target within a given cmake invocation.
* (<thinking aloud> if clang is available, and built with the requested targets, it should be possible to use `clang -target <triple>` instead, and therefore not require the user to install a cross compiler so long as they have clang available. That said I see the runtimes use `#include <cstddef>` and friends so this is unlikely to work unless using a standard cross compiler install or a cross compiler configured to find the headers for the target, so I guess this approach is not going to be simple to make work)
Then coming to the point about CI and regular testing of this, I don't know who maintains that CI and whether they could be persuaded to install cross compilers there.
https://github.com/llvm/llvm-project/pull/101180
More information about the llvm-commits
mailing list