https://github.com/mkj/yocto-y2038
64-bit time_t compile warnings
https://github.com/mkj/yocto-y2038
Last synced: 6 days ago
JSON representation
64-bit time_t compile warnings
- Host: GitHub
- URL: https://github.com/mkj/yocto-y2038
- Owner: mkj
- Created: 2022-12-02T08:33:11.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-02T09:22:08.000Z (over 3 years ago)
- Last Synced: 2025-03-02T18:51:26.166Z (over 1 year ago)
- Language: Shell
- Size: 24.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Differential builds for 64-bit `time_t`
gcc and clang are able to flag truncated conversions for 64-bit `time_t` with
`-Wconversion`, but it's pretty noisy. Comparing that against a 32-bit `time_t`
build, however, gives a pretty clean list of code that needs attention.
Yocto makes it fairly easy to apply flags to all packages.
See [conf/local.conf](conf/local.conf). Some packages set `-Werror` by default,
so [workspace](workspace) workarounds are used from `devtool modify`.
## Building
This git repo is an OpenBMC build directory. Set up the build, pointing at this checkout:
```shell
bash
umask 022
cd ~/src/openbmc
. setup evb-ast2600 ~/path/to/yocto-y2038
```
Build once with 32-bit, then copy the log files out:
```shell
nice bitbake core-image-full-cmdline # or another target
# TODO perhaps a better way to do includes
(cd tmp/work; rsync -a armv7ahf-vfpv4d16-openbmc-linux-gnueabi/ ../../log1-32/ --include '*/*/temp/**' --include '/*' --include '/*/*' --include '/*/*' --include '/*/*/temp' --exclude '*')
```
Edit [conf/local.conf](conf/local.conf) and enable the 64-bit `TARGET_CPPFLAGS`.
Clean source and build again 64-bit:
```shell
rm -rf tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/
rm -rf tmp/stamps/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/
nice bitbake core-image-full-cmdline
(cd tmp/work; rsync -a armv7ahf-vfpv4d16-openbmc-linux-gnueabi/ ../../log1-64/ --include '*/*/temp/**' --include '/*' --include '/*/*' --include '/*/*' --include '/*/*/temp' --exclude '*')
```
Now the logs can be compared:
```shell
./difflog.sh
```
To produce logs such as [diff1/busybox.diff](diff1/busybox.diff).
Some are false positives, but others seem like real problems, come the year 2038.
## Source
I've been working with OpenBMC (a Yocto downstream), so that's what I tested.
This uses OpenBMC source tree https://github.com/openbmc/openbmc/
Tested with rev `f35e6b7ecc6b5c5fdb561643831082226c586b6e`