Go to file
Thomas Petazzoni 3c427c6472 Config.in: introduce BR2_TIME_BITS_64 option for Y2038 compatibility
Y2038 is now almost only 15 years away, and embedded systems built
today are potentially going to still be operational in 15 years, and
even though they are supposed to receive updates by then, we all know
how things go, and potentially some of these embedded systems will not
receive any update.

In 2038, the signed 32-bit representation of time_t used on 32-bit
architectures will overflow, causing all time-related functions to go
back in time in a surprising way.

The Linux kernel has already been modified to support a 64-bit
representation of time_t on 32-bit architectures, but from a C library
perspective, the situation varies:

 - glibc uses this 64-bit time_t representation on 32-bit systems
   since glibc 2.34, but only if -D_TIME_BITS=64 is
   specified. Therefore, this commit adds an option to add this flag
   globally to the build, when glibc is the C library and the
   architecture is not 64-bit.

 - musl uses unconditionally a 64-bit time_t representation on 32-bit
   systems since musl 1.2.0. So there is nothing to do here since
   Buildroot has been using a musl >= 1.2.0, used since Buildroot
   2020.05. No Buildroot option is needed here.

 - uClibc-ng does not support a 64-bit time_t representation on 32-bit
   systems, so systems using uClibc-ng will not be Y2038 compliant, at
   least for now. No Buildroot option is needed here.

It should be noted that being Y2038-compliant will only work if all
application/library code is correct. For example if an
application/library stores a timestamp in an "int" instead of using
the proper time_t type, then the mechanisms described above will not
fix this, and the application/library will continue to be broken in
terms of Y2038 support.

Possible discussions points about this patch:

 - Should we have an option at all, or should we unconditionally pass
   -D_TIME_BITS=64, like we have been doing for _FILE_OFFSET_BITS=64
   for quite some time. The reasoning for having an option is that
   the mechanism is itself opt-in in glibc, and generally relatively
   new, so it seemed logical for now to make it optional as well in
   Buildroot.

 - Should we show something (a Config.in comment?) in the musl and
   uClibc-ng case to let the user know that the code is Y2038
   compliant (musl) or not Y2038 compliant (uClibc-ng). Or should this
   discussion be part of the Buildroot documentation?

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2023-10-01 21:14:06 +02:00
arch arch/powerpc: drop ABI selection 2023-08-20 23:22:27 +02:00
board configs/khadas_vim3_defconfig: new defconfig 2023-09-30 21:38:50 +02:00
boot boot/at91bootstrap: disable PIE and stack-protector build flags 2023-10-01 11:02:03 +02:00
configs configs/khadas_vim3_defconfig: new defconfig 2023-09-30 21:38:50 +02:00
docs docs/website/association.html: move buildroot-association to Gitlab 2023-09-30 16:09:51 +02:00
fs fs/cpio: allow users to provide their own dracut modules 2023-02-06 22:46:35 +01:00
linux package/linux-headers: drop 6.4.x option 2023-09-27 21:06:30 +02:00
package Config.in: introduce BR2_TIME_BITS_64 option for Y2038 compatibility 2023-10-01 21:14:06 +02:00
support support/testing: TestPythonPy3MakoExt: new test for mako external plugins 2023-09-30 18:48:26 +02:00
system package/systemd: bump linux-headers dependency to 4.14 2023-08-02 21:18:16 +02:00
toolchain package/gcc/gcc-final: add a target variant in charge of target installation 2023-09-30 14:49:51 +02:00
utils utils/getdeveloperlib.py: handle file removal 2023-09-11 22:08:22 +02:00
.checkpackageignore package/linux-tools: fix SysV init script 2023-10-01 11:47:27 +02:00
.clang-format .clang-format: initial import from Linux 5.15.6 2022-01-01 15:01:13 +01:00
.defconfig
.flake8
.gitignore
.gitlab-ci.yml support/misc/gitlab-ci.yml.in: retry a job only if it failed due to a runner issue 2023-08-27 10:09:37 +02:00
.shellcheckrc utils/check-package: improve shellcheck reproducibility 2022-07-25 23:52:47 +02:00
CHANGES Update for 2023.08.1 2023-09-28 00:22:36 +02:00
Config.in Config.in: introduce BR2_TIME_BITS_64 option for Y2038 compatibility 2023-10-01 21:14:06 +02:00
Config.in.legacy package/linux-headers: drop 6.4.x option 2023-09-27 21:06:30 +02:00
COPYING
DEVELOPERS package/spirv-headers: new package 2023-10-01 18:31:09 +02:00
Makefile package/pkg-generic.mk: fix rule order for reinstall/rebuild/reconfigure 2023-10-01 17:48:15 +02:00
Makefile.legacy
README

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on OFTC IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches