-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support cross-compiling when using Bazel platforms #869
Comments
It’s strange that cross compiling doesn’t work for you; I can cross compile the |
@jheaff1 that's not a good example, because zlib's build doesn't depend on the target platform detection (i.e. the same C source files are compiled on all the platforms, see: madler/zlib's CMakeLists.txt). Try anything that depends on |
Ah I see. Perhaps once this issue is resolved, the CI of this repo should utilise the zig toolchain to cross compile libjpeg_turbo, which relies on |
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_foreign_cc! |
Bump, since still open and useful. Related: #289 |
There seems to have an issue when This seems to be related with bazelbuild/bazel#8438 (comment) |
@CareF https://github.com/aspect-build/gcc-toolchain/blob/main/toolchain/wrapper.sh.tpl |
Bazel has a decent support for building for a different target platforms (CPU/OS), but it's missing official toolchains to make it really easy for the end users to cross-compile.
Luckily for us, one such toolchain recently appeared: bazel-zig-cc (using
zig cc
/zig c++
drop-in replacement for GCC/Clang).When cross-compiling for a different target (e.g. using
--platforms @zig_sdk//:linux_aarch64_platform
), which sets appropriate@platforms
constraints, most of the Bazel rules "just work", however rules usingcmake()
are building for the host platform, since none of the standard cross-compiling CMake variables are set byrules_foreign_cc
:The text was updated successfully, but these errors were encountered: