Skip to content
This repository was archived by the owner on Apr 5, 2021. It is now read-only.

Commit cf81c36

Browse files
committed
Add data layout to target specification
The data layout had become optional at some point. Some time after that, it started causing a compiler error, so I removed it. From the Rust side, those changes are documented in the following issue: rust-lang/rust#31367 This is the pull request that made the data layout non-optional again, is this one: rust-lang/rust#32939 I took the layout I added here from the Rust compiler code. The various built-in ARM targets seem to have mostly[1] the same target layout, which makes sense, as the target layout describes mostly hardware characteristics that shouldn't change between operation systems. The layout I copied is from the `arm-unknown-linux-gnueabi` target, here: https://github.com/rust-lang/rust/blob/253b7c1e1a919a6b722c29a04241d6f08ff8c79a/src/librustc_back/target/arm_unknown_linux_gnueabi.rs#L19 I double-checked with the LLVM documentation on data layouts, and everything seems legit, as far as I can tell. I don't completely understand everything about it, though, so I can't give a 100% guarantee. The LLVM documentation on data layouts is located here: http://llvm.org/docs/LangRef.html#data-layout In any case, the program compiles and works fine with the new layout, so I'm assuming it's correct. [1] "Mostly", because the one exception I see is the name mangline option ("m:"), which I set to "e", meaning "ELF". This doesn't seem terribly relevant. The only case, that I can think of, that might make it relevant is if we had C code calling into our Rust code, but then we would mark the called Rust functions as "#[no_mangle]" anyway.
1 parent acc3b04 commit cf81c36

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

blink/target.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"llvm-target" : "thumbv7m-unknown-none-eabi",
3+
"data-layout" : "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
34
"linker" : "arm-none-eabi-gcc",
45
"pre-link-args" : [ "-nostartfiles", "-Tlinker-script.ld" ],
56
"post-link-args" : [ "-l:libsam_sam3x8e_gcc_rel.a" ],

0 commit comments

Comments
 (0)