Skip to content

rustc_target: Require altivec feature for ELFv2 powerpc64 targets - #166049

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Gelbpunkt:elfv2-require-altivec
Nov 17, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Gelbpunkt:elfv2-require-altivec

Conversation

@Gelbpunkt

Copy link
Copy Markdown
Contributor

The ELFv2 ABI requires vector registers for passing certain types like vectors, the IEEE binary128 type and any future 16-byte aligned types. While all our targets that use the ELFv2 ABI have a baseline that already includes AltiVec (and therefore vector registers), we also shouldn't allow disabling the target feature. Add it to the list of ABI required features.

r? RalfJung

@rustbot

rustbot commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Target features are being changed; ensure all ABI effects are being accounted for

cc @RalfJung

@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 Nov 16, 2026
@rustbot

rustbot commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

RalfJung is not on the review rotation at the moment.
They may take a while to respond.

@RalfJung

Copy link
Copy Markdown
Member

r=me with comment nit fixed.
@bors delegate+

@rust-bors

rust-bors Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

✌️ @Gelbpunkt, you can now approve this pull request!

If @RalfJung told you to "r=me" after making some further change, then please make that change and post @bors r=RalfJung.

View changes since this delegation.

@programmerjake

programmerjake commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

there are projects that need to disable altivec (e.g. antonblanchard/microwatt#354), it would be nice if they have an option to use modern Rust so I think we should not enforce this requirement until we have a suitable soft-float or hard-float-but-no-altivec target.

@programmerjake

Copy link
Copy Markdown
Member

ah, it just generates a FCW and there is a planned alternative for targets that need to disable features (-Zllvm-target-feature and build-std). you may disregard my objection

@RalfJung

RalfJung commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

ah, it just generates a FCW and there is a planned alternative for targets that need to disable features (-Zllvm-target-feature and build-std). you may disregard my objection

Note that -Zllvm-target-feature is still subject to these ABI checks, so it does not provide an alternative. A separate target is still needed.

@RalfJung

Copy link
Copy Markdown
Member

there are projects that need to disable altivec (e.g. antonblanchard/microwatt#354), it would be nice if they have an option to use modern Rust so I think we should not enforce this requirement until we have a suitable soft-float or hard-float-but-no-altivec target.

Hopefully the FCW motivates people to create a proper target for this.
We could also try to make this work for the existing targets. Vector types are fine, but it may be tricky to figure out what to do with f128. But if the target maintainers considers non-altivec to be out-of-scope (#166047) then people using this target on non-altivec machines are arguably engaging in off-label use. That's fine as long as it works, but shouldn't hold back development of the target for intended uses. Most architctures have soft-float targets so it would make a lot of sense to also add one for powerpc64.

@Gelbpunkt

Copy link
Copy Markdown
Contributor Author

Yeah, the primary motivation for requiring AltiVec is f128. Vector types are just not available if AltiVec is disabled anyways, and I don't think any "future type with 16 byte alignment" case is likely to ever be added, but not having f128 on some targets would be suboptimal. With ELFv1 there is no defined ABI for f128, so I guess you could resort to that for an AltiVec-less powerpc64 target. Anyways, I don't think any of this should block enforcing this requirement for ELFv2 at the moment and any possible exceptions should be added when we have targets proposed for those usecases.

@tgross35

Copy link
Copy Markdown
Member

There were softfloat PPC targets proposed but #160575 hasn't landed yet. Though elfv2 isn't in that list rust-lang/compiler-team#988

@Gelbpunkt

Copy link
Copy Markdown
Contributor Author

I believe ELFv2 softfloat should be simple and can just be exempted here in the future since then f128 also isn't a concern. hardfloat without AltiVec is somewhat problematic with f128.

@Gelbpunkt

Copy link
Copy Markdown
Contributor Author

@bors r=RalfJung

@rust-bors

rust-bors Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

📌 Commit cbf3050 has been approved by RalfJung

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 16, 2026
@RalfJung

Copy link
Copy Markdown
Member

@bors squash

@rust-bors

This comment has been minimized.

* rustc_target: Require altivec feature for ELFv2 powerpc64 targets

The ELFv2 ABI requires vector registers for passing certain types like
vectors, the IEEE binary128 type and any future 16-byte aligned types.
While all our targets that use the ELFv2 ABI have a baseline that
already includes AltiVec (and therefore vector registers), we also
shouldn't allow disabling the target feature. Add it to the list of ABI
required features.
* Apply Ralf's comment suggestion
@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 16, 2026
@rust-bors
rust-bors Bot force-pushed the elfv2-require-altivec branch from cbf3050 to 1cfe456 Compare November 16, 2026 14:22
@rust-bors

rust-bors Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

🔨 2 commits were squashed into 1cfe456.

This pull request was unapproved.

@RalfJung

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 1cfe456 has been tentatively approved by RalfJung

It will be put into the queue for this repository once PR CI succeeds.

@rust-bors rust-bors Bot 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 Nov 16, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 16, 2026
…=RalfJung

rustc_target: Require altivec feature for ELFv2 powerpc64 targets

The ELFv2 ABI requires vector registers for passing certain types like vectors, the IEEE binary128 type and any future 16-byte aligned types. While all our targets that use the ELFv2 ABI have a baseline that already includes AltiVec (and therefore vector registers), we also shouldn't allow disabling the target feature. Add it to the list of ABI required features.

r? RalfJung
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 16, 2026
…=RalfJung

rustc_target: Require altivec feature for ELFv2 powerpc64 targets

The ELFv2 ABI requires vector registers for passing certain types like vectors, the IEEE binary128 type and any future 16-byte aligned types. While all our targets that use the ELFv2 ABI have a baseline that already includes AltiVec (and therefore vector registers), we also shouldn't allow disabling the target feature. Add it to the list of ABI required features.

r? RalfJung
rust-bors Bot pushed a commit that referenced this pull request Nov 16, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #166054 (stdarch subtree update)
 - #165289 (lexer: Update to Unicode 18)
 - #165960 (alloctests: use thread-local in `c_str_alloc_error`)
 - #166002 (#[optimize]: keep low opt levels unoptimized)
 - #166049 (rustc_target: Require altivec feature for ELFv2 powerpc64 targets)
 - #165200 (fix abi kind of thumb windows targets)
 - #165935 (Duplicate attribute diagnostic cleanups)
 - #165999 (Update TPDE submodule)
 - #166045 (rustdoc: Correctly filter deref impls on type aliases)
 - #166063 (Fix bad hyperlink)
 - #166066 (Update books)
 - #166072 (simplify Appearances iter)
 - #166075 (Remove dead code emitting `UnusedBuiltinAttribute`)
rust-bors Bot pushed a commit that referenced this pull request Nov 17, 2026
Rollup of 15 pull requests

Successful merges:

 - #166054 (stdarch subtree update)
 - #165939 (Convert `pretty-std` debuginfo test to `gdb-repr`)
 - #165289 (lexer: Update to Unicode 18)
 - #165960 (alloctests: use thread-local in `c_str_alloc_error`)
 - #166002 (#[optimize]: keep low opt levels unoptimized)
 - #166003 (Fix ICE in tail_expr_drop_order lint with async drops)
 - #166049 (rustc_target: Require altivec feature for ELFv2 powerpc64 targets)
 - #165200 (fix abi kind of thumb windows targets)
 - #165966 (Document failing cases for spawning processes when using Command)
 - #165999 (Update TPDE submodule)
 - #166045 (rustdoc: Correctly filter deref impls on type aliases)
 - #166063 (Fix bad hyperlink)
 - #166066 (Update books)
 - #166072 (simplify Appearances iter)
 - #166075 (Remove dead code emitting `UnusedBuiltinAttribute`)
@rust-bors
rust-bors Bot merged commit 775a6f1 into rust-lang:main Nov 17, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 17, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 17, 2026
Rollup merge of #166049 - Gelbpunkt:elfv2-require-altivec, r=RalfJung

rustc_target: Require altivec feature for ELFv2 powerpc64 targets

The ELFv2 ABI requires vector registers for passing certain types like vectors, the IEEE binary128 type and any future 16-byte aligned types. While all our targets that use the ELFv2 ABI have a baseline that already includes AltiVec (and therefore vector registers), we also shouldn't allow disabling the target feature. Add it to the list of ABI required features.

r? RalfJung
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Nov 19, 2026
Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#166054 (stdarch subtree update)
 - rust-lang/rust#165939 (Convert `pretty-std` debuginfo test to `gdb-repr`)
 - rust-lang/rust#165289 (lexer: Update to Unicode 18)
 - rust-lang/rust#165960 (alloctests: use thread-local in `c_str_alloc_error`)
 - rust-lang/rust#166002 (#[optimize]: keep low opt levels unoptimized)
 - rust-lang/rust#166003 (Fix ICE in tail_expr_drop_order lint with async drops)
 - rust-lang/rust#166049 (rustc_target: Require altivec feature for ELFv2 powerpc64 targets)
 - rust-lang/rust#165200 (fix abi kind of thumb windows targets)
 - rust-lang/rust#165966 (Document failing cases for spawning processes when using Command)
 - rust-lang/rust#165999 (Update TPDE submodule)
 - rust-lang/rust#166045 (rustdoc: Correctly filter deref impls on type aliases)
 - rust-lang/rust#166063 (Fix bad hyperlink)
 - rust-lang/rust#166066 (Update books)
 - rust-lang/rust#166072 (simplify Appearances iter)
 - rust-lang/rust#166075 (Remove dead code emitting `UnusedBuiltinAttribute`)
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-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.

5 participants