Skip to content

Do not define statx_flags for LoongArch64 with musl - #1503

Merged
sunfishcode merged 1 commit into
bytecodealliance:mainfrom
heiher:no-statx-flags-musl
Sep 1, 2025
Merged

Do not define statx_flags for LoongArch64 with musl#1503
sunfishcode merged 1 commit into
bytecodealliance:mainfrom
heiher:no-statx-flags-musl

Conversation

@heiher

@heiher heiher commented Sep 1, 2025

Copy link
Copy Markdown
Contributor

libc already defines constants like STATX_TYPE for musl 1.2.3+ 1, so statx_flags is unnecessary in this environment.

Fixes #1502

Footnotes

  1. https://docs.rs/libc/latest/src/libc/unix/linux_like/mod.rs.html#1679

@heiher

heiher commented Sep 1, 2025

Copy link
Copy Markdown
Contributor Author

Alright, constants like STATX_TYPE are only available in musl starting from v1.2.3 1. Currently, only the LoongArch target or the OHOS environment 2 uses this version.

Footnotes

  1. https://github.com/rust-lang/libc/blob/84e26e6b166a6634d679fbf44e957102846b8a03/src/unix/linux_like/mod.rs#L1673

  2. https://github.com/rust-lang/libc/blob/84e26e6b166a6634d679fbf44e957102846b8a03/build.rs#L95-L101

`libc` already defines constants like `STATX_TYPE` for `musl 1.2.3+` [^1], so
`statx_flags` is unnecessary in this environment.

[^1]: https://docs.rs/libc/latest/src/libc/unix/linux_like/mod.rs.html#1679

Fixes #1502
@heiher heiher changed the title Do not define statx_flags for target_env = "musl" Do not define statx_flags for LoongArch64 with musl Sep 1, 2025
@sunfishcode

Copy link
Copy Markdown
Member

Thanks!

@sunfishcode
sunfishcode merged commit 3d82541 into bytecodealliance:main Sep 1, 2025
48 of 51 checks passed
@WhyNotHugo

Copy link
Copy Markdown

Thanks!

Could you tag a new release with this? The issue is blocking downstream packaging of ty.

@sunfishcode

Copy link
Copy Markdown
Member

This is now released in rustix 1.1.1.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ambiguous (glob) import on loongarch64

3 participants