4 ms·
Yeah the cross-compilation thing is definitely a rough spot. I have one project that's able to work around it via extensive hacks with macros, but at some point
by colatkinson 4y ago
Yeah the cross-compilation thing is definitely a rough spot. I have one project that's able to work around it via extensive hacks with macros, but at some point I'll need to do it "the right way."
Honestly if the docs had a canonical example of e.g. using unix_cc_toolchain_config (example: [0]) + Bootlin to compile for aarch64, it'd probably go a long way to making things understandable. Because say what you will about the old CROSSTOOL approach, at least there was a nice tutorial for it.
[0] https://github.com/grailbio/bazel-toolchain/blob/f14a8a5de8f7e98a011a52163d4855572c07a1a3/toolchain/cc_toolchain_config.bzl#L336 https://github.com/grailbio/bazel-toolchain/blob/f14a8a5de8f...
- kldx 4y agoHave you come across https://github.com/aspect-build/gcc-toolchain https://github.com/aspect-build/gcc-toolchain? I use it as a starting point for my toolchains.
- colatkinson 4y agoWoah I hadn't. Looks super useful, thanks!
- elteto 4y agoMy normal workflow to bootstrap cross-compilation with bazel is to create a dummy project with some dummy C/C++ file and build it. Then go into whatever bazel-X internal folder and extract the autogenerated bzl for the local system’s compiler. Then update it with my toolchain and strip it down (I hate the “features” feature) until it is somewhat understandable. This is a _terrible_ DX.
- klodolph 4y agoYeah, that's the same way I do it.