|
|
Log in / Subscribe / Register

Compiling Rust with GCC: an update

Compiling Rust with GCC: an update

Posted Sep 9, 2022 17:01 UTC (Fri) by developer122 (guest, #152928)
Parent article: Compiling Rust with GCC: an update

Out of curiosity: what widely used, kernel-supported architectures are supported by GCC and not LLVM?


to post comments

Compiling Rust with GCC: an update

Posted Sep 9, 2022 17:33 UTC (Fri) by atnot (guest, #124910) [Link] (11 responses)

Comparing the list between the linux and rustc docs:
- ARC (Synopsis embedded core mostly used for MCUs)
- Xtensa (although there is a third party fork)
- SuperH (only really notably used in SEGA game consoles)
- PA-RISC (out of support since 2013)
- OpenRISC (still finds itself on various embedded boards)
- Nios II (Altera/Intel hard core on FPGAs)
- Itanium (no comment)

I have to say, I'm a bit surprised by this, considering the amount of noise about GCCs greater architecture support. I expected some hard hitters, but none of these seem particularly relevant. Even m86k, which is mostly kept alive for recreational purposes, is already supported upstream. All of these are going to be primitive enough that I don't think the lack of rust support will be relevant for a long long while. Unless it becomes impossible to compile Linux without rust at all.

Compiling Rust with GCC: an update

Posted Sep 9, 2022 20:16 UTC (Fri) by developer122 (guest, #152928) [Link] (1 responses)

Looking at https://github.com/fishinabarrel/linux-kernel-module-rust... it seems that a lot of architectures not currently supported have in fact been removed from LLVM at one point or another. Perhaps as old architectures are dropped from linux the gap will close.

Compiling Rust with GCC: an update

Posted Sep 9, 2022 20:46 UTC (Fri) by atnot (guest, #124910) [Link]

That's what I think too. Of these ARC (maybe Xtensa) seem like the only one that is likely to be still considered for current designs. This will only accelerate as ARM and RISC-V continue to displace custom cores.

Assuming a very optimistic timeline of two years until widespread Rust adoption in the Kernel and another two years until the stale distros actually pick up those kernels, I think most of these will be long gone from the Linux tree by the time this is relevant. Or have LLVM backends. Cadence and Synopsys certainly don't lack the resources to make that happen if they want to.

Compiling Rust with GCC: an update

Posted Sep 10, 2022 0:15 UTC (Sat) by ndesaulniers (subscriber, #110768) [Link] (7 responses)

>> widely used

Compiling Rust with GCC: an update

Posted Sep 10, 2022 18:31 UTC (Sat) by WolfWings (subscriber, #56790) [Link] (6 responses)

I mean there's still a financially self-sustaining scene of international indie game devs making entirely new games on the Dreamcast, big release day parties, kickstarters making ~25k to fund the titles, etc. SuperH is more widely uses than folks realize just not on desktops or servers, just by/for gamers. :)

Compiling Rust with GCC: an update

Posted Sep 11, 2022 4:39 UTC (Sun) by k8to (guest, #15413) [Link]

When i was at Wind River in the late 90s SuperH was an alive and well dev board type that people were actively developing on. I'm sure the arch made its way into various devices. I have no idea which if them are potentially still alive, of course, but I suspect it's not a trivial amount.

At the same time, it was dwarfed by powerpc, x86, mips, arm, and even sparc.

Compiling Rust with GCC: an update

Posted Sep 11, 2022 7:16 UTC (Sun) by joib (subscriber, #8541) [Link] (4 responses)

Well, the Dreamcast retro gaming scene doesn't run on Linux, does it, so not particularly relevant to the topic of which architectures Linux supports? Still kinda cool, I would have expected Dreamcast to be long gone and forgotten.

(Likewise the above-mentioned xtensa is ubiquitous in the 'maker scene' thanks to the ESP8266/ESP32 family of chips, but those don't run Linux so again not particularly relevant to this discussion. And as a side-note, it seems Expressif is transitioning to RISC-V cores.)

Compiling Rust with GCC: an update

Posted Sep 11, 2022 14:02 UTC (Sun) by mathstuf (subscriber, #69389) [Link] (3 responses)

> Well, the Dreamcast retro gaming scene doesn't run on Linux,

No, but Linux does run on the Dreamcast hardware due to a community effort (with recent updates!): http://linuxdc.sourceforge.net/

Compiling Rust with GCC: an update

Posted Sep 18, 2022 15:45 UTC (Sun) by flussence (guest, #85566) [Link]

Game console homebrew is a weird place. I've noticed substantial *N64* support patches going into mainline during 5.x. Not sure what they were going for, but that's pretty cool.

Compiling Rust with GCC: an update

Posted Sep 23, 2022 11:10 UTC (Fri) by Tobu (subscriber, #24111) [Link] (1 responses)

> with recent updates!

The date in that page seems to be generated on every request. Following the links, updates are from 2012 or so.

Compiling Rust with GCC: an update

Posted Sep 23, 2022 11:35 UTC (Fri) by mathstuf (subscriber, #69389) [Link]

Ah…indeed. Oh well :( .

Compiling Rust with GCC: an update

Posted Sep 12, 2022 12:04 UTC (Mon) by moltonel (subscriber, #45207) [Link]

You might also find surprising that gcc still doesn't support compiling for Apple M1 on MacOS. Gcc does support M1 on Linux, so this missing target triplet doesn't concern the kernel, but it's still an interesting counter point to the "Gcc supports more targets than LLVM" popular wisdom. aarch64-apple-darwin has orders of magnitude more users than all the Gcc-exclusive targets combined.

Compiling Rust with GCC: an update

Posted Sep 9, 2022 17:37 UTC (Fri) by mfuzzey (subscriber, #57966) [Link] (9 responses)

The list of kernel supported architectures not supported by LLVM seems to be

* alpha
* arc
* m68k
* microblaze
* nios2
* openrisc
* parisc
* s390
* sh
* um
* xtensa

alpha and nios2 used to be supported but LLVM but have since been dropped.

As for "widely used" I guess that depends on your perspective

Compiling Rust with GCC: an update

Posted Sep 9, 2022 20:16 UTC (Fri) by developer122 (guest, #152928) [Link]

There is in fact a port of rust to m68k, but only on linux.

Compiling Rust with GCC: an update

Posted Sep 10, 2022 0:14 UTC (Sat) by ndesaulniers (subscriber, #110768) [Link] (3 responses)

S390 and UM (usermide x86) are supported.

Compiling Rust with GCC: an update

Posted Sep 10, 2022 0:17 UTC (Sat) by ndesaulniers (subscriber, #110768) [Link]

In fact we test many different builds of Linux kernel for s390 and um with clang, and boot test them in CI.

s390x vs s390

Posted Sep 10, 2022 0:54 UTC (Sat) by tialaramex (subscriber, #21167) [Link] (1 responses)

I guess Rust only cares about s390x ("modern" 64-bit IBM) whereas I believe the Linux kernel technically builds on (32-bit) s390 despite there presumably not being many (any?) actual 20th century System/390 machines running it in practical use ?

If it ever came down to "Should we support decades old System/390 mainframes or Rust?" that seems like a no brainer but for now at least the ambition isn't anywhere close to that.

s390x vs s390

Posted Sep 10, 2022 12:16 UTC (Sat) by willy (subscriber, #9762) [Link]

Compiling Rust with GCC: an update

Posted Sep 10, 2022 11:18 UTC (Sat) by glaubitz (subscriber, #96452) [Link]

m68k is actually supported by LLVM as an experimental target thanks to efforts of the community ;-).

Compiling Rust with GCC: an update

Posted Sep 10, 2022 18:09 UTC (Sat) by linusw (subscriber, #40300) [Link] (2 responses)

There are some further "holes" in that list.

The ARM ISA is not universally supported, specifically not ARMv4 (not even in LLVM in general last time I checked) and I am even uncertain about ARMv5 for rust, both have substantial deployment and isn't going away from the kernel anytime soon.

Compiling Rust with GCC: an update

Posted Sep 11, 2022 10:39 UTC (Sun) by tialaramex (subscriber, #21167) [Link] (1 responses)

Rust's tier support list says armv4t-none-eabi has tier 3. That platform is described as ARMv4 with Thumb and exists particularly to make the Nintendo Gameboy Advance work.

Tier 3 means Rust's CI checks this compiles, but they don't check it works, and it is only supplied with the core library.

Obviously the kernel is comfortable in that world, you can't just TcpStream::connect() from inside the kernel either, although it won't fit on a GBA as I understand it, presumably if you've got a big enough ARMv4 system to run Linux, Rust isn't a difficult problem.

Compiling Rust with GCC: an update

Posted Sep 11, 2022 12:18 UTC (Sun) by josh (subscriber, #17465) [Link]

> Tier 3 means Rust's CI checks this compiles, but they don't check it works, and it is only supplied with the core library.

That's tier 2 (compiles, but isn't tested). Tier 3 is "this exists in the codebase, and might work, but you'll need to build it yourself".

https://doc.rust-lang.org/nightly/rustc/platform-support....


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds