2026-03-01 19:55:10 +00:00
|
|
|
|
# 2038 Compliance Analysis – TQMa6UL
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
## Overview
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
The Year 2038 problem (Y2K38) occurs when a signed 32-bit integer used for
|
|
|
|
|
|
Unix timestamps overflows on **2038-01-19 03:14:07 UTC**. This affects all
|
|
|
|
|
|
32-bit ARM systems using traditional 32-bit `time_t`.
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
## Architecture
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
┌─────────────────────────────────────┐
|
2026-03-01 19:55:10 +00:00
|
|
|
|
│ Application Layer │
|
|
|
|
|
|
│ (all userspace uses 64-bit t) │
|
|
|
|
|
|
├─────────────────────────────────────┤
|
|
|
|
|
|
│ C Library │
|
|
|
|
|
|
│ glibc 2.39: 64-bit time_t (Y2038) │
|
|
|
|
|
|
│ musl 1.2+: 64-bit time_t (Y2038) │
|
2026-03-01 18:39:21 +00:00
|
|
|
|
├─────────────────────────────────────┤
|
2026-03-01 19:55:10 +00:00
|
|
|
|
│ Linux Kernel (Mainline 6.x) │
|
|
|
|
|
|
│ 64-bit time syscalls on ARM32 │
|
2026-03-01 18:39:21 +00:00
|
|
|
|
├─────────────────────────────────────┤
|
2026-03-01 19:55:10 +00:00
|
|
|
|
│ i.MX6 UltraLite (Cortex-A7) │
|
2026-03-01 18:39:21 +00:00
|
|
|
|
└─────────────────────────────────────┘
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
## C Library Options
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
### Option 1: glibc (recommended for Qt/GUI)
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
**Distro:** `dumpling-wayland`
|
|
|
|
|
|
**Target triplet:** `arm-tq-linux-gnueabi`
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
glibc provides 64-bit `time_t` on 32-bit ARM since version 2.34, when built
|
|
|
|
|
|
with `_TIME_BITS=64` (which Yocto Scarthgap enables by default). The BSP
|
|
|
|
|
|
includes glibc 2.39.
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
Advantages:
|
|
|
|
|
|
- Full compatibility with third-party software
|
|
|
|
|
|
- Qt5/Qt6 support
|
|
|
|
|
|
- Broader library ecosystem
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
### Option 2: musl (for minimal/headless)
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
**Distro:** `spaetzle`
|
|
|
|
|
|
**Target triplet:** `arm-tq-linux-musleabi`
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
musl has provided 64-bit `time_t` unconditionally on all 32-bit architectures
|
|
|
|
|
|
since version 1.2.0 (February 2020).
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
Advantages:
|
|
|
|
|
|
- Smaller footprint
|
|
|
|
|
|
- Simpler, no locale overhead
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
Limitations:
|
|
|
|
|
|
- Qt is blocked (`SKIP_RECIPE`)
|
|
|
|
|
|
- Some third-party software may not build
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
## Kernel Support
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
The mainline kernel (6.x) provides:
|
|
|
|
|
|
- 64-bit time variants of all relevant syscalls (`clock_gettime64`,
|
|
|
|
|
|
`futex_time64`, etc.)
|
|
|
|
|
|
- `CONFIG_COMPAT_32BIT_TIME=y` for backwards compatibility
|
|
|
|
|
|
- ext4 timestamps beyond 2038
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
## Compliance Matrix
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
| Component | glibc (dumpling) | musl (spaetzle) | 2038-safe? |
|
|
|
|
|
|
|-----------|-----------------|-----------------|-----------|
|
|
|
|
|
|
| Kernel | Mainline 6.x | Mainline 6.x | ✅ |
|
|
|
|
|
|
| C Library | glibc 2.39 | musl 1.2+ | ✅ |
|
|
|
|
|
|
| Userspace | 64-bit time_t | 64-bit time_t | ✅ |
|
|
|
|
|
|
| U-Boot | Mainline | Mainline | ✅ |
|
|
|
|
|
|
| Qt6 | ✅ supported | ❌ blocked | ✅ (glibc) |
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
## Verification
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
After building, verify on the target:
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-03-01 19:55:10 +00:00
|
|
|
|
# Check time_t size (should print 8)
|
|
|
|
|
|
cat << 'C' > /tmp/check_time.c
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
#include <time.h>
|
|
|
|
|
|
int main() { printf("sizeof(time_t) = %zu\n", sizeof(time_t)); return 0; }
|
|
|
|
|
|
C
|
|
|
|
|
|
$CC /tmp/check_time.c -o /tmp/check_time && /tmp/check_time
|
2026-03-01 18:39:21 +00:00
|
|
|
|
```
|
|
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
## Risk Assessment
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
| Risk | Severity | Status |
|
|
|
|
|
|
|------|----------|--------|
|
|
|
|
|
|
| time_t overflow | Critical | ✅ Mitigated (both libc options) |
|
|
|
|
|
|
| Filesystem timestamps | Medium | ✅ ext4 supports >2038 |
|
|
|
|
|
|
| Network protocols (NTP) | Low | ✅ 64-bit aware |
|
|
|
|
|
|
| Third-party binaries | Medium | ⚠️ Must verify pre-built binaries |
|
|
|
|
|
|
| Qt5 compatibility | Medium | ⚠️ meta-qt5 not included, add manually |
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
## References
|
2026-03-01 18:39:21 +00:00
|
|
|
|
|
2026-03-01 19:55:10 +00:00
|
|
|
|
- [glibc Y2038 Design](https://sourceware.org/glibc/wiki/Y2038ProofnessDesign)
|
|
|
|
|
|
- [musl time64](https://musl.libc.org/time64.html)
|
|
|
|
|
|
- [Kernel Y2038 work](https://kernelnewbies.org/y2038)
|