Skip to content
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

add m68k-unknown-none-elf target #135085

Merged
merged 4 commits into from
Jan 6, 2025
Merged

Conversation

knickish
Copy link
Contributor

@knickish knickish commented Jan 3, 2025

r? @workingjubilee

The existing m68k-unknown-linux-gnu target builds std by default, requires atomics, and has a base cpu with an fpu. A smaller/more embedded target is desirable both to have a baseline target for the ISA, as well to make debugging easier for working on the llvm backend. Currently this target is using the M68010 as the minimum CPU due, but as missing features are merged into the M68k llvm backend I am hoping to lower this further.

I have been able to build very small crates using a toolchain built against this target (together with a later version of object) using the configuration described in the target platform-support documentation, although getting anything of substantial complexity to build quickly hits errors in the llvm backend

@rustbot
Copy link
Collaborator

rustbot commented Jan 3, 2025

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 3, 2025
@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Jan 3, 2025

Could not assign reviewer from: workingjubilee.
User(s) workingjubilee are either the PR author, already assigned, or on vacation, and there are no other candidates.
Use r? to specify someone else to assign.

@rust-log-analyzer

This comment has been minimized.

@knickish knickish marked this pull request as ready for review January 3, 2025 21:27
@rustbot
Copy link
Collaborator

rustbot commented Jan 3, 2025

Some changes occurred in src/tools/compiletest

cc @jieyouxu

These commits modify compiler targets.
(See the Target Tier Policy.)

Some changes occurred in src/doc/rustc/src/platform-support

cc @Noratrieb

@rust-log-analyzer

This comment has been minimized.

@workingjubilee
Copy link
Member

@knickish Have you read and understand the terms of https://doc.rust-lang.org/nightly/rustc/target-tier-policy.html#tier-3-target-policy regarding target maintenance?

Briefly put: The ticket is free because the ride ain't got no safeties, no brakes, and no complaining.

@knickish
Copy link
Contributor Author

knickish commented Jan 3, 2025

@workingjubilee Yup, got it. Don't break anybody, and any higher tier target can break me.

Should I just remove the endianness compiletest that seems to require the target to already be in the bootstrap compiler?

Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly typo nits, don't worry much about them, I just woke up in copyeditor mode today. mostly concerned about the ABI-related stuff and the consent.

$ qemu-m68k-static your-code
```

For more complex applications, a chroot or native m68k system is required for testing.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thinks ...well, Amigas don't have USB, so how am I gonna get my program from a modern, made-in-2024 dev computer to the Amiga? ...hmm, I can still find a 5.25 bay, and I can get a floppy drive, I guess? I know there's some adapters that let you drive them via USB, too... hope it's less than 1.44MB...

anyways, that all is pretty squarely in Their Problem territory, but I do have one question that this thing should probably answer: would just copying the program to the floppy be sufficient, or should I do something else first?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure that just copying it should be sufficient. It's just linux on a different arch, so as long as you cross compile it should be good to go.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, for the bare metal target?

but yeah sounds good then.

Comment on lines 88 to 90
[target.m68k-unknown-none-elf]
# there is no easily available non-linux m68k linker, so just use the linux one
linker = "m68k-linux-gnu-ld"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this section necessary, given we already set this in the TargetOptions? Maybe this should just be

Suggested change
[target.m68k-unknown-none-elf]
# there is no easily available non-linux m68k linker, so just use the linux one
linker = "m68k-linux-gnu-ld"

src/tools/compiletest/src/header/tests.rs Outdated Show resolved Hide resolved
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 3, 2025
Co-authored-by: Jubilee <workingjubilee@gmail.com>
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then just waiting on affirmation from the other maintainers.

Co-authored-by: Jubilee <workingjubilee@gmail.com>
@knickish
Copy link
Contributor Author

knickish commented Jan 5, 2025

I've gone ahead and removed them, can add them back later if they want to be involved.

@workingjubilee
Copy link
Member

Good enough for me!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 5, 2025

📌 Commit f985a37 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 5, 2025
@knickish
Copy link
Contributor Author

knickish commented Jan 5, 2025

Thanks for the review!

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 5, 2025
…ingjubilee

add m68k-unknown-none-elf target

r? `@workingjubilee`

The existing `m68k-unknown-linux-gnu` target builds `std` by default, requires atomics, and has a base cpu with an fpu. A smaller/more embedded target is desirable both to have a baseline target for the ISA, as well to make debugging easier for working on the llvm backend. Currently this target is using the `M68010` as the minimum CPU due, but as missing features are merged into the `M68k` llvm backend I am hoping to lower this further.

I have been able to build very small crates using a toolchain built against this target (together with a later version of `object`) using the configuration described in the target platform-support documentation, although getting anything of substantial complexity to build quickly hits errors in the llvm backend
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 5, 2025
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#135085 (add m68k-unknown-none-elf target)
 - rust-lang#135111 (Add doc aliases for `libm` and IEEE names)
 - rust-lang#135129 (triagebot: label `src/doc/rustc-dev-guide` changes with `A-rustc-dev-guide`)
 - rust-lang#135132 (dev guide ping group and set adhoc reviewers to compiler)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 6, 2025
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#135085 (add m68k-unknown-none-elf target)
 - rust-lang#135111 (Add doc aliases for `libm` and IEEE names)
 - rust-lang#135129 (triagebot: label `src/doc/rustc-dev-guide` changes with `A-rustc-dev-guide`)
 - rust-lang#135132 (dev guide ping group and set adhoc reviewers to compiler)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Jan 6, 2025

⌛ Testing commit f985a37 with merge fd98df8...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 6, 2025
Rollup of 4 pull requests

Successful merges:

 - rust-lang#135085 (add m68k-unknown-none-elf target)
 - rust-lang#135111 (Add doc aliases for `libm` and IEEE names)
 - rust-lang#135129 (triagebot: label `src/doc/rustc-dev-guide` changes with `A-rustc-dev-guide`)
 - rust-lang#135132 (dev guide ping group and set adhoc reviewers to compiler)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: dist-aarch64-apple
@bors
Copy link
Contributor

bors commented Jan 6, 2025

☀️ Test successful - checks-actions
Approved by: workingjubilee
Pushing fd98df8 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 6, 2025
@bors bors merged commit fd98df8 into rust-lang:master Jan 6, 2025
7 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants