Skip to content

Conversation

@androm3da
Copy link
Contributor

@androm3da androm3da commented Sep 30, 2025

@rustbot
Copy link
Collaborator

rustbot commented Sep 30, 2025

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

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

cc @Noratrieb

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 30, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 30, 2025

r? @BoxyUwU

rustbot has assigned @BoxyUwU.
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

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@tgross35
Copy link
Contributor

Procedurally, adding a new T3 target requires a MCP (Major Change Proposal), which is an issue template at https://github.com/rust-lang/compiler-team/issues. See rust-lang/compiler-team#911 for a recent example.

@jieyouxu
Copy link
Member

Procedurally, adding a new T3 target requires a MCP (Major Change Proposal), which is an issue template at rust-lang/compiler-team/issues. See rust-lang/compiler-team#911 for a recent example.

(I believe that was revised to only require a PR (with the target tier policy for T3 filled out), and assigned to one of the compiler co-leads. For certain targets (especially the more obscure ones) we may ask for an MCP for further discusssions. This target seems... rather obscure, so an MCP seems beneficial.)

r? compiler_leads

@rustbot rustbot assigned davidtwco and unassigned BoxyUwU Sep 30, 2025

## Cross-compilation toolchains and C code

This target requires the [Hexagon SDK toolchain for C interoperability](https://softwarecenter.qualcomm.com/api/download/software/sdks/Hexagon_SDK/Linux/Debian/6.3.0.0/Hexagon_SDK.zip):
Copy link
Member

Choose a reason for hiding this comment

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

What is the license of this SDK? Maybe you could link to the page that links to the zip file and presumably also the license.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a proprietary SDK, hopefully the change makes this clearer.

@rust-log-analyzer

This comment has been minimized.

@androm3da
Copy link
Contributor Author

androm3da commented Sep 30, 2025

Procedurally, adding a new T3 target requires a MCP (Major Change Proposal), which is an issue template at rust-lang/compiler-team/issues. See rust-lang/compiler-team#911 for a recent example.

(I believe that was revised to only require a PR (with the target tier policy for T3 filled out), and assigned to one of the compiler co-leads. For certain targets (especially the more obscure ones) we may ask for an MCP for further discusssions. This target seems... rather obscure, so an MCP seems beneficial.)

r? compiler_leads

Happy to fill out an MCP - that makes sense to me.

But in filling it out, I think I've hit a roadblock that makes me consider abandoning this PR.

Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge.

Of course - this policy makes perfect sense. For this particular target, it's generally targeted using the hexagon-unknown-elf triple when using clang -- not hexagon-unknown-qurt. This is unfortunate because it also means that clang doesn't emit preprocessor defines like __QURT__ because there's no distinction. But in places like Rust's libc, I want to be able to guard things with #[cfg(target_os = "qurt")].

Sorry - perhaps this discussion might be better on the MCP issue rather than this PR. We already have an hexagon-unknown-none-elf target in rustc. Should I just use that one instead or does this constitute a "very good reason to diverge"? It's definitely the case that some folks use other non-QuRT, non-Linux OSs on Hexagon DSPs, but -- for now -- this is probably only internal to Qualcomm.

@rust-log-analyzer

This comment has been minimized.

@tgross35
Copy link
Contributor

Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge.

Of course - this policy makes perfect sense. For this particular target, it's generally targeted using the hexagon-unknown-elf triple when using clang -- not hexagon-unknown-qurt. This is unfortunate because it also means that clang doesn't emit preprocessor defines like __QURT__ because there's no distinction. But in places like Rust's libc, I want to be able to guard things with #[cfg(target_os = "qurt")].

Why doesn't Clang have a -qurt target, or why isn't it used? If there is a need to configure on qurt vs. not qurt (e.g. different system interfaces) then that's probably enough to justify a new Rust target. It just seems weird that Clang doesn't have the target if it's useful.

@androm3da
Copy link
Contributor Author

Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge.

Of course - this policy makes perfect sense. For this particular target, it's generally targeted using the hexagon-unknown-elf triple when using clang -- not hexagon-unknown-qurt. This is unfortunate because it also means that clang doesn't emit preprocessor defines like __QURT__ because there's no distinction. But in places like Rust's libc, I want to be able to guard things with #[cfg(target_os = "qurt")].

Why doesn't Clang have a -qurt target, or why isn't it used? If there is a need to configure on qurt vs. not qurt (e.g. different system interfaces) then that's probably enough to justify a new Rust target.

The Hexagon SDK toolchain ships with hexagon-clang -- this canonicalizes as hexagon-unknown-elf. By default hexagon-clang builds with a common C library and links in a crt0 for a baremetal OS. But for targeting QuRT, that behavior is explicitly overridden when invoking hexagon-clang to compile or link to additionally use QuRT include paths and link against QuRT libraries/crt0 instead. I don't know for sure but I suppose it's "simpler" this way -- or maybe it's just a historical thing that stays that way due to momentum.

If there is a need to configure on qurt vs. not qurt (e.g. different system interfaces) then that's probably enough to justify a new Rust target.

The Hexagon Linux target is not supported by the Hexagon SDK and so far that's really the only toolchain that's used to target QuRT. In practice, no commercial users of Hexagon target anything other than QuRT on Hexagon architecture. So IMO it's an oversimplification that happens to work. The opensource clang+llvm toolchain (see build recipe ) could conceivably target QuRT but is missing a C library that would work with QuRT, so in practice no one uses it for that -- yet.

It just seems weird that Clang doesn't have the target if it's useful.

My understanding is that clang could take a hexagon-unknown-qurt triple and it would probably work reasonably well if it were interpreted as having the same behavior as hexagon-unknown-none-elf / hexagon-unknown-elf. I don't recall for sure but I suppose the clang driver might do just that. And if not, it's not hard to change it to do so. But -- it's untested and definitely not how it's been done by the Hexagon SDK over the years. I hope I am just being overly cautious here but Rust's policy regarding target names makes a lot of sense to me.

@androm3da
Copy link
Contributor Author

This target seems... rather obscure, so an MCP seems beneficial.)

Thanks - MCP created rust-lang/compiler-team#919

Comment on lines 49 to 57
[target.hexagon-qurt]
cc = "hexagon-clang"
cxx = "hexagon-clang++"
ranlib = "hexagon-ranlib"
ar = "hexagon-ar"
llvm-libunwind = 'in-tree'
Copy link
Contributor

Choose a reason for hiding this comment

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

These all come from the hexagon toolchain, right? If they are needed then it's probably worth mentioning the toolchain in the "requirements" section. If not, maybe add a comment here that the defaults also work or provide an alt setup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Oct 3, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Nov 17, 2025

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@tgross35
Copy link
Contributor

@bors r=davidtwco,tgross35

@bors
Copy link
Collaborator

bors commented Nov 19, 2025

📌 Commit ecfc642 has been approved by davidtwco,tgross35

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-review Status: Awaiting review from the assignee but also interested parties. labels Nov 19, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 19, 2025
…vidtwco,tgross35

Add support for hexagon-unknown-qurt target

MCP: rust-lang/compiler-team#919
Fixes rust-lang#148982.
bors added a commit that referenced this pull request Nov 19, 2025
Rollup of 7 pull requests

Successful merges:

 - #146341 (minimal dirfd implementation (1/4))
 - #146925 (Add doc for va_list APIs)
 - #147035 (alloc: fix `Debug` implementation of `ExtractIf`)
 - #147173 (Add support for hexagon-unknown-qurt target)
 - #149041 (ignore unsized types in mips64 and sparc64 callconvs)
 - #149056 (fix the fragment_in_dst_padding_gets_overwritten test on s390x)
 - #149095 (rustc-dev-guide subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 19, 2025
…vidtwco,tgross35

Add support for hexagon-unknown-qurt target

MCP: rust-lang/compiler-team#919
Fixes rust-lang#148982.
bors added a commit that referenced this pull request Nov 20, 2025
Rollup of 6 pull requests

Successful merges:

 - #146925 (Add doc for va_list APIs)
 - #147035 (alloc: fix `Debug` implementation of `ExtractIf`)
 - #147173 (Add support for hexagon-unknown-qurt target)
 - #149041 (ignore unsized types in mips64 and sparc64 callconvs)
 - #149056 (fix the fragment_in_dst_padding_gets_overwritten test on s390x)
 - #149095 (rustc-dev-guide subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Nov 20, 2025
…vidtwco,tgross35

Add support for hexagon-unknown-qurt target

MCP: rust-lang/compiler-team#919
Fixes rust-lang#148982.
bors added a commit that referenced this pull request Nov 20, 2025
Rollup of 9 pull requests

Successful merges:

 - #146925 (Add doc for va_list APIs)
 - #147035 (alloc: fix `Debug` implementation of `ExtractIf`)
 - #147173 (Add support for hexagon-unknown-qurt target)
 - #148261 (rustc_public: Make Id types !Send / !Sync)
 - #149041 (ignore unsized types in mips64 and sparc64 callconvs)
 - #149043 ( rustdoc-json: add rlib path to ExternalCrate to enable robust crate resolution)
 - #149056 (fix the fragment_in_dst_padding_gets_overwritten test on s390x)
 - #149095 (rustc-dev-guide subtree update)
 - #149108 ([AIX][ppc64le-linux-gnu] Add Amy Kwan to target maintainers)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Nov 20, 2025
…vidtwco,tgross35

Add support for hexagon-unknown-qurt target

MCP: rust-lang/compiler-team#919
Fixes rust-lang#148982.
bors added a commit that referenced this pull request Nov 20, 2025
Rollup of 10 pull requests

Successful merges:

 - #146925 (Add doc for va_list APIs)
 - #147035 (alloc: fix `Debug` implementation of `ExtractIf`)
 - #147173 (Add support for hexagon-unknown-qurt target)
 - #148261 (rustc_public: Make Id types !Send / !Sync)
 - #148831 (Bump compiler dependencies)
 - #149041 (ignore unsized types in mips64 and sparc64 callconvs)
 - #149056 (fix the fragment_in_dst_padding_gets_overwritten test on s390x)
 - #149071 (Add test scaffolding for the `remote-test-client`)
 - #149095 (rustc-dev-guide subtree update)
 - #149108 ([AIX][ppc64le-linux-gnu] Add Amy Kwan to target maintainers)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Nov 20, 2025
Rollup of 9 pull requests

Successful merges:

 - #146925 (Add doc for va_list APIs)
 - #147035 (alloc: fix `Debug` implementation of `ExtractIf`)
 - #147173 (Add support for hexagon-unknown-qurt target)
 - #148261 (rustc_public: Make Id types !Send / !Sync)
 - #149041 (ignore unsized types in mips64 and sparc64 callconvs)
 - #149056 (fix the fragment_in_dst_padding_gets_overwritten test on s390x)
 - #149071 (Add test scaffolding for the `remote-test-client`)
 - #149095 (rustc-dev-guide subtree update)
 - #149108 ([AIX][ppc64le-linux-gnu] Add Amy Kwan to target maintainers)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 422b83a into rust-lang:main Nov 20, 2025
11 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Nov 20, 2025
rust-timer added a commit that referenced this pull request Nov 20, 2025
Rollup merge of #147173 - androm3da:bcain/hexagon_qurt, r=davidtwco,tgross35

Add support for hexagon-unknown-qurt target

MCP: rust-lang/compiler-team#919
Fixes #148982.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Tracking issue for MCP 919: target tier 3 support for hexagon-unknown-qurt

9 participants