From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 18 Nov 2024 08:28:17 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tCwBF-003LXc-23 for lore@lore.pengutronix.de; Mon, 18 Nov 2024 08:28:17 +0100 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1tCwBF-0003FS-9h; Mon, 18 Nov 2024 08:28:17 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tCwAy-0003FJ-M2; Mon, 18 Nov 2024 08:28:00 +0100 Received: from pty.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::c5]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tCwAy-001Lz7-13; Mon, 18 Nov 2024 08:28:00 +0100 Received: from mol by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1tCwAy-001JOH-0l; Mon, 18 Nov 2024 08:28:00 +0100 Date: Mon, 18 Nov 2024 08:28:00 +0100 From: Michael Olbrich To: Ian Abbott , ptxdist@pengutronix.de Message-ID: Mail-Followup-To: Ian Abbott , ptxdist@pengutronix.de References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-IRC: #ptxdist @freenode Subject: [ptxdist] libstdc++ and Y2038 (was: [ANNOUNCE] OSELAS.Toolchain() 2024.11.0 released) X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false Hi, On Wed, Nov 13, 2024 at 02:25:23PM +0100, Michael Olbrich wrote: > On Wed, Nov 13, 2024 at 12:48:13PM +0000, Ian Abbott wrote: > > On 13/11/2024 12:09, Michael Olbrich wrote: > > > I'm happy to announce that I've just released OSELAS.Toolchain-2024.11.0. > > > > > > This is a major release with significant changes. All components of the > > > primary toolchains have been updated to the latest versions. The highlights > > > are: > > > - binutils 2.43.1 > > > - clang 19.1.3 > > > - gcc 14.2 > > > - gdb 15.2 > > > - glibc 2.40 > > > - kernel headers 6.11.6 > > > - rustc 1.82.0 > > > > > > Beyond that, glibc is now built with more hardening features enabled, > > > specifically --enable-bind-now and --enable-fortify-source. > > > > > > The debug sections in all target libraries are now zstd compressed. And ld > > > will use that by default with --compress-debug-sections. > > > > > > The minimum kernel version that glibc will run on is now v5.15. > > > > > > Download the release here: > > > https://public.pengutronix.de/oselas/toolchain/ > > > > > > Debian / Ubuntu Packages will be available at > > > http://debian.pengutronix.de/ > > > > > > My current plan is to build packages for Debian trixie/sid, bookworm, > > > and Ubuntu 22.04, 24.04. The packages will show up in the near future. > > > > > > > Thanks for the release. A "nice to have" would have been 64-bit time_t > > support in 32-bit libstdc++ to tick off one more box for Y2038 support. > > There was some discussion about this earlier this year: > > > > https://lore.ptxdist.org/ptxdist/24f03e42-a9ab-4303-9d0e-3b1ff24e0097@erwinrol.com/ > > Arg, I completely forgot about that. Sorry about that. You should have said > something when I wrote about doing a new release last month... So I looked at the --enable-year2038 option and it does nothing at all from what I can tell. It seems to be an artifact of sharing stuff from the binutils-gdb repo. So the big question is: Is time_t somewhere hidden in the ABI? I did find on bug report[1], but that's in a header, an if the whole BSP is build with _TIME_BITS=64 then this is not a problem. There is little to no information on this topic. In another bug report[2], someone claims that at libfortran does not contain time_t in its ABI, but I found nothing about libstdc++. I did some tests with abi-compliance-checker and I think libstdc++.so looks good, but I'm not 100% sure that what I did is correct. So this needs some more investigation. If you want to try it, the change I made is pretty simple: --------------------------------------------------------------------------- diff --git a/rules/cross-gcc.make b/rules/cross-gcc.make index 5643dc8a34e2..f8632259b8f0 100644 --- a/rules/cross-gcc.make +++ b/rules/cross-gcc.make @@ -95,8 +95,8 @@ CROSS_GCC_AUTOCONF_COMMON += \ --enable-libstdcxx-debug-flags="-gdwarf-4 -O0 -D_GLIBCXX_ASSERTIONS $(call ptx/toolchain-cross-debug-flags, CROSS_GCC)" CROSS_GCC_CONF_ENV += \ - CFLAGS_FOR_TARGET="$(call ptx/toolchain-cross-debug-flags, CROSS_GCC)" \ - CXXFLAGS_FOR_TARGET="$(call ptx/toolchain-cross-debug-flags, CROSS_GCC)" + CFLAGS_FOR_TARGET="$(call ptx/toolchain-cross-debug-flags, CROSS_GCC) -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64" \ + CXXFLAGS_FOR_TARGET="$(call ptx/toolchain-cross-debug-flags, CROSS_GCC) -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64" # --enable-tls enable or disable generation of tls code # overriding the assembler check for tls support --------------------------------------------------------------------------- Regards, Michael [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99832 [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103886 -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |