On the architectures that supports libsanitizer (part of gcc), the
build is currently failing with BR2_TIME_BITS_64=y. This is because
some code in libsanitizer unsets _FILE_OFFSET_BITS, but building code
with _FILE_OFFSET_BITS unset, but _TIME_BITS set isn't legal.
To fix this, this commit backports two changes:
- One change to also unset _TIME_BITS in
sanitizer_platform_limits_posix.cpp. This change is upstream in
LLVM, and already part of GCC 14.x, so we only bringing it to GCC
12.x and GCC 13.x.
- A second change doing the same modification, but in
sanitizer_procmaps_solaris.cpp, which as crazy as it might sound,
also gets compiled on Linux platforms (but to basically an empty
file). This change has been submitted upstream to both LLVM and gcc.
Notes:
- the special PowerPC SPE version of GCC cannot be affected, as only
uClibc-ng is used for this architecture, and uClibc-ng doesn't use
_TIME_BITS=64 (but now default to 64-bit time_t on 32-bit
architectures, like musl does).
- the special ARC version doesn't need patching because libsanitizer
doesn't support the ARC architecture, so it doesn't get built
Fixes:
http://autobuild.buildroot.net/results/ff2dbfdabf0bb6a0d82ea8a80122ab97fd75bd3f/https://gitlab.com/buildroot.org/buildroot/-/issues/16
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit 81a4b6e7b8)
[Peter: drop 14.1.0 patch]
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>