-
Notifications
You must be signed in to change notification settings - Fork 13.4k
add first HelenOS compilation targets #139310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
These commits modify compiler targets. Some changes occurred in src/doc/rustc/src/platform-support cc @Noratrieb |
Ah, sorry, of course I forgot to do this r? compiler |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #138011) made this pull request unmergeable. Please resolve the merge conflicts. |
8f3ebc4
to
2df2d02
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
compiler/rustc_target/src/spec/targets/armv5te_unknown_helenos_eabi.rs
Outdated
Show resolved
Hide resolved
No issues otherwise so happy to r+ when CI is green! |
^ please do also squash a bit once that works :) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
See notes in rust-lang#139310, I was unable to run anything non-trivial on ARM HelenOS, there are issues with the linker/loader, incomplete support of atomics, and overall a lot of confusion about the precise version of ARM architecture that the HelenOS builds target.
This comment has been minimized.
This comment has been minimized.
45dc52c
to
e0976d4
Compare
added two other targets that actually work, removed the arm target with sketchy workaround flags, rebased & squashed |
Thanks @mvolfik! Would you mind squashing the second commit into the first? |
Targets theoretically possible, but not provided yet: - 32-bit arm See also notes in the PR, I was unable to run anything non-trivial on ARM HelenOS, there are issues with the linker/loader, incomplete support of atomics, and overall a lot of confusion about the precise version of ARM architecture that the HelenOS builds target. - riscv, mips (These targets currently don't run HelenOS at all. HelenOS says it should work, but the builds are broken for quite some time now.)
e0976d4
to
b808c9b
Compare
@wesleywiser done, sorry it took longer than needed:) |
I'm working on adding a HelenOS compilation target for Rust as my bachelor thesis. I understood that the policy for tier 3 targets is quite liberal, so here's my attempt at upstreaming the initial support. I'm quite new to Rust internals, so thanks in advance for all assistance with my stupid questions :)
libstd support is coming, but I understood compiler support must come first before libc bindings can get merged (rust-lang/libc#4355 (comment))
Locally, I also needed to update
cc-rs
, to do two things:x86_64-unknown-helenos
->amd64-helenos
generated.rs
From the "Adding tier 3 target" guide it sound like the latter will happen automatically, the first I need to do manually? I'm not sure if the test suite will pass or fail without it.
I'm also quite unsure about all the target spec configuration flags. I copied the specs from other small OSs with some tweaks and things seems to work now, but I have no idea how to better judge if it's correct.
Finally, I'm also working on support for arm (32-bit and 64), but there I'm currently running into some issues with linking, so I'll send that later, if I figure it out.
Tier 3 policy "form"
That would be me, I suppose. I agree.
I'm using the standard Rust conventions.
I am not aware of any legal issues. HelenOS itself is open-source under BSD license. All code contributed in this PR (and later for libstd) is either fully my own or an adaptation of existing code from this repo (some PAL pieces).
I am not adding any new dependencies.
The HelenOS build tools consist of open-source patches to GCC and binutils, so I suppose we're fine.
Understood.
The libstd PR will fully support core+alloc, and enough of std to run interesting programs (stdio, argv and fs) - so we can run tools like imagecli. But yes, major parts of std are missing - pipe, process and net are currently forwarded to
unsupported()
. Some barebonesnet
should be possible, but e.g. cloning of the descriptor is unheard of in HelenOS, so it won't be as straightforward as the rest. Also, some places of thefs
andthread
module are also quite stubby (but part of it is just because HelenOS has no file permissions, for example). HelenOS is a small, experimental OS, so its own libc is stubbed out as well in some places. I hope this state is acceptable?I hope the guide in doc is sufficient.
Understood.
Understood.
Umm, I think this is satisfied? Code generation works with the default LLVM backend, even though it has no idea about HelenOS. And our GCC patch is then used only for linking.