3 ms·
Usually compilers default to the ISA they were built on. In the case of Clang this is controlled by LLVM_DEFAULT_TARGET_TRIPLE cmake option - maybe a weird mix
by vient 3y ago
Usually compilers default to the ISA they were built on. In the case of Clang this is controlled by LLVM_DEFAULT_TARGET_TRIPLE cmake option - maybe a weird mix of options occurred where Clang for armv6 was built on armv7 but the default triple was not adjusted correctly.
Current docs about this option:
> LLVM target to use for code generation when no target is explicitly specified. It defaults to “host”, meaning that it shall pick the architecture of the machine where LLVM is being built. If you are building a cross-compiler, set it to the target triple of your desired architecture.
- ajb 3y agoYes this could very well be a packaging/build error of clang, rather than a code bug. It's quite usual to cross compile for pi1 because it's so slow to build on it.
- westurner 3y agoraspberrypi.com/documentation/computers/linux_kernel.html#cross-compiling-the-kernel: https://www.raspberrypi.com/documentation/computers/linux_kernel.html#cross-compiling-the-kernel https://www.raspberrypi.com/documentation/computers/linux_ke... 89luca89/distrobox: https://github.com/89luca89/distrobox https://github.com/89luca89/distrobox #quick-start 89luca89/distrobox/blob/main/docs/useful_tips.md#using-a-different-architecture: https://github.com/89luca89/distrobox/blob/main/docs/useful_tips.md#using-a-different-architecture https://github.com/89luca89/distrobox/blob/main/docs/useful_... lukechilds/dockerpi: https://github.com/lukechilds/dockerpi https://github.com/lukechilds/dockerpi : RPi 1, (2,3,) in QEMU emulating ARM64 on x86_64 E.g. the Fedora Silverblue rpm-ostree distro has "toolbox" by default because most everything should be in a container containers/toolbox: https://github.com/containers/toolbox https://github.com/containers/toolbox From https://containertoolbx.org/distros/ https://containertoolbx.org/distros/ : > Distro support: By default, Toolbx creates the container using an OCI image called `<ID>-toolbox:<VERSION-ID>`, where <ID> and <VERSION-ID> are taken from the host’s `/usr/lib/os-release`. For example, the default image on a Fedora 36 host would be `fedora-toolbox:36`. > This default can be overridden by the `--image` option in `toolbox create`, but operating system distributors should provide an adequately configured default image to ensure a smooth user experience. The compiler arch flags might should be correctly specified in a "toolbox" container used for cross-compilation, too. There are default gcc and/or clang compiler flags in distros' default build tools; e.g. `make` specifies additional default compiler flags (that e.g. cmake, ninja, gn, or bazel/buck/pants may not also specify for you).