Skip to content

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Sep 8, 2025

The symbols __isPlatformVersionAtLeast and __isOSVersionAtLeast. This should allow linking both compiler-rt and std, which fixes #138944 (comment).

r? tgross35
CC @zmodem, could you please verify that this works for you?

The symbols __isPlatformVersionAtLeast and __isOSVersionAtLeast.

This allows the user to link both compiler_rt and std.
@rustbot rustbot added O-apple Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS) 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 8, 2025
@tgross35
Copy link
Contributor

tgross35 commented Sep 8, 2025

Whoops, I should have caught this during review. Thanks for the fix!

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 8, 2025

📌 Commit fe6f8cc has been approved by tgross35

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 Sep 8, 2025
@tgross35
Copy link
Contributor

tgross35 commented Sep 8, 2025

@madsmtm if you get the chance, could you run nm on std built with this patch? Just to verify they are indeed marked weak, I assume this will work but I'm not positive about the interaction with rustc_std_internal_symbol.

@madsmtm
Copy link
Contributor Author

madsmtm commented Sep 8, 2025

Whoops, I should have caught this during review.

No problem! I actually included it in the initial version of the PR, but I think I got confused about what #[rustc_std_internal_symbol] did, and thought it wasn't needed anymore.

could you run nm on std built with this patch

$ objdump -t build/host/stage1-std/aarch64-apple-darwin/release/deps/libstd-*.dylib | rg "__isPlatformVersionAtLeast|__isOSVersionAtLeast"
000000000003179c      d  *UND* ___isOSVersionAtLeast
0000000000031824      d  *UND* ___isPlatformVersionAtLeast
000000000003179c  w    F __TEXT,__text ___isOSVersionAtLeast
0000000000031824  w    F __TEXT,__text ___isPlatformVersionAtLeast

(I think the w indicates that these are weak symbols).

jhpratt added a commit to jhpratt/rust that referenced this pull request Sep 8, 2025
…ross35

Weakly export `platform_version` symbols

The symbols `__isPlatformVersionAtLeast` and `__isOSVersionAtLeast`. This should allow linking both `compiler-rt` and `std`, which fixes rust-lang#138944 (comment).

r? tgross35
CC `@zmodem,` could you please verify that this works for you?
bors added a commit that referenced this pull request Sep 8, 2025
Rollup of 11 pull requests

Successful merges:

 - #145177 (std: move `thread` into `sys`)
 - #146018 (compiler: Add Windows resources to rustc-main and rustc_driver)
 - #146025 (compiler: Include span of too huge array with `-Cdebuginfo=2`)
 - #146184 (In the rustc_llvm build script, don't consider arm64* to be 32-bit)
 - #146195 (fix partial urlencoded link support)
 - #146300 (Implement `Sum` and `Product` for `f16` and `f128`.)
 - #146314 (mark `format_args_nl!` as `#[doc(hidden)]`)
 - #146324 (const-eval: disable pointer fragment support)
 - #146326 (simplify the declaration of the legacy integer modules (`std::u32` etc.))
 - #146339 (Update books)
 - #146343 (Weakly export `platform_version` symbols)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 9, 2025
…ross35

Weakly export `platform_version` symbols

The symbols `__isPlatformVersionAtLeast` and `__isOSVersionAtLeast`. This should allow linking both `compiler-rt` and `std`, which fixes rust-lang#138944 (comment).

r? tgross35
CC ```@zmodem,``` could you please verify that this works for you?
bors added a commit that referenced this pull request Sep 9, 2025
Rollup of 11 pull requests

Successful merges:

 - #139593 (add sitemap to rust docs)
 - #145819 (Port limit attributes to the new attribute parsing infrastructure)
 - #146025 (compiler: Include span of too huge array with `-Cdebuginfo=2`)
 - #146184 (In the rustc_llvm build script, don't consider arm64* to be 32-bit)
 - #146195 (fix partial urlencoded link support)
 - #146300 (Implement `Sum` and `Product` for `f16` and `f128`.)
 - #146314 (mark `format_args_nl!` as `#[doc(hidden)]`)
 - #146324 (const-eval: disable pointer fragment support)
 - #146326 (simplify the declaration of the legacy integer modules (`std::u32` etc.))
 - #146339 (Update books)
 - #146343 (Weakly export `platform_version` symbols)

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

zmodem commented Sep 9, 2025

CC @zmodem, could you please verify that this works for you?

It seems like it should. It's easiest to wait for this to land, then our CI will pick it up automatically.

bors added a commit that referenced this pull request Sep 9, 2025
Rollup of 11 pull requests

Successful merges:

 - #139593 (add sitemap to rust docs)
 - #145819 (Port limit attributes to the new attribute parsing infrastructure)
 - #146025 (compiler: Include span of too huge array with `-Cdebuginfo=2`)
 - #146184 (In the rustc_llvm build script, don't consider arm64* to be 32-bit)
 - #146195 (fix partial urlencoded link support)
 - #146300 (Implement `Sum` and `Product` for `f16` and `f128`.)
 - #146314 (mark `format_args_nl!` as `#[doc(hidden)]`)
 - #146324 (const-eval: disable pointer fragment support)
 - #146326 (simplify the declaration of the legacy integer modules (`std::u32` etc.))
 - #146339 (Update books)
 - #146343 (Weakly export `platform_version` symbols)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 8b9ea58 into rust-lang:master Sep 9, 2025
10 checks passed
rust-timer added a commit that referenced this pull request Sep 9, 2025
Rollup merge of #146343 - madsmtm:fix-platform_version, r=tgross35

Weakly export `platform_version` symbols

The symbols `__isPlatformVersionAtLeast` and `__isOSVersionAtLeast`. This should allow linking both `compiler-rt` and `std`, which fixes #138944 (comment).

r? tgross35
CC ``@zmodem,`` could you please verify that this works for you?
@rustbot rustbot added this to the 1.91.0 milestone Sep 9, 2025
@zmodem
Copy link
Contributor

zmodem commented Sep 10, 2025

CC @zmodem, could you please verify that this works for you?

Confirmed, the CI turned green.

@madsmtm madsmtm deleted the fix-platform_version branch September 10, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-apple Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

5 participants