Skip to content

chore: bump to cc@1.4.3 for rustc_llvm and library - #161260

Open
weihanglo wants to merge 4 commits into
rust-lang:mainfrom
weihanglo:cc-1.4.3
Open

chore: bump to cc@1.4.3 for rustc_llvm and library#161260
weihanglo wants to merge 4 commits into
rust-lang:mainfrom
weihanglo:cc-1.4.3

Conversation

@weihanglo

@weihanglo weihanglo commented Aug 17, 2026

Copy link
Copy Markdown
Member

View all comments

What is this?

Old cc-rs derives this from the -Clto rustflag on its own.
cc@1.2.39 starts gating that behind -Clinker-plugin-lto,
which bootstrap doesn't pass.
Therefore,
we need to pass this flag explicitly to keep LTO mode

Previous efforts:

I personally want this because of cc 1.3.0+ has the support of Cargo -Ztrim-paths,
which helps what I am experimenting in #161049.

How to review

Commit by commit.

To keep commits bisect-able,
I added the first commit without cc bump.
clang should be fine with duplicate -flto flags.

One thing I am not certain is whether we should probe -flto flag in this case,
or just make this fail if -flto isn't supported.
(I assume -flto is quote widely supported)

r? Kobzol


🤖 LLM disclosure: I used LLM for the experiment of #161049, but not the bootstrap LTO change in this PR.

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-tidy Area: The tidy tool S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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 Aug 17, 2026
@rustbot

rustbot commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

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

@weihanglo

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

and cc @bjorn3 @Kobzol

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 17, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 17, 2026
chore: bump to cc@1.4.3 for rustc_llvm and library
@rust-bors

rust-bors Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 7256718 (7256718699c6a701d58e50866ab3f86a2ffa8cef)
Base parent: 6d656b1 (6d656b1efca82491a110b476ac9bbe712628ccb6)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (7256718): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

This perf run didn't have relevant results for this metric.

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 468.493s -> 459.635s (-1.89%)
Artifact size: 398.93 MiB -> 398.87 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 17, 2026
@weihanglo

Copy link
Copy Markdown
Member Author

@Kobzol od you know why there is no result? I guess because GitHub was down?

@weihanglo

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 17, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 17, 2026
chore: bump to cc@1.4.3 for rustc_llvm and library
@rust-bors

rust-bors Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 52a6c34 (52a6c343ae344ec730508ef19f1eb62167f1b4ad)
Base parent: e702eca (e702ecae8a3e3756e8a499f8592be1e3efac0e8f)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (52a6c34): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (secondary 1.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.6% [0.6%, 2.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

This perf run didn't have relevant results for this metric.

Binary size

Results (primary 0.1%, secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.1%] 75
Regressions ❌
(secondary)
0.1% [0.0%, 0.1%] 114
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.1%] 75

Bootstrap: 457.751s -> 457.734s (-0.00%)
Artifact size: 398.90 MiB -> 398.92 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 18, 2026
@weihanglo

Copy link
Copy Markdown
Member Author

Ah. I see. No relevant largely means insignificant. Then I think this is ready.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 18, 2026
@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 Aug 19, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 19, 2026
chore: bump to cc@1.4.3 for rustc_llvm and library



### What is this?

Old cc-rs derives this from the `-Clto` rustflag on its own.
`cc@1.2.39` starts gating that behind `-Clinker-plugin-lto`,
which bootstrap doesn't pass.
Therefore,
we need to pass this flag explicitly to keep LTO mode

Previous efforts:

* #146186
* #155438

I personally want this because of cc 1.3.0+ has the support of Cargo `-Ztrim-paths`,
which helps what I am experimenting in <#161049>.

### How to review

Commit by commit. 

To keep commits bisect-able,
I added the first commit without cc bump.
clang should be fine with duplicate `-flto` flags.

One thing I am not certain is whether we should probe `-flto` flag in this case,
or just make this fail if `-flto` isn't supported.
(I assume `-flto` is quote widely supported)

r? Kobzol

---

🤖 **LLM disclosure:** I used LLM for the experiment of <#161049>, but not the bootstrap LTO change in this PR.
@rust-bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 19, 2026
@rust-bors

rust-bors Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

💔 Test for ddaaa13 failed: CI. Failed job:

@weihanglo

Copy link
Copy Markdown
Member Author

Oh, no. Still failed.

@rustbot author

@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 Aug 19, 2026
@weihanglo

Copy link
Copy Markdown
Member Author
  configure:3111: clang -O3 -ffunction-sections -fdata-sections -fPIC --target=aarch64-unknown-linux-gnu -fprofile-generate=/tmp/tmp-multistage/opt-artifacts/rustc-pgo -fembed-bitcode=all -fdebug-prefix-map=/checkout=/rustc/ddaaa135e3858b8f39f80c8d25184560a6a9fd37 -flto=thin -O3 -ffunction-sections -fdata-sections -fPIC --target=aarch64-unknown-linux-gnu -fprofile-generate=/tmp/tmp-multistage/opt-artifacts/rustc-pgo -fembed-bitcode=all -fdebug-prefix-map=/checkout=/rustc/ddaaa135e3858b8f39f80c8d25184560a6a9fd37 -flto=thin -O3 -ffunction-sections -fdata-sections -fPIC --target=aarch64-unknown-linux-gnu -fprofile-generate=/tmp/tmp-multistage/opt-artifacts/rustc-pgo -fembed-bitcode=all -fdebug-prefix-map=/checkout=/rustc/ddaaa135e3858b8f39f80c8d25184560a6a9fd37 -flto=thin conftest.c  >&5
  /usr/bin/ld: /rustroot/bin/../lib/LLVMgold.so: error loading plugin: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.11' not found (required by /rustroot/bin/../lib/LLVMgold.so)
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

Did that mean to provide CXXABI_1.3.11 we need some similar hack added in #134690 like this, as the system libstdc++ is outdated?

# FIXME: Without this, LLVMgold.so incorrectly resolves to the system
# libstdc++, instead of the one we build.
ENV LD_PRELOAD=/rustroot/lib64/libstdc++.so.6

Just like what we did for x86_64 in PR 134690
Old cc-rs derives this from the `-Clto` rustflag on its own.
`cc@1.2.39` starts gating that behind `-Clinker-plugin-lto`,
which bootstrap doesn't pass.
Therefore,
we need to pass this flag explicitly to keep LTO mode
Also pulls in

* find-msvc-tools 0.1.5 -> 0.1.11
* shlex 2.0.1 (new transitive dep of cc)
Also pulls in

* find-msvc-tools 0.1.5 -> 0.1.11
* shlex 1.3.0 -> 2.0.1
@rustbot rustbot added A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Aug 20, 2026
@weihanglo

Copy link
Copy Markdown
Member Author

@bors try jobs=dist-aarch64-linux @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 20, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 20, 2026
chore: bump to cc@1.4.3 for rustc_llvm and library


try-job: dist-aarch64-linux
@rust-bors

rust-bors Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: a5859e2 (a5859e2a19c9cca181acab527d5003db8ae6e560)
Base parent: f7d782a (f7d782a3be46d6bb4b9792fe69a61db389ba1769)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (a5859e2): comparison URL.

Overall result: no relevant changes - BENCHMARK(S) FAILED

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

❗ ❗ ❗ ❗ ❗
Warning ⚠️: The following benchmark(s) failed to build:

  • Job failure

❗ ❗ ❗ ❗ ❗

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

This perf run didn't have relevant results for this metric.

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: missing data
Artifact size: missing data

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 20, 2026
@Kobzol

Kobzol commented Aug 20, 2026

Copy link
Copy Markdown
Member

(The try build didn't contain artifacts for x64, so the perf. run failed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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. T-infra Relevant to the infrastructure 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