Repository navigation
newlib: correct RTEMS scalar type widths - #5450
Merged
Merged
Conversation
tgross35
requested changes
Aug 31, 2026
Collaborator
|
Reminder, once the PR becomes ready for a review, use |
Contributor
Author
|
@rustbot ready |
physwkim
force-pushed
the
rtems-scalar-widths
branch
from
August 31, 2026 09:05
4ec3798 to
149d9af
Compare
tgross35
reviewed
Aug 31, 2026
Comment on lines
+3
to
+5
| // RTEMS defines `clock_t` as `__uint64_t` (`<machine/_types.h>` via | ||
| // `<sys/types.h>`), not `long` as plain newlib arm targets did. | ||
| pub type clock_t = c_ulonglong; |
Member
There was a problem hiding this comment.
Could you make this u64 to match https://github.com/RTEMS/sourceware-mirror-newlib-cygwin/blob/7d4336cf6e519c2a4c9baac10da7a785d88d30c5/newlib/libc/sys/rtems/include/machine/_types.h#L27? Otherwise LGTM
RTEMS's newlib defines these in <machine/_types.h>: __dev_t, __ino_t and _CLOCK_T_ as __uint64_t, __rlim_t as __int64_t, _CLOCKID_T_ as int — where this tree has them 32-bit, and clockid_t unsigned. Verified with _Static_assert under both arm-rtems6-gcc and arm-rtems7-gcc. Source: https://github.com/RTEMS/sourceware-mirror-newlib-cygwin/blob/7d4336cf6e519c2a4c9baac10da7a785d88d30c5/newlib/libc/sys/rtems/include/machine/_types.h#L12-L39
physwkim
force-pushed
the
rtems-scalar-widths
branch
from
August 31, 2026 09:09
149d9af to
85e964e
Compare
Contributor
Author
|
@rustbot ready |
tgross35
approved these changes
Aug 31, 2026
tgross35
enabled auto-merge
August 31, 2026 09:13
tgross35
pushed a commit
to tgross35/rust-libc
that referenced
this pull request
Sep 4, 2026
RTEMS's newlib defines these in <machine/_types.h>: __dev_t, __ino_t and _CLOCK_T_ as __uint64_t, __rlim_t as __int64_t, _CLOCKID_T_ as int — where this tree has them 32-bit, and clockid_t unsigned. Verified with _Static_assert under both arm-rtems6-gcc and arm-rtems7-gcc. Source: https://github.com/RTEMS/sourceware-mirror-newlib-cygwin/blob/7d4336cf6e519c2a4c9baac10da7a785d88d30c5/newlib/libc/sys/rtems/include/machine/_types.h#L12-L39 (backport <rust-lang#5450>) (cherry picked from commit 7c1cc59)
Merged
tgross35
pushed a commit
to tgross35/rust-libc
that referenced
this pull request
Sep 4, 2026
RTEMS's newlib defines these in <machine/_types.h>: __dev_t, __ino_t and _CLOCK_T_ as __uint64_t, __rlim_t as __int64_t, _CLOCKID_T_ as int — where this tree has them 32-bit, and clockid_t unsigned. Verified with _Static_assert under both arm-rtems6-gcc and arm-rtems7-gcc. Source: https://github.com/RTEMS/sourceware-mirror-newlib-cygwin/blob/7d4336cf6e519c2a4c9baac10da7a785d88d30c5/newlib/libc/sys/rtems/include/machine/_types.h#L12-L39 (backport <rust-lang#5450>) (cherry picked from commit 7c1cc59)
This was referenced Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This picks up where #5308 left off. RTEMS defines dev_t, ino_t and
clock_t as 64-bit, rlim_t as signed 64-bit, and clockid_t as a signed
int (newlib's <machine/_types.h>), but libc currently has them all
32-bit and clockid_t unsigned. time_t and off_t from #5308 are already
correct on main, so only the remaining five are touched here.
Definitions in RTEMS's newlib, at the commit the RTEMS 7 tools pin
(
newlib/libc/sys/rtems/include/machine/_types.h):__dev_t: https://github.com/RTEMS/sourceware-mirror-newlib-cygwin/blob/7d4336cf6e519c2a4c9baac10da7a785d88d30c5/newlib/libc/sys/rtems/include/machine/_types.h#L12__ino_t: https://github.com/RTEMS/sourceware-mirror-newlib-cygwin/blob/7d4336cf6e519c2a4c9baac10da7a785d88d30c5/newlib/libc/sys/rtems/include/machine/_types.h#L21_CLOCK_T_(clock_t): https://github.com/RTEMS/sourceware-mirror-newlib-cygwin/blob/7d4336cf6e519c2a4c9baac10da7a785d88d30c5/newlib/libc/sys/rtems/include/machine/_types.h#L27_CLOCKID_T_(clockid_t): https://github.com/RTEMS/sourceware-mirror-newlib-cygwin/blob/7d4336cf6e519c2a4c9baac10da7a785d88d30c5/newlib/libc/sys/rtems/include/machine/_types.h#L30__rlim_t: https://github.com/RTEMS/sourceware-mirror-newlib-cygwin/blob/7d4336cf6e519c2a4c9baac10da7a785d88d30c5/newlib/libc/sys/rtems/include/machine/_types.h#L39