rust-lang / rust-lang/rustc_codegen_gcc

Building Rustc on m68k

Open
#744 41 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.2k
Forks
105
Avg merge
8h 20m
Merged PRs (30d)
14

Description

I am currently working on building rustc for m68k(since that seems like a more achievable short-term goal). Many of the roadblocks I'll hit on m68k will also likely be shared with other targets - this issue could server as a reference for that.

Here is a list of currently-known issues:

  • - linux-raw-sys does not support m68k. This crate is needed by rustc, and a lot of other crates. Proper support will require a moderate amount of work, but it something that can be done now.

  • - The rustix crate does not support m68k. (more specifically, the iocl::const module needs the right values for syscall arguments).

  • - The const assert in https://github.com/rust-lang/rust/blob/ce5fdd7d42aba9a2925692e11af2bd39cf37798a/compiler/rustc_data_structures/src/tagged_ptr.rs#L163 fails. EDIT: the problem is the alignment of usize. Rust uses those bits to store type tags. If the aligement is less than 4, this fails. I have a fix ready to be sent & merged.

  • - The bootstrap script fails to compile native GCC for m68k. This prevents it from building any codegen backends or tools later down the line. This is skipable with some fiddling.

  • - When building other tools(eg. cargo) the bootstrap script "forgets" where the std for m68k is.

So, as of toady, with some workarounds, I can get pretty far into the cross-compilation process - a bit more work, and we may be able to get rustc running on m68k.

@glaubitz I think this issue might be of interest to you.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the listed m68k blockers: linux-raw-sys, rustix, compiler/rustc_data_structures/src/tagged_ptr.rs, and the bootstrap script. Check the current status of the tagged_ptr alignment fix and the m68k support gaps, then reproduce the bootstrap failures. Done means rustc and its tools can be built for m68k without the listed workarounds.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.