|
| 1 | +# m68k-unknown-linux-gnu |
| 2 | + |
| 3 | +**Tier: 3** |
| 4 | + |
| 5 | +Motorola 680x0 Linux |
| 6 | + |
| 7 | +## Designated Developers |
| 8 | + |
| 9 | +* [@glaubitz](https://github.com/glaubitz) |
| 10 | +* [@ricky26](https://github.com/ricky26) |
| 11 | + |
| 12 | +## Requirements |
| 13 | + |
| 14 | +This target requires a Linux/m68k build environment for cross-compilation which |
| 15 | +is available on Debian and Debian-based systems, openSUSE and other distributions. |
| 16 | + |
| 17 | +On Debian, it should be sufficient to install a g++ cross-compiler for the m68k |
| 18 | +architecture which will automatically pull in additional dependencies such as |
| 19 | +the glibc cross development package: |
| 20 | + |
| 21 | +```text |
| 22 | +# apt install g++-m68k-linux-gnu |
| 23 | +``` |
| 24 | + |
| 25 | +Binaries can be run using QEMU user emulation. On Debian-based systems, it should be |
| 26 | +sufficient to install the package `qemu-user-static` to be able to run simple static |
| 27 | +binaries: |
| 28 | + |
| 29 | +```text |
| 30 | +# apt install qemu-user-static |
| 31 | +``` |
| 32 | + |
| 33 | +To run more complex programs, it will be necessary to set up a Debian/m68k chroot with |
| 34 | +the help of the command `debootstrap`: |
| 35 | + |
| 36 | +```text |
| 37 | +# apt install debootstrap debian-ports-archive-keyring |
| 38 | +# debootstrap --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg --arch=m68k unstable debian-68k http://ftp.ports.debian.org/debian-ports |
| 39 | +``` |
| 40 | + |
| 41 | +This chroot can then seamlessly entered using the normal `chroot` command thanks to |
| 42 | +QEMU user emulation: |
| 43 | + |
| 44 | +```text |
| 45 | +# chroot /path/to/debian-68k |
| 46 | +``` |
| 47 | + |
| 48 | +To get started with native builds, which are currently untested, a native Debian/m68k |
| 49 | +system can be installed either on real hardware such as 68k-based Commodore Amiga or |
| 50 | +Atari systems or emulated environments such as QEMU version 4.2 or newer or ARAnyM. |
| 51 | + |
| 52 | +ISO images for installation are provided by the Debian Ports team and can be obtained |
| 53 | +from the Debian CD image server available at: |
| 54 | + |
| 55 | +[https://cdimage.debian.org/cdimage/ports/current](https://cdimage.debian.org/cdimage/ports/current/) |
| 56 | + |
| 57 | +Documentation for Debian/m68k is available on the Debian Wiki at: |
| 58 | + |
| 59 | +[https://wiki.debian.org/M68k](https://wiki.debian.org/M68k) |
| 60 | + |
| 61 | +Support is available either through the `debian-68k` mailing list: |
| 62 | + |
| 63 | +[https://lists.debian.org/debian-68k/](https://lists.debian.org/debian-68k/) |
| 64 | + |
| 65 | +or the `#debian-68k` IRC channel on OFTC network. |
| 66 | + |
| 67 | +## Building |
| 68 | + |
| 69 | +The codegen for this target should be built by default. However, core and std |
| 70 | +are currently missing but are being worked on and should become available in |
| 71 | +the near future. |
| 72 | + |
| 73 | +## Cross-compilation |
| 74 | + |
| 75 | +This target can be cross-compiled from a standard Debian or Debian-based, openSUSE or any |
| 76 | +other distribution which has a basic m68k cross-toolchain available. |
| 77 | + |
| 78 | +## Testing |
| 79 | + |
| 80 | +Currently there is no support to run the rustc test suite for this target. |
| 81 | + |
| 82 | +## Building Rust programs |
| 83 | + |
| 84 | +Rust programs can be built for that target: |
| 85 | + |
| 86 | +```text |
| 87 | +rustc --target m68k-unknown-linux-gnu your-code.rs |
| 88 | +``` |
| 89 | + |
| 90 | +Very simple progams can be run using the `qemu-m68k-static` program: |
| 91 | + |
| 92 | +```text |
| 93 | +$ qemu-m68k-static your-code |
| 94 | +``` |
| 95 | + |
| 96 | +For more complex applications, a chroot or native (emulated) Debian/m68k system are required |
| 97 | +for testing. |
0 commit comments