24-bit Custom Target

85 Views Asked by At

I'm trying to compile for a custom target that has a 24-bit pointer (the eZ80). I'm now stuck wondering if that's even possible in the current Rust toolchain?

I tried creating a custom target file with "data-layout" set to "e-m:z-p:24:8-p1:16:8-p2:8:8-p3:16:8-p4:24:8-i16:8-i24:8-i32:8-i48:8-i64:8-i96:8-f32:8-f64:8-a:8-n8:16:24-S8" and "target-pointer-width" set to "24", but rustc errors with error: target specification was invalid: unrecognized target-pointer-width 24. Sticking to the possible pointer widths of 16, 32, and 64, I went with 32 since that's closest, but this fails with error: inconsistent target specification: "data-layout" claims pointers are 24-bit, while "target-pointer-width" is '32'.

I'm not quite sure how to resolve this, since compiling with 32-bit pointers leads to some weird linker errors with "index half registers".

0

There are 0 best solutions below