Closed mrk-its closed 6 months ago
This is the error coming from vanilla compiler-builtins:
LLVM ERROR: unable to legalize instruction: %37:_(s32) = G_FDIV %36:_, %31:_ (in function: _ZN17compiler_builtins5float3pow9__powisf217h041f3b35704658baE)
error: could not compile `compiler_builtins` (lib)
powisf2
appears here.
The error seems simply to be due to a missing pow()
function on the C side of things (the SDK still doesn't support floats, see https://github.com/llvm-mos/llvm-mos-sdk/issues/58)
Could this patch be achieved from Cargo.toml
?, i.e. something like the following:
[dependencies]
compiler-builtins = { git = "https://github.com/mrk-its/compiler-builtins.git }
Could this patch be achieved from Cargo.toml?, i.e. something like the following:
no, patching this way unfortunately doesn't work (at least it didn't last time I was checking, maybe something changed in the meantime)
Perhaps we could figure out how this is handled for other targets without floating point support. There are mentions of "soft-float".
llvm-mos got floats support recently: https://github.com/llvm-mos/llvm-mos/issues/10 And it looks compiler-builtins patching is no longer necessary.
We are forking compiler builtins to apply such little patch: https://github.com/mrk-its/compiler-builtins/commit/384dcad08d0e920229167eac82553046d0e1188b Cargo is forked because we need force usage of compiler-builtins fork - getting rid of it would greatly simplify releasing.
Let's investigate why compilation of these
int
andfloat
modules fail