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

Update the info for resurrection of fstat/newfstatat #195

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

xry111
Copy link
Member

@xry111 xry111 commented Jul 4, 2024

I'm much annoyed by this change. It will introduces chaos to Glibc (and maybe others using something like #ifdef __NR_fstat).

<rant>To me the decision is based on the unfair and incorrect favor to some Google products and "commercial" distros, and Linus' personal feeling, instead of good technical reasons.</rant>

The decision of reviving newfstatat will render all previous releases
incomplete.
@xry111 xry111 marked this pull request as draft July 4, 2024 03:53
@xry111
Copy link
Member Author

xry111 commented Jul 4, 2024

Draft. The content may subject to changes. And the commits will be rebased & (partially) squashed.

为了能让这部分程序正常运行,需要调整上述函数的行为,当 `statx` 返回 `ENOSYS` 时,
改为使用 `fstat` 或 `newfstatat`;同时,需要在新世界的内核中补充 `fstat` 和 `newfstatat` 的实现。
为了能让这部分程序正常运行,如果 Glibc 版本低于 2.41,需要调整上述函数的行为,当 `statx` 返回 `ENOSYS` 时,
改为使用 `fstat` 或 `newfstatat`;同时,如果新世界内核版本低于 6.11,则需要为其补充 `fstat` 和 `newfstatat` 的实现。
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: list backport versions here (6.6.xx and 6.1.yy). The backport is making more chaos to me.


在 2.38 的 glibc 中,所有 `*stat*` 函数会在编译期通过宏指令检查内核是否提供了 `fstat` 或 `newfstatat` 的定义,
如果没有,那么这些函数会调用 `statx`[^7] 并负责转换数据结构。这意味着,与旧世界相比,这些 `*stat*` 函数对外呈现的行为是不变的,
新旧世界的函数是二进制兼容的。本节会着重讨论其向内核发出系统调用的行为区别。

在 2.41 的 glibc 中,如果其在构建时被配置为仅兼容 6.11 或更新版本的内核
Copy link
Member Author

Choose a reason for hiding this comment

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

NOT to list backport versions here. We cannot support them rationally in Glibc.

Even x86_64 statx does not fallback if configured with --enable-kernel
>= 5.19.  In practice on x86_64 Firefox sandbox work fine with a Glibc
configured --enable-kernel=6.8 (because statx is rarely directly
invoked, thus if Glibc does not invoke it for stat/fstat/fstatat etc.
it shouldn't be invoked).  So (hopefully) these stupidcomp sandboxes
will work on LoongArch OOtB with a Glibc configured --enable-kernel >=
6.11.
The field names are different.
@@ -7,5 +7,5 @@ portingEfforts:
link: ''
supportStatus: Released
releasedSinceVersion: '5.19'
goodSinceVersion: '6.2'
goodSinceVersion: '6.11'
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe 6.10(.x) or 6.9.x considering they are fanatical enough to backport this.

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.

None yet

1 participant