Skip to content

[beta] Backports for compiler-builtins - #162820

Closed
tgross35 wants to merge 5 commits into
rust-lang:betafrom
tgross35:beta-compiler-builtins
Closed

tgross35 wants to merge 5 commits into
rust-lang:betafrom
tgross35:beta-compiler-builtins

Conversation

@tgross35

@tgross35 tgross35 commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

View all comments

Backport #160594 and part of #162816. The compiler-builtins portion includes rust-lang/compiler-builtins#1317 and two other trivial commits that avoid conflicts.

Closes: #162259

@rustbot rustbot added A-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 15, 2026
@rustbot

rustbot commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Fallback group: @Mark-Simulacrum, @jieyouxu
  • @Mark-Simulacrum, @jieyouxu expanded to Mark-Simulacrum, jieyouxu
  • Random selection from Mark-Simulacrum, jieyouxu

@tgross35

Copy link
Copy Markdown
Member Author

@bors try jobs=test-various,test-armhf-gnu,dist-arm-linux-gnueabi,dist-armhf-linux,dist-armv7-linux

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 15, 2026
[beta] Backports for compiler-builtins


try-job: test-various
try-job: test-armhf-gnu
try-job: dist-arm-linux-gnueabi
try-job: dist-armhf-linux
try-job: dist-armv7-linux
@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-review Status: Awaiting review from the assignee but also interested parties. labels Sep 15, 2026
@rust-bors

This comment was marked as outdated.

@tgross35

This comment was marked as outdated.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 15, 2026
[beta] Backports for compiler-builtins


try-job: test-various
try-job: dist-arm-linux-gnueabi
try-job: dist-armhf-linux
try-job: dist-armv7-linux
@rust-log-analyzer

This comment was marked as outdated.

@rust-log-analyzer

This comment was marked as outdated.

@rust-bors

rust-bors Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 3abffe9 failed: CI. Failed jobs:

}
}
}
>>>>>>> a7f33f3f8c9 (c-b: Add `aeabi_u(read|write)(4|8)` intrinsics.)

@thejpster thejpster Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems wrong?

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oof, thanks

@thejpster

Copy link
Copy Markdown
Contributor

The failures there are in ARMv6 targets (dist-arm-linux-gnueabi and dist-armhf-linux).

##[group]Building stage1 library artifacts (stage1:x86_64-unknown-linux-gnu -> stage1:arm-unknown-linux-gnueabihf)
    Updating crates.io index
 Downloading crates ...
  Downloaded addr2line v0.27.1
  Downloaded cc v1.2.0
  Downloaded memchr v2.8.3
  Downloaded miniz_oxide v0.9.1
  Downloaded hashbrown v0.17.1
  Downloaded gimli v0.34.0
  Downloaded object v0.39.1
  Downloaded libc v0.2.189
   Compiling shlex v1.3.0
   Compiling core v0.0.0 (/checkout/library/core)
   Compiling libc v0.2.189
   Compiling object v0.39.1
   Compiling cc v1.2.0
   Compiling std v0.0.0 (/checkout/library/std)
   Compiling test v0.0.0 (/checkout/library/test)
   Compiling compiler_builtins v0.1.160 (/checkout/library/compiler-builtins/compiler-builtins)
   Compiling profiler_builtins v0.0.0 (/checkout/library/profiler_builtins)
warning: profiler_builtins@0.0.0: /checkout/src/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c:567:1: warning: destructor priorities from 0 to 100 are reserved for the implementation
warning: profiler_builtins@0.0.0:  static void llvm_writeout_and_clear(void) {
warning: profiler_builtins@0.0.0:  ^~~~~~
   Compiling rustc-std-workspace-core v1.99.0 (/checkout/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/checkout/library/alloc)
error: <inline asm>:22:1: invalid instruction, any one of the following would fix this:
bx lr
^

note: <inline asm>:22:1: instruction requires: armv4t
bx lr
^

note: <inline asm>:22:1: instruction requires: thumb
bx lr
^

error: invalid instruction, any one of the following would fix this:
   |
note: instantiated into assembly here
  --> <inline asm>:22:1
   |
22 | bx lr
   | ^

note: instruction requires: armv4t
   |
note: instantiated into assembly here
  --> <inline asm>:22:1
   |
22 | bx lr
   | ^

note: instruction requires: thumb
   |
note: instantiated into assembly here
  --> <inline asm>:22:1
   |
22 | bx lr
   | ^

error: could not compile `compiler_builtins` (lib) due to 1 previous error

But those targets have armv4t and thumb features, and the function compiles fine in Godbolt on that target. It's like the code is compiling for ARMv4? I note the other asm examples don't use BX LR to return - they use PUSH { LR } ... POP { PC }, which does work on very old Arm architectures.

@tgross35

Copy link
Copy Markdown
Member Author

For lack of knowing where else to look, I guess @rust-lang/bootstrap do you happen to know if something changed with settings for these jobs between beta and main? Considering the code builds on main as well as the current beta, but seems to be rejected in CI.

@Kobzol

Kobzol commented Sep 16, 2026

Copy link
Copy Markdown
Member

I don't recall anything that might affect this, and the error doesn't ring a bell. Though cc was updated semi-recently, I think.

@tgross35
tgross35 force-pushed the beta-compiler-builtins branch from aa588bb to f4b83bb Compare September 16, 2026 18:33
@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Sep 16, 2026
@tgross35

This comment was marked as outdated.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 16, 2026
[beta] Backports for compiler-builtins


try-job: test-various
try-job: dist-arm-linux-gnueabi
try-job: dist-armhf-linux
try-job: dist-armv7-linux
@rust-log-analyzer

This comment has been minimized.

@tgross35
tgross35 force-pushed the beta-compiler-builtins branch from fbd1b44 to 9ea0e4f Compare September 16, 2026 18:55
@tgross35

Copy link
Copy Markdown
Member Author

@bors try jobs=test-various,dist-arm-linux-gnueabi,dist-armhf-linux,dist-armv7-linux

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 16, 2026
[beta] Backports for compiler-builtins


try-job: test-various
try-job: dist-arm-linux-gnueabi
try-job: dist-armhf-linux
try-job: dist-armv7-linux
@rust-log-analyzer

This comment has been minimized.

@rust-bors

rust-bors Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 28822f9 failed: CI. Failed jobs:

@tgross35

Copy link
Copy Markdown
Member Author

Replicated locally without a full dist build using CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER="clang --target=arm-unknown-linux-gnueabihf" CC_arm_unknown_linux_gnueabihf="clang --target=arm-unknown-linux-gnueabihf" ./x build std --target arm-unknown-linux-gnueabihf (using clang since I'm not on Linux)

@tgross35

Copy link
Copy Markdown
Member Author

Smaller yet: RUSTC_BOOTSTRAP=1 cargo +beta build --target=arm-unknown-linux-gnueabihf --profile=dist -p alloc --manifest-path /Volumes/CaseSensitive/rust/library/sysroot/Cargo.toml. The --profile=dist seems to be load bearing

@tgross35

Copy link
Copy Markdown
Member Author

Reproduced, fails on <=beta but works on nightly https://rust.godbolt.org/z/osb3WW4xW. Asking more on #t-compiler/help > Valid `bx lr` rejected on arm

@rustbot rustbot added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Sep 17, 2026
@tgross35

Copy link
Copy Markdown
Member Author

@bors try jobs=test-various,dist-arm-linux-gnueabi,dist-armhf-linux,dist-armv7-linux

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 17, 2026
[beta] Backports for compiler-builtins


try-job: test-various
try-job: dist-arm-linux-gnueabi
try-job: dist-armhf-linux
try-job: dist-armv7-linux
@rust-bors

rust-bors Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 7243266 (7243266afca61ac4a2c5981cb99b00d4d3e5c813)
Base parent: fba1b05 (fba1b05a7bd8bdc73080edd02f672cef44648267)

folkertdev and others added 5 commits September 17, 2026 03:58
This is a rather old config, added in c924aed0b9ac ("Fix Armv8-M
Baseline compilation"). `thumb_1` is somewhat misleading, since targets
with `thumb2` also support basic `thumb` instructions. Rename it to be
more clear about what this is actually checking.

The config is not currently used but may be in the future.

(cherry picked from commit 5c59263)
We still match on target name because we can't always rely on config
from the unstable `arm_target_feature`. However, we can still assert
that things match up when running in the compiler-builtins CI.

This is disabled for now because it fails on three thumb targets:

* thumbv4t-none-eabi
* thumbv5te-none-eabi
* thumbv6-none-eabi

This will be resolved in a future commit.

Checking for the verbose build is a good indicator that we are in our
CI, rather than any other that might set the `CI` env.

(cherry picked from commit 9e5d248)
@tgross35
tgross35 force-pushed the beta-compiler-builtins branch from f7f5d59 to c174b56 Compare September 17, 2026 03:58
@tgross35 tgross35 added this to the 1.99.0 milestone Sep 17, 2026
@tgross35 tgross35 added the relnotes Marks issues that should be documented in the release notes of the next release. label Sep 17, 2026
@tgross35

tgross35 commented Sep 17, 2026 •

Copy link
Copy Markdown
Member Author

Relnotes specifically for the backport of #160594, #t-compiler/backports > #160594: beta-nominated @ 💬 scratch that, they're opened on that PR now

@tgross35 tgross35 removed the relnotes Marks issues that should be documented in the release notes of the next release. label Sep 17, 2026
@tgross35 tgross35 mentioned this pull request Sep 19, 2026
@cuviper

cuviper commented Sep 19, 2026

Copy link
Copy Markdown
Member

I've added this to #162987.

@tgross35 tgross35 closed this Sep 19, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 19, 2026
@tgross35
tgross35 deleted the beta-compiler-builtins branch September 19, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants