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

[hurd] Fix accessing f_type field of statvfs #71851

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sthibaul
Copy link
Contributor

@sthibaul sthibaul commented Nov 9, 2023

f4719c4 ("Add support for GNU Hurd in Path.inc and other places") made llvm use an internal __f_type name for the f_type field (which it is not supposed to since accessing double-underscore names is explicitly not supported by standards). In glibc 2.39 this field was renamed to f_type so application can now access the field as the standard says.

f4719c4 ("Add support for GNU Hurd in Path.inc and other places")
made llvm use an internal __f_type name for the f_type field (which it is
not supposed to since accessing double-underscore names is explicitly not
supported by standards). In glibc 2.39 this field was renamed to f_type so
application can now access the field as the standard says.
@sthibaul sthibaul changed the title hurd: Fix accessing f_type field of statvfs [hurd] Fix accessing f_type field of statvfs Nov 9, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Nov 9, 2023

@llvm/pr-subscribers-llvm-support

Author: Samuel Thibault (sthibaul)

Changes

f4719c4 ("Add support for GNU Hurd in Path.inc and other places") made llvm use an internal __f_type name for the f_type field (which it is not supposed to since accessing double-underscore names is explicitly not supported by standards). In glibc 2.39 this field was renamed to f_type so application can now access the field as the standard says.


Full diff: https://github.com/llvm/llvm-project/pull/71851.diff

1 Files Affected:

  • (modified) llvm/lib/Support/Unix/Path.inc (+1-1)
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index 68ca58fda3b8fe0..6ea0c4cac4d4def 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/lib/Support/Unix/Path.inc
@@ -487,7 +487,7 @@ static bool is_local_impl(struct STATVFS &Vfs) {
 #ifndef CIFS_MAGIC_NUMBER
 #define CIFS_MAGIC_NUMBER 0xFF534D42
 #endif
-#ifdef __GNU__
+#if defined(__GNU__) && ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 39)))
   switch ((uint32_t)Vfs.__f_type) {
 #else
   switch ((uint32_t)Vfs.f_type) {

@sthibaul
Copy link
Contributor Author

sthibaul commented Nov 9, 2023

(yes, glibc 2.39 is not released yet, but we won't be going back on this, and better have llvm cope with the change before it happens)

@sthibaul
Copy link
Contributor Author

glibc 2.39 was released, with the change from the hidden __f_type to the now-well-defined f_type.

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

Successfully merging this pull request may close these issues.

None yet

2 participants