DEC Alpha support

Đang mở
#742 43 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust

Hướng nghiên cứu

Bắt đầu với một mục phía compiler chưa được đánh dấu, chẳng hạn như Alpha ABI trong compiler/rustc_target/src/callconv hoặc phần xử lý Alpha trong compiler/rustc_target/src/spec/mod.rs. Xem xét công việc object và cc-rs được liên kết, sau đó xác minh tệp target và hành vi liên quan của compiler. Được coi là hoàn tất khi phần hỗ trợ Alpha đã chọn hướng tới việc cross-compile mã Rust mà không phụ thuộc vào các workaround được liệt kê.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

This is an issue tracking the work on cross-compiling the Rust compiler to DEC Alpha.

Here is a list of things that need to be done to facilitate compiling any Rust code for DEC Alpha:

  • Add bare-bones support for DEC Alpha in the object crate. This crate is used by Rust to embed metadata in executables.
  • Done, PR waiting for merge Add support for the alpha architecture in cc-rs
  • Create an Alpha target file - I have created a target file myself, but I would prefer to double-check if that target is correct.
  • Fix the libgccjit !gdisp!0 error. For now, I workaround this issue by removing this erronious label from all assembled files. We should figure out why this is even generated.
  • Fix the instruction jsr $23,($27),__%E3%j5 getting emited in compiler_builtins. From asking about, it seems like % can't be present in symbol names: it is a format specifier(like in printf). So, it seems like it just does not get expanded properly? This function should normally expand to a call to a division subroutine(DEC alpha lacks hardware division support).

Here is a list of compiler-side changes we will need to make to compile any code to Alpha. Those changes should be merged upstream.

  • Add handling of the Alpha ABI to the Rust compiler, here.
  • Add Alpha to the code inserting metadata into object files, here.
  • Add Alpha as a recognized architecture to be used in #[cfg(target_arch = "alpha")]. This is not strictly needed for our work, but it is a required step before getting anything else upstream.

From some talks with the Rust folk, it seems like we can do those steps without the need for an official target. So, we will be able to just use our own target files, and add a tier 3 target once we have better support.

After those changes, we will be able to build code not depending on std.

  • (Optional) We should also add the config for the x86_64 -> Alpha cross compiler to our configs. This will just make cross-compilation slightly easier for other people(creating those config files is not hard, but having prepared configs would not hurt).

Next, I will list the changes needed to build on std, and code depending on the standard library for Alpha.

  • Add Alpha support to libc(a Rust library desciribing C types on the target). Doing so would require some work(tracking down the size / layout of all the libc types on Alpha). That work should get merged upstream. We may need to cordinate with the libc crate refactor project, to ensure our work does not collide.

  • (Optional) Add Alpha unwinding support to std.

At this point, we should be able to build std, and at least a chunk of crates depending on it. There might be some issues with crates which build C dependencies, but we should be nontheless able to at least try cross-compling some Rust packages to Alpha. We would not be able to run the Rust compiler on Alpha yet, but we would be able to run a chunk of Rust code there.

I belive we should then cross-compile the Rust core, std and alloc test suite to Alpha, to check if everything is working correctly.

I don't yet know what would be required to get the Rust compiler to run on Alpha - will update this once I figure this out.

@glaubitz I think this issue might be of interest to you.

Ngôn ngữ chính
Rust
Star
1.2k
Fork
106
Merge trung bình
11 giờ 14 phút
Pull request đã merge (30 ngày)
25

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rust-lang/rustc_codegen_gcc

Tất cả issue của rust-lang/rustc_codegen_gcc

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.