Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data layout compile error. #169

Open
commitcompanion opened this issue Oct 1, 2024 · 6 comments
Open

Data layout compile error. #169

commitcompanion opened this issue Oct 1, 2024 · 6 comments

Comments

@commitcompanion
Copy link

Hello!
There was an error compiling kerla. Here is the debug meassage
By build with make run:
Compiling rustc-std-workspace-core v1.99.0 (/home/dev/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core) error: data-layout for targetx64-14301396534749325905, e-m:e-i64:64-f80:128-n8:16:32:64-S128, differs from LLVM target's x86_64-unknown-none-elfdefault layout,e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128`

error: could not compile rustc-std-workspace-core (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile core (lib) due to 1 previous error
error: could not compile compiler_builtins (lib) due to 1 previous error
make[1]: *** [Makefile:96: build-crate] Fehler 101
make[1]: Verzeichnis „/home/dev/workbench/kerla“ wird verlassen
make: *** [Makefile:80: build] Fehler 2
`
This error exists on many rust kernels.
https://duckduckgo.com/?q=error%3A+data-layout+for+target+%60x64-14301396534749325905%60%2C+%60e-m%3Ae-i64%3A64-f80%3A128-n8%3A16%3A32%3A64-S128%60%2C+differs+from+LLVM+target%27s+%60x86_64-unknown-none-elf%60+default+layout%2C+%60e-m%3Ae-p270%3A32%3A32-p271%3A32%3A32-p272%3A64%3A64-i64%3A64-i128%3A128-f80%3A128-n8%3A16%3A32%3A64-S128%60+&t=newext&atb=v448-6__&ia=web
There not seem to be an easy fix for that.
Thanks!

@nuta
Copy link
Owner

nuta commented Oct 2, 2024

Can you describe your build environment, such as OS version? I remember the error but don't remember how I fixed it.

@commitcompanion
Copy link
Author

Hello,
I am using arch Linux. https://wiki.archlinux.org/title/LLVM
there are many kernels with that issue.
It is possible to switch from the custom data layout to the standard:
data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
but then it crashes at this point:

error[E0635]: unknown feature stdsimd`
--> /home/dev/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ahash-0.7.6/src/lib.rs:33:42
|
33 | #![cfg_attr(feature = "stdsimd", feature(stdsimd))]
| ^^^^^^^

Compiling scroll v0.11.0
Compiling managed v0.7.2
Compiling byte order v1.4.3
For more information about this error, try rustc --explain E0635.
Compiling boot2dump v0.0.1
error: could not compile ahash (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
`

Maybe this crash is related to the different data layout?
Thanks!

@commitcompanion
Copy link
Author

Ps: the same error when build the kernel of RezOS:

Compiling lock_api v0.4.7
Compiling rustc-std-workspace-core v1.99.0 (/home/dev/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
error: data-layout for target x86_64-2915544087551329567, e-m:e-i64:64-f80:128-n8:16:32:64-S128, differs from LLVM target's x86_64-unknown-none default layout, e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128

error: could not compile rustc-std-workspace-core (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile core (lib) due to 1 previous error
error: could not compile compiler_builtins (lib) due to 1 previous error
make: *** [Makefile:102: build/kernel.x86_64.bin] Fehler 101
   ~/workbench/RezOS    master 

@nuta
Copy link
Owner

nuta commented Oct 4, 2024

It sounds like you're using an expected Rust toolchain. Did you install cargo with rustup? If so, can you share more about your build environment, such as rustc version?

@commitcompanion
Copy link
Author

commitcompanion commented Oct 4, 2024

Hello
Rust installed over the official way:
curl $installscript|sh
rustc 1.81.0 (eeb90cda1 2024-09-04)
cargo 1.81.0 (2dbb1af80 2024-08-20)
Thanks!

Edit:
rust-lang/rust#120492

@nuta
Copy link
Owner

nuta commented Oct 7, 2024

@commitcompanion Hmm version look good 👍 Can you try it in a clean environment like in a docker container?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants