• Re: First successful cargo build - Re: Summary on what's blocking full

    From John Paul Adrian Glaubitz@3:633/10 to All on Wednesday, May 20, 2026 13:30:01
    Subject: Re: First successful cargo build - Re: Summary on what's blocking full Rust support on m68k

    Hi Jeff,

    On Wed, 2026-05-20 at 07:08 -0400, Jeffrey Walton wrote:
    I was eventually able to build cargo for m68k-unknown-linux-gnu:

    (unstable-amd64-sbuild)glaubitz@esk:~/rust/build$ file ./x86_64-unknown
    -linux-gnu/stage2-tools/m68k-unknown-linux-gnu/release/cargo
    ./x86_64-unknown-linux-gnu/stage2-tools/m68k-unknown-linux-gnu/release/
    cargo: ELF 32-bit MSB pie executable, Motorola m68k, 68020, version 1 (SYSV
    ), dynamically linked, interpreter /lib/ld.so.1,
    BuildID[sha1]=7e5bf08930f87b9eaee173cf163b067f620cb841, for GNU/Linux
    3.2.0, not stripped
    (unstable-amd64-sbuild)glaubitz@esk:~/rust/build$

    The binary runs on m68k but there is no output, unfortunately. Needs mo
    re debugging.

    Congratulations!

    Thanks!

    I'm still not convinced Rust can take over the world. It has too many
    poorly supported architectures and platforms, including m68k. Confer, <https://doc.rust-lang.org/nightly/rustc/platform-support.html>.

    Luckily, there are projects like gccrs and rustc-codegen-gcc which are aimi
    ng to change that.

    Adrian

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer
    `. `' Physicist
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    --- PyGate Linux v1.5.14
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From John Paul Adrian Glaubitz@3:633/10 to All on Sunday, June 07, 2026 11:10:01
    Subject: Re: First successful cargo build - Re: Summary on what's blocking full Rust support on m68k

    Hi,

    On Wed, 2026-05-20 at 10:36 +0200, John Paul Adrian Glaubitz wrote:
    I was eventually able to build cargo for m68k-unknown-linux-gnu:

    (unstable-amd64-sbuild)glaubitz@esk:~/rust/build$ file ./x86_64-unknown-l
    inux-gnu/stage2-tools/m68k-unknown-linux-gnu/release/cargo
    ./x86_64-unknown-linux-gnu/stage2-tools/m68k-unknown-linux-gnu/release/ca
    rgo: ELF 32-bit MSB pie executable, Motorola m68k, 68020, version 1 (SYSV),
    dynamically linked, interpreter /lib/ld.so.1,
    BuildID[sha1]=7e5bf08930f87b9eaee173cf163b067f620cb841, for GNU/Linux 3
    .2.0, not stripped
    (unstable-amd64-sbuild)glaubitz@esk:~/rust/build$

    The binary runs on m68k but there is no output, unfortunately. Needs more
    debugging.

    Some more progress. I managed to cross-compile "Hello World" in Rust for m6
    8k and it
    actually runs. The issues which prevented this are two bugs in the LLVM bac kend, one
    is already known upstream [1]. I will file a bug report for the second one.

    (unstable-amd64-sbuild)glaubitz@esk:~/rust$ uname -a
    Linux esk 6.18.12+deb14-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.18.12-1 (2026 -02-17) x86_64 GNU/Linux
    (unstable-amd64-sbuild)glaubitz@esk:~/rust$ cat ~/main.rs
    fn main() {
    println!("Hello, m68k Linux world!");
    }
    (unstable-amd64-sbuild)glaubitz@esk:~/rust$ ./build/x86_64-unknown-linux-gn u/stage2/bin/rustc --target m68k-unknown-linux-gnu -C linker=m68k-linux-g nu-gcc ~/main.rs -o ~/hello_world
    (unstable-amd64-sbuild)glaubitz@esk:~/rust$ file ~/hello_world /home/glaubitz/hello_world: ELF 32-bit MSB pie executable, Motorola m68k, 6 8020, version 1 (SYSV), dynamically linked, interpreter /lib/ld.so.1, Build ID[sha1]=819625f88d263c358cbf7ff37d660bc453eca931,
    for GNU/Linux 3.2.0, not stripped
    (unstable-amd64-sbuild)glaubitz@esk:~/rust$ md5sum ~/hello_world c12f86b37b301331e14499b573e45955 /home/glaubitz/hello_world (unstable-amd64-sbuild)glaubitz@esk:~/rust$

    glaubitz@mitchy:~$ uname -a
    Linux mitchy 6.15.0-rc2-virt #1 Thu May 1 10:27:28 UTC 2025 m68k GNU/Linux glaubitz@mitchy:~$ file ./hello_world
    ./hello_world: ELF 32-bit MSB pie executable, Motorola m68k, 68020, version
    1 (SYSV), dynamically linked, interpreter /lib/ld.so.1, BuildID[sha1]=81 9625f88d263c358cbf7ff37d660bc453eca931, for
    GNU/Linux 3.2.0, not stripped
    glaubitz@mitchy:~$ md5sum ./hello_world
    c12f86b37b301331e14499b573e45955 ./hello_world
    glaubitz@mitchy:~$ ./hello_world
    Hello, m68k Linux world!
    glaubitz@mitchy:~$

    Adrian

    [1] https://github.com/llvm/llvm-project/issues/152816

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer
    `. `' Physicist
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    --- PyGate Linux v1.5.15
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)