Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCustom target: data-layout changed #31367
Comments
This comment has been minimized.
This comment has been minimized.
|
This might be related to how LLVM was upgraded recently? |
steveklabnik
added
the
A-LLVM
label
Feb 2, 2016
This comment has been minimized.
This comment has been minimized.
|
This also happend to me on travis where LLVM is in version 3.4. https://travis-ci.org/dpc/titanos/jobs/106659993 when compiling for ARMv8 aarch64 target. It works (well, fails but in unrelated way) on my local machine where llvm is in version 3.7. Removing data-layout also helped. Is it OK to skip this line? |
This comment has been minimized.
This comment has been minimized.
|
I'm seeing this issue as well, with JSON targets for x86_64 that use a datalayout copied from rustc's x86_64-unknown-linux-gnu target. The LLVM assert does not trigger on the same code when using the built-in linux target. Trying some nightlies, I still see this crash with the build from January 30 (303892e) and all subsequent ones. Testing further back will require downgrading the copy of libcore I'm building. Removing datalayout from the target specification prevents the failure, but it's not clear to me what the implications of that are; either rustc or LLVM is quietly choosing a default, where if it's the former everything should be fine and if it's the latter there's a chance of hard-to-debug miscompilation. |
ryanbreen
added a commit
to ryanbreen/breenix
that referenced
this issue
Feb 19, 2016
hannobraun
pushed a commit
to hannobraun/embedded
that referenced
this issue
Feb 19, 2016
rasendubi
added a commit
to rasendubi/bkernel
that referenced
this issue
Feb 20, 2016
silven
added a commit
to silven/armstrong
that referenced
this issue
Feb 22, 2016
phil-opp
referenced this issue
Mar 20, 2016
Merged
docs: The `data-layout` field is no longer required in custom targets #32375
bors
added a commit
that referenced
this issue
Mar 20, 2016
This comment has been minimized.
This comment has been minimized.
thejpster
commented
Apr 22, 2016
|
So I tried 1.10.0-nightly (b5ba592 2016-04-21) with my bare metal ARM project and it says it "failed to run rustc to learn about target-specific information". In verbose mode it complained that "Field data-layout in target specification is required". Oh, well, I'll put it back in then. But if you put it back in, you still get this issue. I note the O/Ps Travis build is also broken, so it's probably not just me. |
This comment has been minimized.
This comment has been minimized.
|
The data-layout field was made manditory again in #32939. The correct values for the built-in target triples can be found in the commit diff. The field layout is specified in the LLVM documentation.
Thanks for the hint :). |
This comment has been minimized.
This comment has been minimized.
|
FWIW, I have found two ways to make llvm generate a (seemingly) correct data layout for you: Using
|
phil-opp
added a commit
to phil-opp/nightly-libcore
that referenced
this issue
Apr 22, 2016
This comment has been minimized.
This comment has been minimized.
thejpster
commented
Apr 23, 2016
|
I tried the clang method with clang-3.5, but the value it produced did not work. On a whim, I added a:0:32 and then it compiled OK. Haven't actually tested the binary though. |
This comment has been minimized.
This comment has been minimized.
You can use stable as well, I guess:
|
hannobraun
pushed a commit
to hannobraun/embedded
that referenced
this issue
Apr 26, 2016
thejpster
pushed a commit
to thejpster/stellaris-launchpad
that referenced
this issue
Apr 26, 2016
jgallag88
referenced this issue
May 8, 2016
Closed
Compiler panics when 'data-layout' field is missing in LLVM target json #33497
hawkw
added a commit
to sos-os/kernel
that referenced
this issue
May 29, 2016
This comment has been minimized.
This comment has been minimized.
|
Is there something in particular that is left to do here? I can't quite see any "bug" in this issue, though it would be great to document what @japaric says about getting a seemingly correct data layout somewhere. |
Mark-Simulacrum
added
the
T-doc
label
Jun 22, 2017
Mark-Simulacrum
added
the
C-enhancement
label
Jul 24, 2017
This comment has been minimized.
This comment has been minimized.
|
AFAIK there's not much left to do here, so closing. |
phil-opp commentedFeb 2, 2016
I use a custom target file to build code for ARM. I copied the file from somewhere and it worked without problems. But now, after an update to the latest nightly, the build fails with a strange LLVM error:
I don't understand any of this but it seems like the data-layout is suddently “Target-incompatible”. My target json looks like this:
Removing the
data-layoutline fixes it and everything works again. So I think this issue is already solved :). I opened it anyway as I wasn't sure if this was intended (and maybe it helps someone).If someone wants to investigate: The travis builds for nightly libcore started failing on
rustc 1.8.0-nightly (9a07087bc 2016-01-30).