Skip to content

Build GCC on CI with GCC, not Clang - #138451

Merged
bors merged 6 commits into
rust-lang:masterfrom
Kobzol:gcc-ci-build-gcc
Mar 15, 2025
Merged

Build GCC on CI with GCC, not Clang#138451
bors merged 6 commits into
rust-lang:masterfrom
Kobzol:gcc-ci-build-gcc

Conversation

@Kobzol

@KobzolKobzol commented Mar 13, 2025

Copy link
Copy Markdown
Member

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

@rustbotrustbot 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
Copy Markdown
Collaborator

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

@Kobzol

Copy link
Copy Markdown
MemberAuthor

@bors try

@bors

bors commented Mar 13, 2025

Copy link
Copy Markdown
Collaborator

⌛ 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

bors commented Mar 13, 2025

Copy link
Copy Markdown
Collaborator

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

@rustbot

Copy link
Copy Markdown
Collaborator

Some changes occurred in src/tools/opt-dist

cc @Kobzol

@Kobzol

Copy link
Copy Markdown
MemberAuthor

@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

bors commented Mar 13, 2025

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 545c5d3 with merge fb4237b...

@bors

bors commented Mar 13, 2025

Copy link
Copy Markdown
Collaborator

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

@rustbot

Copy link
Copy Markdown
Collaborator

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 marked this pull request as ready for review March 13, 2025 20:33
@Kobzol

Copy link
Copy Markdown
MemberAuthor

r? @GuillaumeGomez

Comment threadsrc/bootstrap/src/core/build_steps/gcc.rs Outdated

@GuillaumeGomezGuillaumeGomez left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

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

@GuillaumeGomezGuillaumeGomez left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

@bors r=GuillaumeGomez

@bors

bors commented Mar 14, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit bf095f6 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@borsbors 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
Copy Markdown
Contributor

It seems that GCC built with Clang misbehaves.

Is there a bug report for that?

@Kobzol

Kobzol commented Mar 14, 2025

Copy link
Copy Markdown
MemberAuthor

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`
@jhprattjhpratt mentioned this pull request Mar 14, 2025
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``
@fmeasefmease mentioned this pull request Mar 14, 2025
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
@fmeasefmease mentioned this pull request Mar 14, 2025
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:masterMar 15, 2025
@rustbotrustbot 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
Copy Markdown
Contributor

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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-testsuiteArea: The testsuite used to check the correctness of rustcS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-infraRelevant 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

@Kobzol@rustbot@bors@nikic@antoyo@GuillaumeGomez