Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Rollup of 7 pull requests #136712

Closed
wants to merge 16 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

wesleywiser and others added 16 commits February 6, 2025 04:25
Currently, when rustc compiles code with `-Clto` enabled that was built
with different choices for `-Zdwarf-version`, a warning will be
reported. It's very easy to observe this by compiling most anything (eg,
"hello world") and specifying `-Clto -Zdwarf-version=5` since the
standard library is distributed with `-Zdwarf-version=4`.

This behavior isn't actually useful for a few reasons:
- from observation, LLVM chooses to pick the highest DWARF version
  anyway after issuing the warning
- Clang specifies that in this case, the max version should be picked
  without a warning and as a general principle, we want to support
  x-lang LTO with Clang which implies using the same module flag merge
  behaviors
- Debuggers need to be able to handle a variety of versions withing the
  same debugging session as you can easily have some parts of a binary
  (or some dynamic libraries within an application) all compiled with
  different DWARF versions

This commit changes the module flag merge behavior to match Clang and
use the highest version of DWARF. It also adds a test to ensure this
behavior is respected in the case of two crates being LTO'd together and
updates the test added in the previous commit to ensure no warning is
printed.
This is the same as Linkage::Internal except that it doesn't emit any
symbol. Some backends may not support it and it isn't all that useful
anyway.
It can only be used for certain LLVM internal variables like
llvm.global_ctors which users are not allowed to define.
…ompiler-errors

Debuginfo for function ZSTs should have alignment of 8 bits, not 1 bit

In rust-lang#116096, function ZSTs were made to have debuginfo that gives them an alignment of “1”. But because alignment in LLVM debuginfo is denoted in *bits*, not bytes, this resulted in an alignment specification of 1 bit instead of 1 byte.

I don't know whether this has any practical consequences, but I noticed that a test started failing when I accidentally fixed the mistake while working on rust-lang#136632, so I extracted the fix (and the test adjustment) to this PR.
…wesleywiser

Add a missing `//@ needs-symlink` to `tests/run-make/libs-through-symlinks`

r? `@wesleywiser` (since you [found it](https://rust-lang.zulipchat.com/#narrow/channel/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202025-02-06/near/498173394) :P or reroll)
Label mismatched parameters at the def site for foreign functions

Nice and simple. Adds parameter marking for the only missing definition type.

r? `@compiler-errors`
…e_behavior, r=jieyouxu

Pick the max DWARF version when LTO'ing modules with different versions

Currently, when rustc compiles code with `-Clto` enabled that was built
with different choices for `-Zdwarf-version`, a warning will be
reported. It's very easy to observe this by compiling most anything (eg,
"hello world") and specifying `-Clto -Zdwarf-version=5` since the
standard library is distributed with `-Zdwarf-version=4`.

This behavior isn't actually useful for a few reasons:
- From observation, LLVM chooses to pick the highest DWARF version
  anyway after issuing the warning.
- Clang specifies that in this case, the max version should be picked
  without a warning and as a general principle, we want to support
  x-lang LTO with Clang which implies using the same module flag merge
  behaviors.
- Debuggers need to be able to handle a variety of versions within the
  same debugging session as you can easily have some parts of a binary
  (or some dynamic libraries within an application) all compiled with
  different DWARF versions.

This commit changes the module flag merge behavior to match Clang and
use the highest version of DWARF. It also adds a test to ensure this
behavior is respected in the case of two crates being LTO'd together and
adds a test to ensure no warning is printed.

Fixes rust-lang#130041 which fails due to these warnings being printed

cc rust-lang#103057
Remove Linkage::Private and Linkage::Appending

Neither of them has any use case. Neither known nor theoretical.
…s-for-bootstrap-utils-exec, r=onur-ozkan

add module level doc for bootstrap:utils:exec

This PR adds module level doc for bootstrap utils/exec module
i686-unknown-hurd-gnu: bump baseline CPU to Pentium 4

See rust-lang#136495 for context. `@sthibaul` (the only listed target maintainer) said they would be [fine](rust-lang#136495 (comment)) with this change.
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs 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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Feb 7, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Feb 7, 2025

📌 Commit 3d2d7d7 has been approved by matthiaskrgr

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 Feb 7, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 7, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#136640 (Debuginfo for function ZSTs should have alignment of 8 bits, not 1 bit)
 - rust-lang#136648 (Add a missing `//@ needs-symlink` to `tests/run-make/libs-through-symlinks`)
 - rust-lang#136651 (Label mismatched parameters at the def site for foreign functions)
 - rust-lang#136659 (Pick the max DWARF version when LTO'ing modules with different versions )
 - rust-lang#136691 (Remove Linkage::Private and Linkage::Appending)
 - rust-lang#136692 (add module level doc for bootstrap:utils:exec)
 - rust-lang#136700 (i686-unknown-hurd-gnu: bump baseline CPU to Pentium 4)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Feb 7, 2025

⌛ Testing commit 3d2d7d7 with merge d032cf0...

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
failures:

---- [assembly] tests/assembly/dwarf-mixed-versions-lto.rs stdout ----

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/checkout/obj/build/aarch64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--input-file" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/assembly/dwarf-mixed-versions-lto/dwarf-mixed-versions-lto.s" "/checkout/tests/assembly/dwarf-mixed-versions-lto.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
--- stderr -------------------------------
/checkout/tests/assembly/dwarf-mixed-versions-lto.rs:19:11: error: CHECK: expected string not found in input
/checkout/tests/assembly/dwarf-mixed-versions-lto.rs:19:11: error: CHECK: expected string not found in input
// CHECK: .short 5
          ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/assembly/dwarf-mixed-versions-lto/dwarf-mixed-versions-lto.s:105358:22: note: scanning from here
 .section .debug_info,"",@progbits
                     ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/assembly/dwarf-mixed-versions-lto/dwarf-mixed-versions-lto.s:105362:2: note: possible intended match here
 .hword 5


Input file: /checkout/obj/build/aarch64-unknown-linux-gnu/test/assembly/dwarf-mixed-versions-lto/dwarf-mixed-versions-lto.s
Check file: /checkout/tests/assembly/dwarf-mixed-versions-lto.rs

-dump-input=help explains the following input dump.
Input was:
<<<<<<
            .
            .
            .
            .
       105258:  .byte 89 
       105259:  .byte 11 
       105260:  .byte 87 
       105261:  .byte 11 
       105262:  .byte 0 
       105263:  .byte 0 
       105264:  .byte 16 
       105265:  .byte 47 
       105266:  .byte 0 
       105267:  .byte 73 
       105268:  .byte 19 
       105269:  .byte 3 
       105270:  .byte 37 
       105271:  .byte 0 
       105272:  .byte 0 
       105273:  .byte 17 
       105274:  .byte 21 
       105275:  .byte 0 
       105276:  .byte 0 
       105277:  .byte 0 
       105278:  .byte 18 
       105279:  .byte 46 
       105280:  .byte 1 
       105281:  .byte 110 
       105282:  .byte 37 
       105283:  .byte 3 
       105284:  .byte 37 
       105285:  .byte 58 
       105286:  .byte 11 
       105287:  .byte 59 
       105288:  .byte 11 
       105289:  .byte 32 
       105290:  .byte 33 
       105291:  .byte 1 
       105292:  .byte 0 
       105293:  .byte 0 
       105294:  .byte 19 
       105295:  .byte 5 
       105296:  .byte 0 
       105297:  .byte 58 
       105298:  .byte 11 
       105299:  .byte 59 
       105300:  .byte 11 
       105301:  .byte 73 
       105302:  .byte 19 
       105303:  .byte 0 
       105304:  .byte 0 
       105305:  .byte 20 
       105306:  .byte 46 
       105307:  .byte 1 
       105308:  .byte 110 
       105309:  .byte 37 
       105310:  .byte 3 
       105311:  .byte 37 
       105312:  .byte 58 
       105313:  .byte 11 
       105314:  .byte 59 
       105315:  .byte 5 
       105316:  .byte 32 
       105317:  .byte 33 
       105318:  .byte 1 
       105319:  .byte 0 
       105320:  .byte 0 
       105321:  .byte 21 
       105322:  .byte 52 
       105323:  .byte 0 
       105324:  .byte 3 
       105325:  .byte 37 
       105326:  .ascii "\210\001" 
       105327:  .byte 15 
       105328:  .byte 58 
       105329:  .byte 11 
       105330:  .byte 59 
       105331:  .byte 5 
       105332:  .byte 73 
       105333:  .byte 19 
       105334:  .byte 0 
       105335:  .byte 0 
       105336:  .byte 22 
       105337:  .byte 46 
       105338:  .byte 0 
       105339:  .byte 17 
       105340:  .byte 27 
       105341:  .byte 18 
       105342:  .byte 6 
       105343:  .byte 64 
       105344:  .byte 24 
       105345:  .byte 110 
       105346:  .byte 37 
       105347:  .byte 3 
       105348:  .byte 37 
       105349:  .byte 58 
       105350:  .byte 11 
       105351:  .byte 59 
       105352:  .byte 11 
       105353:  .byte 106 
       105354:  .byte 25 
       105355:  .byte 0 
       105356:  .byte 0 
       105357:  .byte 0 
       105358:  .section .debug_info,"",@progbits 
check:19'0                          X~~~~~~~~~~~~~ error: no match found
       105359: .Lcu_begin0: 
check:19'0     ~~~~~~~~~~~~~
       105360:  .word .Ldebug_info_end0-.Ldebug_info_start0 
check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       105361: .Ldebug_info_start0: 
check:19'0     ~~~~~~~~~~~~~~~~~~~~~
       105362:  .hword 5 
check:19'0     ~~~~~~~~~~
check:19'1      ?         possible intended match
       105363:  .byte 1 
check:19'0     ~~~~~~~~~
       105364:  .byte 8 
check:19'0     ~~~~~~~~~
       105365:  .word .debug_abbrev 
check:19'0     ~~~~~~~~~~~~~~~~~~~~~
       105366:  .byte 1 
check:19'0     ~~~~~~~~~
       105367:  .byte 0 
check:19'0     ~~~~~~~~~
       105368:  .hword 28 
check:19'0     ~~~~~~~~~~~
       105369:  .byte 1 
check:19'0     ~~~~~~~~~
       105370:  .word .Lstr_offsets_base0 
check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
       105371:  .word .Lline_table_start0 
check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
       105372:  .byte 2 
check:19'0     ~~~~~~~~~
       105373:  .xword 0 
check:19'0     ~~~~~~~~~~
       105374:  .byte 0 
check:19'0     ~~~~~~~~~
       105375:  .word .Laddr_table_base0 
check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
       105376:  .word .Lrnglists_table_base0 
check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       105377:  .word .Lloclists_table_base0 
check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       105378:  .byte 2 
check:19'0     ~~~~~~~~~
       105379:  .byte 3 
check:19'0     ~~~~~~~~~
       105380:  .word 53 
check:19'0     ~~~~~~~~~~
       105381:  .byte 3 
check:19'0     ~~~~~~~~~
       105382:  .word 134 
check:19'0     ~~~~~~~~~~~
       105383:  .byte 19 
check:19'0     ~~~~~~~~~~
       105384:  .byte 48 
check:19'0     ~~~~~~~~~~
       105385:  .byte 8 
check:19'0     ~~~~~~~~~
       105386:  .byte 4 
check:19'0     ~~~~~~~~~
       105387:  .byte 4 
check:19'0     ~~~~~~~~~
       105388:  .word 110 
check:19'0     ~~~~~~~~~~~
       105389:  .byte 8 
check:19'0     ~~~~~~~~~
       105390:  .byte 0 
check:19'0     ~~~~~~~~~
       105391:  .byte 4 
check:19'0     ~~~~~~~~~
       105392:  .byte 7 
check:19'0     ~~~~~~~~~
       105393:  .word 124 
check:19'0     ~~~~~~~~~~~
       105394:  .byte 8 
check:19'0     ~~~~~~~~~
       105395:  .byte 8 
check:19'0     ~~~~~~~~~
       105396:  .byte 4 
check:19'0     ~~~~~~~~~
       105397:  .byte 9 
check:19'0     ~~~~~~~~~
       105398:  .word 124 
check:19'0     ~~~~~~~~~~~
       105399:  .byte 8 
check:19'0     ~~~~~~~~~
       105400:  .byte 16 
check:19'0     ~~~~~~~~~~
       105401:  .byte 4 
check:19'0     ~~~~~~~~~
       105402:  .byte 10 
check:19'0     ~~~~~~~~~~
       105403:  .word 110 
check:19'0     ~~~~~~~~~~~
       105404:  .byte 8 
check:19'0     ~~~~~~~~~
       105405:  .byte 24 
check:19'0     ~~~~~~~~~~
       105406:  .byte 4 
check:19'0     ~~~~~~~~~
       105407:  .byte 11 
check:19'0     ~~~~~~~~~~
       105408:  .word 110 
check:19'0     ~~~~~~~~~~~
       105409:  .byte 8 
check:19'0     ~~~~~~~~~
       105410:  .byte 32 
check:19'0     ~~~~~~~~~~
       105411:  .byte 4 
check:19'0     ~~~~~~~~~
       105412:  .byte 12 
check:19'0     ~~~~~~~~~~
       105413:  .word 110 
check:19'0     ~~~~~~~~~~~
       105414:  .byte 8 
check:19'0     ~~~~~~~~~
       105415:  .byte 40 
check:19'0     ~~~~~~~~~~
       105416:  .byte 0 
check:19'0     ~~~~~~~~~
       105417:  .byte 5 
check:19'0     ~~~~~~~~~
       105418:  .word 120 
check:19'0     ~~~~~~~~~~~
       105419:  .byte 6 
check:19'0     ~~~~~~~~~
       105420:  .word 0 
check:19'0     ~~~~~~~~~
       105421:  .byte 6 
check:19'0     ~~~~~~~~~
       105422:  .byte 5 
check:19'0     ~~~~~~~~~
       105423:  .byte 7 
check:19'0     ~~~~~~~~~
       105424:  .byte 0 
check:19'0     ~~~~~~~~~
       105425:  .byte 6 
check:19'0     ~~~~~~~~~
       105426:  .byte 8 
check:19'0     ~~~~~~~~~
       105427:  .byte 7 
check:19'0     ~~~~~~~~~
       105428:  .byte 8 
check:19'0     ~~~~~~~~~
       105429:  .byte 7 
check:19'0     ~~~~~~~~~
       105430:  .byte 13 
check:19'0     ~~~~~~~~~~
       105431:  .byte 7 
check:19'0     ~~~~~~~~~
       105432:  .byte 14 
check:19'0     ~~~~~~~~~~
       105433:  .byte 7 
check:19'0     ~~~~~~~~~
       105434:  .byte 15 
check:19'0     ~~~~~~~~~~
       105435:  .byte 8 
check:19'0     ~~~~~~~~~
       105436:  .byte 18 
check:19'0     ~~~~~~~~~~
       105437:  .byte 8 
check:19'0     ~~~~~~~~~
       105438:  .byte 8 
check:19'0     ~~~~~~~~~
       105439:  .byte 4 
check:19'0     ~~~~~~~~~
       105440:  .byte 16 
check:19'0     ~~~~~~~~~~
       105441:  .word 240 
check:19'0     ~~~~~~~~~~~
       105442:  .byte 8 
check:19'0     ~~~~~~~~~
       105443:  .byte 0 
check:19'0     ~~~~~~~~~
       105444:  .byte 0 
check:19'0     ~~~~~~~~~
       105445:  .byte 0 
check:19'0     ~~~~~~~~~
       105446:  .byte 0 
check:19'0     ~~~~~~~~~
       105447:  .byte 7 
check:19'0     ~~~~~~~~~
       105448:  .byte 33 
check:19'0     ~~~~~~~~~~
       105449:  .byte 7 
check:19'0     ~~~~~~~~~
       105450:  .byte 34 
check:19'0     ~~~~~~~~~~
       105451:  .byte 9 
check:19'0     ~~~~~~~~~
       105452:  .byte 0 
check:19'0     ~~~~~~~~~
       105453:  .word .Lfunc_end0-.Lfunc_begin0 
check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       105454:  .byte 1 
check:19'0     ~~~~~~~~~
       105455:  .byte 111 
check:19'0     ~~~~~~~~~~~
       105456:  .byte 37 
check:19'0     ~~~~~~~~~~
       105457:  .byte 38 
check:19'0     ~~~~~~~~~~
       105458:  .byte 1 
check:19'0     ~~~~~~~~~
       105459:  .byte 148 
check:19'0     ~~~~~~~~~~~
       105460:  .byte 10 
check:19'0     ~~~~~~~~~~
       105461:  .byte 0 
check:19'0     ~~~~~~~~~
       105462:  .byte 40 
check:19'0     ~~~~~~~~~~
            .
            .
>>>>>>
------------------------------------------

@bors
Copy link
Contributor

bors commented Feb 8, 2025

💔 Test failed - checks-actions

@bors bors 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 Feb 8, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs rollup A PR which is a rollup 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-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.