bytecodealliance / bytecodealliance/rustix

Please add architecture support for m68k

Aperta
#1,626 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
2.1k
Fork
294
Merge medio
6g 22h
PR unite (30g)
4

Descrizione

Trying to build `rustix` on m68k fails with:

```
error[E0432]: unresolved import `consts`
--> /rust/deps/rustix-1.1.4/src/ioctl/linux.rs:4:5
|
4 | use consts::*;
| ^^^^^^ use of unresolved module or unlinked crate `consts`
|
= help: if you wanted to use a crate named `consts`, use `cargo add consts` to add it to your `Cargo.toml`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `rustix` (lib) due to 1 previous error
```

This seems to be caused by `rustix` missing m68k support. The following minimal change fixes this, although I'm pretty sure it's incomplete:

```rust
diff --git a/src/ioctl/linux.rs b/src/ioctl/linux.rs
index 8d96a1b2..0f228f00 100644
--- a/src/ioctl/linux.rs
+++ b/src/ioctl/linux.rs
@@ -68,6 +68,7 @@ mod consts {
target_arch = "mips32r6",
target_arch = "mips64",
target_arch = "mips64r6",
+ target_arch = "m68k",
target_arch = "powerpc",
target_arch = "powerpc64",
target_arch = "sparc",
```

This issue was first reported in the M680x0 issue tracker [here](https://github.com/M680x0/issues/issues/11).

Please note that being able to build `rustix` for m68k still requires additional patches to LLVM and `rustc`. See the status report [here](https://lists.debian.org/debian-68k/2026/04/msg00003.html).

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia in src/ioctl/linux.rs, dove sono definiti l’import consts non risolto e le condizioni target_arch esistenti. Confronta il caso m68k con le architetture elencate e verifica se altro codice rustix specifico per l’architettura necessita di supporto. Il lavoro è completato quando il problema di build di rustix relativo a m68k è stato risolto, tenendo presente che per una build completa sono necessarie anche patch per LLVM e rustc.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
operating-systems
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
55/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.