Skip to content

l4re: change bit widths of file offset types - #5173

Open
dybucc wants to merge 1 commit into
rust-lang:mainfrom
dybucc:l4re-file-offsets
Open

l4re: change bit widths of file offset types#5173
dybucc wants to merge 1 commit into
rust-lang:mainfrom
dybucc:l4re-file-offsets

Conversation

@dybucc

@dybucc dybucc commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Description

This PR deprecates a number of symbols from the unix/linux_like/l4re module. This has also come with further deprecations and modifications in other top-level modules.

At present, the definitions in upstream l4re-core are always 64-bit wide for the 64-bit targets we seem to support in this module. Though rustc only has support for x86_64 under this target OS.

Sources

Sources on the uClibc changes are documented in #5165. A regex search of the affected symbols on l4re-core's libc directory reveals no modifications in their patches would necessitate changes in this patch.

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget); especially relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

@rustbot rustbot added S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Jun 16, 2026
@dybucc
dybucc force-pushed the l4re-file-offsets branch from a64dd66 to 66c2f42 Compare June 16, 2026 17:29
@dybucc dybucc changed the title refactor: change bitwidths of file off tys in l4re refactor: change bit widths of file offset types in L4Re Jun 17, 2026
@dybucc
dybucc force-pushed the l4re-file-offsets branch from 66c2f42 to 244c00b Compare June 19, 2026 10:12
@rustbot

This comment has been minimized.

@dybucc dybucc changed the title refactor: change bit widths of file offset types in L4Re l4re: change bit widths of file offset types Jun 19, 2026
@dybucc
dybucc force-pushed the l4re-file-offsets branch from 244c00b to f0bf0bf Compare June 20, 2026 09:52
@rustbot

This comment has been minimized.

@dybucc
dybucc force-pushed the l4re-file-offsets branch 2 times, most recently from caac209 to e16db76 Compare June 20, 2026 11:29
@tgross35

Copy link
Copy Markdown
Member

I'm pretty fine deprecating these since the platform has pretty low use, but we should figure out the other uclibc PR first.

@SnoozeThis #5165 -> remove label S-blocked, add label S-waiting-on-review

@SnoozeThis

Copy link
Copy Markdown

(https://snoozeth.is/u1Hjq3aITKU) I will wait until #5165 is merged and then add label S-waiting-on-review and remove label S-blocked.

@rustbot claim.

Comment thread src/unix/linux_like/l4re/uclibc/aarch64/mod.rs Outdated
@rustbot

This comment has been minimized.

@dybucc
dybucc force-pushed the l4re-file-offsets branch 2 times, most recently from e1d5fdc to fb8fb9e Compare June 25, 2026 12:46
@rustbot

This comment has been minimized.

@dybucc
dybucc force-pushed the l4re-file-offsets branch from fb8fb9e to a2d1a13 Compare June 26, 2026 09:43
@rustbot

This comment has been minimized.

@dybucc
dybucc force-pushed the l4re-file-offsets branch from a2d1a13 to e09560e Compare June 26, 2026 09:43
@dybucc

dybucc commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot blocked

@dybucc

dybucc commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

would you incorporate it in this change (if the change is still non-empty now
that _GNU_SOURCE is not set)?

@farao I'm not sure I understand what you mean here. I don't think there's a
mistake either, as the tests are meant for both Linux and L4Re. Users should be
able to set that feature test macro, but I know next to nothing about L4Re.

When I pointed out that it was odd, I meant that we should be getting LFS
bindings but for some reason we don't, even when _GNU_SOURCE is #defined.

@rustbot

This comment has been minimized.

@dybucc
dybucc force-pushed the l4re-file-offsets branch from 3abdeba to 95633b6 Compare August 11, 2026 07:36
@rustbot

This comment has been minimized.

@farao

farao commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Sorry, I was apparently confused. I had a closer look now and I believe the _GNU_SOURCE setting is actually working and we are getting lfs bindings. The current state in the libc crate e.g. has the stat64 struct (as a separate struct) for l4re and that succeeds in the test suite. I believe that the type aliasing in your change (e.g. pub type stat64 = stat;) produces the error since in uclibc both are still separate structs and not one being a type alias of the other. You can see that in the error messages, e.g. error: unknown type name 'stat64'; use 'struct' keyword to refer to the type - stat64 exists but due to the type alias, ctest produces stat64 instead of struct stat64.

For flock64, there's an additional problem since flock64 is currently missing completely from the l4re part of the libc crate (which I believe is just a mistake, it should be added).

Btw, it might very well be that we are going to add 32 bit targets in the next year for l4re. Just to keep it in mind that optimizations based on targets missing for 32 bits might need to be reversed in the future.

@dybucc
dybucc force-pushed the l4re-file-offsets branch from 95633b6 to d1595a2 Compare August 12, 2026 16:58
@rustbot

This comment has been minimized.

@dybucc

dybucc commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for clarifying. I just changed the patch to only conditionally
add the deprecation notes when compiling for 64-bit targets. The only
exception has been the x86_64-specific module.

I don't think we can rename the stat type to use instead struct stat in libc-test, so I guess it'll have to be changed back to being
a full type definition. I'll get to that later.

How do you want to handle the flock matters?

@dybucc
dybucc force-pushed the l4re-file-offsets branch from d1595a2 to 8ae5d8b Compare August 12, 2026 17:30
Comment on lines 2150 to 2161
// FIXME(1.0,deprecate): lfs binding to be removed
#[cfg_attr(
all(target_os = "l4re", target_pointer_width = "64"),
deprecated(
since = "0.2.190",
note = "Use `fstatfs` instead. LFS is being phased out, see \
rust-lang/libc#4805."
)
)]
pub fn fstatfs64(fd: c_int, buf: *mut statfs64) -> c_int;

@tgross35 tgross35 Aug 13, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fwiw I think the comment covers these, we may as well deprecate everything at once

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Except for those where there was no FIXME comment.

@farao

farao commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

How do you want to handle the flock matters?

I think adding flock64 would be the correct thing to do, would you agree?

@dybucc
dybucc force-pushed the l4re-file-offsets branch from 8ae5d8b to 19d2499 Compare August 14, 2026 14:31
@rustbot

This comment has been minimized.

@dybucc

dybucc commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

How do you want to handle the flock matters?

I think adding flock64 would be the correct thing to do, would you
agree?

Done.

@rustbot ready

@dybucc
dybucc force-pushed the l4re-file-offsets branch 3 times, most recently from c8f396c to 74915e8 Compare August 15, 2026 15:18
@tgross35
tgross35 requested a review from farao August 19, 2026 09:26
@farao

farao commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

I ran libc-test again, there remains a problem with __sword_type:

  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: In function 'ctest_size_of____sword_type':                    
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:10751:73: error: '__sword_type' undeclared (first use in this ?
  cargo:warning=10751 | CTEST_EXTERN uint64_t ctest_size_of____sword_type(void) { return sizeof(__sword_type); }                                                                              
  cargo:warning=      |                                                                         ^~~~~~~~~~~~                                                                                  
  cargo:warning=      |                                                                         __pid_type                                                                                    
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:10751:73: note: each undeclared identifier is reported only onn
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: In function 'ctest_align_of____sword_type':                   
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:10752:81: error: '__sword_type' undeclared (first use in this ?
  cargo:warning=10752 | CTEST_EXTERN uint64_t ctest_align_of____sword_type(void) { return CTEST_ALIGNOF(__sword_type); }                                                                      
  cargo:warning=      |                                                                                 ^~~~~~~~~~~~                                                                          
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:88:39: note: in definition of macro 'CTEST_ALIGNOF'            
  cargo:warning=   88 |     #define CTEST_ALIGNOF(T) _Alignof(T)                                                                                                                              
  cargo:warning=      |                                       ^                                                                                                                               
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: At top level:                                                 
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:17928:9: error: unknown type name '__sword_type'               
  cargo:warning=17928 | typedef __sword_type *ctest_field_ty__statfs__f_type;                                                                                                                 
  cargo:warning=      |         ^~~~~~~~~~~~                                                                                                                                                  
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: In function 'ctest_field_ptr__statfs__f_type':                
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:17933:9: error: assignment to 'ctest_field_ty__statfs__f_type']
  cargo:warning=17933 |     ptr = &b->f_type;                                                                                                                                                 
  cargo:warning=      |         ^                                                                                                                                                             
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:17936:12: error: returning 'long int *' from a function with i]
  cargo:warning=17936 |     return &b->f_type;                                                                                                                                                
  cargo:warning=      |            ^~~~~~~~~~                                                                                                                                                 
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: At top level:                                                 
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:17940:9: error: unknown type name '__sword_type'               
  cargo:warning=17940 | typedef __sword_type *ctest_field_ty__statfs__f_bsize;                                                                                                                
  cargo:warning=      |         ^~~~~~~~~~~~                                                                                                                                                  
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: In function 'ctest_field_ptr__statfs__f_bsize':               
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:17945:9: error: assignment to 'ctest_field_ty__statfs__f_bsize]
  cargo:warning=17945 |     ptr = &b->f_bsize;                                                                                                                                                
  cargo:warning=      |         ^                                                                                                                                                             
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:17948:12: error: returning 'long int *' from a function with i]
  cargo:warning=17948 |     return &b->f_bsize;                                                                                                                                               
  cargo:warning=      |            ^~~~~~~~~~~                                                                                                                                                
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: At top level:                                                 
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18024:9: error: unknown type name '__sword_type'
  cargo:warning=18024 | typedef __sword_type *ctest_field_ty__statfs__f_namelen;
  cargo:warning=      |         ^~~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: In function 'ctest_field_ptr__statfs__f_namelen':
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18029:9: error: assignment to 'ctest_field_ty__statfs__f_namel]
  cargo:warning=18029 |     ptr = &b->f_namelen;
  cargo:warning=      |         ^
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18032:12: error: returning 'long int *' from a function with i]
  cargo:warning=18032 |     return &b->f_namelen;
  cargo:warning=      |            ^~~~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: At top level:
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18036:9: error: unknown type name '__sword_type'
  cargo:warning=18036 | typedef __sword_type *ctest_field_ty__statfs__f_frsize;
  cargo:warning=      |         ^~~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: In function 'ctest_field_ptr__statfs__f_frsize':
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18041:9: error: assignment to 'ctest_field_ty__statfs__f_frsiz]
  cargo:warning=18041 |     ptr = &b->f_frsize;
  cargo:warning=      |         ^
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18044:12: error: returning 'long int *' from a function with i]
  cargo:warning=18044 |     return &b->f_frsize;
  cargo:warning=      |            ^~~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: At top level:
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18048:9: error: unknown type name '__sword_type'
  cargo:warning=18048 | typedef __sword_type *ctest_field_ty__statfs__f_flags;
  cargo:warning=      |         ^~~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: In function 'ctest_field_ptr__statfs__f_flags':
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18053:9: error: assignment to 'ctest_field_ty__statfs__f_flags]
  cargo:warning=18053 |     ptr = &b->f_flags;
  cargo:warning=      |         ^
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18056:12: error: returning 'long int *' from a function with i]
  cargo:warning=18056 |     return &b->f_flags;
  cargo:warning=      |            ^~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: At top level:
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18060:23: error: expected declaration specifiers or '...' befon
  cargo:warning=18060 | typedef __sword_type (*ctest_field_ty__statfs__f_spare)[4];
  cargo:warning=      |                       ^
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18061:14: error: unknown type name 'ctest_field_ty__statfs__f_?
  cargo:warning=18061 | CTEST_EXTERN ctest_field_ty__statfs__f_spare
  cargo:warning=      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=      |              ctest_field_ty__statfs__f_flags
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: In function 'ctest_field_ptr__statfs__f_spare':
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18064:5: error: unknown type name 'ctest_field_ty__statfs__f_s?
  cargo:warning=18064 |     ctest_field_ty__statfs__f_spare ptr;
  cargo:warning=      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=      |     ctest_field_ty__statfs__f_flags
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18065:9: error: assignment to 'int' from 'long int (*)[4]' mak]
  cargo:warning=18065 |     ptr = &b->f_spare;
  cargo:warning=      |         ^
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18068:12: error: returning 'long int (*)[4]' from a function w]
  cargo:warning=18068 |     return &b->f_spare;
  cargo:warning=      |            ^~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: At top level:
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18072:9: error: unknown type name '__sword_type'
  cargo:warning=18072 | typedef __sword_type *ctest_field_ty__statfs64__f_type;
  cargo:warning=      |         ^~~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: In function 'ctest_field_ptr__statfs64__f_type':
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18077:9: error: assignment to 'ctest_field_ty__statfs64__f_typ]
  cargo:warning=18077 |     ptr = &b->f_type;
  cargo:warning=      |         ^
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18080:12: error: returning 'long int *' from a function with i]
  cargo:warning=18080 |     return &b->f_type;
  cargo:warning=      |            ^~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: At top level:
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18084:9: error: unknown type name '__sword_type'
  cargo:warning=18084 | typedef __sword_type *ctest_field_ty__statfs64__f_bsize;
  cargo:warning=      |         ^~~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: In function 'ctest_field_ptr__statfs64__f_bs10:08:28 [44/1957]
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18089:9: error: assignment to 'ctest_field_ty__statfs64__f_bsi]
  cargo:warning=18089 |     ptr = &b->f_bsize;
  cargo:warning=      |         ^
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18092:12: error: returning 'long int *' from a function with i]
  cargo:warning=18092 |     return &b->f_bsize;
  cargo:warning=      |            ^~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: At top level:
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18168:9: error: unknown type name '__sword_type'
  cargo:warning=18168 | typedef __sword_type *ctest_field_ty__statfs64__f_namelen;
  cargo:warning=      |         ^~~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: In function 'ctest_field_ptr__statfs64__f_namelen':
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18173:9: error: assignment to 'ctest_field_ty__statfs64__f_nam]
  cargo:warning=18173 |     ptr = &b->f_namelen;
  cargo:warning=      |         ^
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18176:12: error: returning 'long int *' from a function with i]
  cargo:warning=18176 |     return &b->f_namelen;
  cargo:warning=      |            ^~~~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: At top level:
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18180:9: error: unknown type name '__sword_type'
  cargo:warning=18180 | typedef __sword_type *ctest_field_ty__statfs64__f_frsize;
  cargo:warning=      |         ^~~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: In function 'ctest_field_ptr__statfs64__f_frsize':
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18185:9: error: assignment to 'ctest_field_ty__statfs64__f_frs]
  cargo:warning=18185 |     ptr = &b->f_frsize;
  cargo:warning=      |         ^
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18188:12: error: returning 'long int *' from a function with i]
  cargo:warning=18188 |     return &b->f_frsize;
  cargo:warning=      |            ^~~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: At top level:
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18192:9: error: unknown type name '__sword_type'
  cargo:warning=18192 | typedef __sword_type *ctest_field_ty__statfs64__f_flags;
  cargo:warning=      |         ^~~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: In function 'ctest_field_ptr__statfs64__f_flags':
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18197:9: error: assignment to 'ctest_field_ty__statfs64__f_fla]
  cargo:warning=18197 |     ptr = &b->f_flags;
  cargo:warning=      |         ^
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18200:12: error: returning 'long int *' from a function with i]
  cargo:warning=18200 |     return &b->f_flags;
  cargo:warning=      |            ^~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: At top level:
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18204:23: error: expected declaration specifiers or '...' befon
  cargo:warning=18204 | typedef __sword_type (*ctest_field_ty__statfs64__f_spare)[4];
  cargo:warning=      |                       ^
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18205:14: error: unknown type name 'ctest_field_ty__statfs64__?
  cargo:warning=18205 | CTEST_EXTERN ctest_field_ty__statfs64__f_spare
  cargo:warning=      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=      |              ctest_field_ty__statfs64__f_flags
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: In function 'ctest_field_ptr__statfs64__f_spare':
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18208:5: error: unknown type name 'ctest_field_ty__statfs64__f?
  cargo:warning=18208 |     ctest_field_ty__statfs64__f_spare ptr;
  cargo:warning=      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=      |     ctest_field_ty__statfs64__f_flags
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18209:9: error: assignment to 'int' from 'long int (*)[4]' mak]
  cargo:warning=18209 |     ptr = &b->f_spare;
  cargo:warning=      |         ^
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:18212:12: error: returning 'long int (*)[4]' from a function w]
  cargo:warning=18212 |     return &b->f_spare;
  cargo:warning=      |            ^~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: At top level:
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:22726:14: error: unknown type name '__sword_type'
  cargo:warning=22726 | CTEST_EXTERN __sword_type ctest_roundtrip____sword_type(
  cargo:warning=      |              ^~~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:22727:5: error: unknown type name '__sword_type'
  cargo:warning=22727 |     __sword_type value,
  cargo:warning=      |     ^~~~~~~~~~~~
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:22728:42: error: '__sword_type' undeclared here (not in a func?
  cargo:warning=22728 |     const uint8_t is_padding_byte[sizeof(__sword_type)],
  cargo:warning=      |                                          ^~~~~~~~~~~~
  cargo:warning=      |                                          __pid_type
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c: In function 'ctest_size_of____sword_type':
  cargo:warning=libc/target/x86_64-unknown-l4re-uclibc/debug/build/libc-test-203a5f9ef565ea6e/out/ctest_output.c:10751:88: error: control reaches end of non-void function [-We]
  cargo:warning=10751 | CTEST_EXTERN uint64_t ctest_size_of____sword_type(void) { return sizeof(__sword_type); }
  cargo:warning=      |                                                                                        ^
  cargo:warning=At top level:
  cargo:warning=cc1: note: unrecognized command-line option '-Wno-unknown-warning-option' may have been intended to silence earlier diagnostics
  cargo:warning=cc1: all warnings being treated as errors

The name in the uclibc-ng is actually __SWORD_TYPE but I think that's not ok to use as a name as it goes against the rust naming conventions? Either way, please remove the declaration of fsword_t from src/unix/linux_like/l4re/uclibc/*/mod.rs and in order to get rid of the warnings above adapt this line:

"fsword_t" if uclibc => Some("__SWORD_TYPE".to_string()),

@tgross35

Copy link
Copy Markdown
Member

The name in the uclibc-ng is actually __SWORD_TYPE but I think that's not ok to use as a name as it goes against the rust naming conventions?

The entirety of libc goes against Rust naming conventions :) so feel free to match source

@dybucc
dybucc force-pushed the l4re-file-offsets branch from 74915e8 to 9c46506 Compare August 20, 2026 15:21
@rustbot

This comment has been minimized.

@dybucc

dybucc commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Done. I've ketp the same casing as is prevalent across type aliases in
rust-lang/libc but have otherwise copied upstream's identifier one-to-one.

@farao

farao commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Now please remove the fsword_t declaration in the two arch specific files (otherwise that will also prevent the tests to be run)

Add deprecation warnings to LFS bindings under L4Re uClibc. This patch
adds notices to types and routines. The only supported target is 64-bits
wide. Its suffixed and unsuffixed types should always be equivalent.
@dybucc

dybucc commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

I don’t think I can outright remove the symbol. I’ve deprecated it and have set up a skip for it in libc-test’s build script (I missed setting up the skip yesterday.) That should make the tests pass again.

@dybucc
dybucc force-pushed the l4re-file-offsets branch from 9c46506 to 13c23b6 Compare August 21, 2026 06:52
@rustbot

rustbot commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

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

Labels

O-linux O-linux-like O-unix S-waiting-on-maintainer S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants