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

Build GCC on CI with GCC, not Clang #138451

Merged
merged 6 commits into from
Mar 15, 2025
Merged

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Mar 13, 2025

It seems that GCC built with Clang misbehaves. I have tested that cg_gcc tests pass on CI with a downloaded GCC that was built in this way.

Prerequisite for #138395.

r? @ghost

@rustbot rustbot added 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-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Mar 13, 2025
@rustbot
Copy link
Collaborator

rustbot commented Mar 13, 2025

This PR changes how GCC is built. Consider updating src/bootstrap/download-ci-gcc-stamp.

@Kobzol
Copy link
Contributor Author

Kobzol commented Mar 13, 2025

@bors try

@bors
Copy link
Collaborator

bors commented Mar 13, 2025

⌛ Trying commit a1e034a with merge 94e2839...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 13, 2025
Build GCC on CI with GCC, not Clang

It seems that GCC built with Clang misbehaves.

Prerequisite for rust-lang#138395.

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Mar 13, 2025

☀️ Try build successful - checks-actions
Build commit: 94e2839 (94e2839e4fb889d033894be1226b47344ce1a17f)

@rustbot
Copy link
Collaborator

rustbot commented Mar 13, 2025

Some changes occurred in src/tools/opt-dist

cc @Kobzol

@Kobzol
Copy link
Contributor Author

Kobzol commented Mar 13, 2025

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 13, 2025
Build GCC on CI with GCC, not Clang

It seems that GCC built with Clang misbehaves.

Prerequisite for rust-lang#138395.

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Mar 13, 2025

⌛ Trying commit 545c5d3 with merge fb4237b...

@bors
Copy link
Collaborator

bors commented Mar 13, 2025

☀️ Try build successful - checks-actions
Build commit: fb4237b (fb4237bc14be8ce17d45c5221b52c3e792546032)

@rustbot
Copy link
Collaborator

rustbot commented Mar 13, 2025

This PR modifies config.example.toml.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

@Kobzol Kobzol marked this pull request as draft March 13, 2025 18:49
@Kobzol Kobzol force-pushed the gcc-ci-build-gcc branch from 74bb463 to 38fc116 Compare March 13, 2025 20:33
@Kobzol Kobzol marked this pull request as ready for review March 13, 2025 20:33
@Kobzol
Copy link
Contributor Author

Kobzol commented Mar 13, 2025

r? @GuillaumeGomez

Copy link
Member

@GuillaumeGomez GuillaumeGomez left a comment

Choose a reason for hiding this comment

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

Apart from @antoyo's comment, looks good to me. Thanks!

@Kobzol
Copy link
Contributor Author

Kobzol commented Mar 14, 2025

Added a commit that checks if we don't compile GCC with Clang, and removed the flags.

Copy link
Member

@GuillaumeGomez GuillaumeGomez left a comment

Choose a reason for hiding this comment

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

Looks all good to me, thanks! r=me once CI pass

@Kobzol
Copy link
Contributor Author

Kobzol commented Mar 14, 2025

@bors r=GuillaumeGomez

@bors
Copy link
Collaborator

bors commented Mar 14, 2025

📌 Commit bf095f6 has been approved by GuillaumeGomez

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 Mar 14, 2025
@nikic
Copy link
Contributor

nikic commented Mar 14, 2025

It seems that GCC built with Clang misbehaves.

Is there a bug report for that?

@Kobzol
Copy link
Contributor Author

Kobzol commented Mar 14, 2025

We think that the specific instance that we hit was https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117952, or something similar.

But more generally, I expect that building GCC with Clang would require various workarounds and have quirks, we already had to modify compiler flags to even get it to compile.

So just using GCC as the host compiler should be a more robust choice in the future.

jhpratt added a commit to jhpratt/rust that referenced this pull request Mar 14, 2025
…meGomez

Build GCC on CI with GCC, not Clang

It seems that GCC built with Clang misbehaves. I have tested that cg_gcc tests [pass](https://github.com/rust-lang/rust/actions/runs/13842365913/job/38732750617?pr=138451) on CI with a downloaded GCC that was built in this way.

Prerequisite for rust-lang#138395.

r? `@ghost`
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 14, 2025
Rollup of 6 pull requests

Successful merges:

 - rust-lang#134720 (Display valid crate types in error message for --crate-type flag)
 - rust-lang#137424 (uefi: helpers: Add DevicePathNode abstractions)
 - rust-lang#137736 (Don't attempt to export compiler-builtins symbols from rust dylibs)
 - rust-lang#138451 (Build GCC on CI with GCC, not Clang)
 - rust-lang#138454 (Improve post-merge workflow)
 - rust-lang#138477 (Deny impls for `BikeshedGuaranteedNoDrop`)

r? `@ghost`
`@rustbot` modify labels: rollup
fmease added a commit to fmease/rust that referenced this pull request Mar 14, 2025
…meGomez

Build GCC on CI with GCC, not Clang

It seems that GCC built with Clang misbehaves. I have tested that cg_gcc tests [pass](https://github.com/rust-lang/rust/actions/runs/13842365913/job/38732750617?pr=138451) on CI with a downloaded GCC that was built in this way.

Prerequisite for rust-lang#138395.

r? ``@ghost``
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 14, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang#138056 (rustc_target: Add target features for LoongArch v1.1)
 - rust-lang#138349 (Emit function declarations for functions with `#[linkage="extern_weak"]`)
 - rust-lang#138451 (Build GCC on CI with GCC, not Clang)
 - rust-lang#138454 (Improve post-merge workflow)
 - rust-lang#138460 (Pass struct field HirId when check_expr_struct_fields)
 - rust-lang#138482 (Fix HIR printing of parameters)
 - rust-lang#138507 (Mirror NetBSD sources)
 - rust-lang#138511 (Make `Parser::parse_expr_cond` public)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 15, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang#138056 (rustc_target: Add target features for LoongArch v1.1)
 - rust-lang#138451 (Build GCC on CI with GCC, not Clang)
 - rust-lang#138454 (Improve post-merge workflow)
 - rust-lang#138460 (Pass struct field HirId when check_expr_struct_fields)
 - rust-lang#138474 (Refactor is_snake_case.)
 - rust-lang#138482 (Fix HIR printing of parameters)
 - rust-lang#138507 (Mirror NetBSD sources)
 - rust-lang#138511 (Make `Parser::parse_expr_cond` public)
 - rust-lang#138518 (Fix typo in hir lowering lint diag)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit fc7ac81 into rust-lang:master Mar 15, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 15, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 15, 2025
Rollup merge of rust-lang#138451 - Kobzol:gcc-ci-build-gcc, r=GuillaumeGomez

Build GCC on CI with GCC, not Clang

It seems that GCC built with Clang misbehaves. I have tested that cg_gcc tests [pass](https://github.com/rust-lang/rust/actions/runs/13842365913/job/38732750617?pr=138451) on CI with a downloaded GCC that was built in this way.

Prerequisite for rust-lang#138395.

r? ```@ghost```
@Kobzol Kobzol deleted the gcc-ci-build-gcc branch March 15, 2025 06:11
@nikic
Copy link
Contributor

nikic commented Mar 15, 2025

We think that the specific instance that we hit was https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117952, or something similar.

Thanks, so this is just working around a GCC bug. Just wanted to make sure it's not Clang miscompiling GCC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc 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-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.

6 participants