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

rust-mos compilation issue #7

Closed
frehwagen opened this issue Aug 10, 2022 · 3 comments
Closed

rust-mos compilation issue #7

frehwagen opened this issue Aug 10, 2022 · 3 comments

Comments

@frehwagen
Copy link

Brilliant project, thx for it!

I'm trying to compile and use the rust-mos myself, which goes through successful as it seems but when trying to compile the hello-world project I see the following error:

`frehwagen@notebook21:~/workspace/rust-mos-hello-world$ cargo build
    Updating git repository `https://github.com/mrk-its/compiler-builtins`
    Updating crates.io index
   Compiling compiler_builtins v0.1.75 (https://github.com/mrk-its/compiler-builtins?tag=0.1.75-mos#829c47e6)
   Compiling proc-macro2 v1.0.43
   Compiling core v0.0.0 (/home/frehwagen/workspace/rust-mos/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/core)
   Compiling unicode-ident v1.0.3
   Compiling quote v1.0.21
   Compiling syn v1.0.99
   Compiling proc-macro-hack v0.5.19
   Compiling libc v0.2.127
   Compiling rustc-std-workspace-core v1.99.0 (/home/frehwagen/workspace/rust-mos/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/home/frehwagen/workspace/rust-mos/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/alloc)
rustc: /home/frehwagen/workspace/llvm-mos/llvm/lib/CodeGen/MachineFunction.cpp:230: void llvm::MachineFunction::init(): Assertion `Target.isCompatibleDataLayout(getDataLayout()) && "Can't create a MachineFunction using a Module with a " "Target-incompatible DataLayout attached\n"' failed.
error: could not compile `compiler_builtins`

Caused by:
  process didn't exit successfully: `rustc --crate-name compiler_builtins /home/frehwagen/.cargo/git/checkouts/compiler-builtins-6e48e97653cc45c3/829c47e/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C linker-plugin-lto -C codegen-units=1 -C debuginfo=2 -C debug-assertions=on --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="rustc-dep-of-std"' -C metadata=0141bbeb1e689156 -C extra-filename=-0141bbeb1e689156 --out-dir /home/frehwagen/workspace/rust-mos-hello-world/target/mos-sim-none/debug/deps --target mos-sim-none -Z force-unstable-if-unmarked -L dependency=/home/frehwagen/workspace/rust-mos-hello-world/target/mos-sim-none/debug/deps -L dependency=/home/frehwagen/workspace/rust-mos-hello-world/target/debug/deps --extern core=/home/frehwagen/workspace/rust-mos-hello-world/target/mos-sim-none/debug/deps/librustc_std_workspace_core-38f3135ada7400b9.rmeta --cap-lints allow --cfg 'feature="unstable"' --cfg 'feature="mem"'` (signal: 6, SIGABRT: process abort signal)
warning: build failed, waiting for other jobs to finish...
frehwagen@notebook21:~/workspace/rust-mos-hello-world$`

I'm using the latest available llvm-mos and llvm-mos-sdk from the source repo.

Any idea what is going wrong?

@mrk-its
Copy link
Owner

mrk-its commented Oct 15, 2022

Could you try again? I updated rust-mos recently and it should work with current llvm-mos now

@p2mate
Copy link

p2mate commented Oct 16, 2022

this works indeed. I still ran into #2 but I figured out what goes wrong there. Problem is that the default installation path for the target descriptions is /usr/local/rust-mos-targets/ which is only writeable by root. However I don't have rustup or rust installed as root so sudo ./create_mos_targets.py won't work because it will run rustc to get the target description. I worked around this by temporarily allowing my user to write to /usr/local/rust-mos-targets/, but probably there are better solutions.

@U007D
Copy link

U007D commented Oct 28, 2022

Thank you for the write-up @p2mate. Unfortunately for me, I have given my user permission to write as well, yet issue #2 still persists for me.

@mrk-its mrk-its closed this as completed Jan 5, 2023
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

4 participants