[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1108322: marked as done (gcc-14: Fix broken ada timespec record with -D_TIME_BITS=64 on 32-bit big-endian targets)



Your message dated Mon, 28 Jul 2025 17:35:47 +0000
with message-id <E1ugRlL-003VHo-35@fasolo.debian.org>
and subject line Bug#1108322: fixed in gcc-14 14.3.0-4
has caused the Debian Bug report #1108322,
regarding gcc-14: Fix broken ada timespec record with -D_TIME_BITS=64 on 32-bit big-endian targets
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
1108322: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1108322
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Source: gcc-14
Severity: normal
Tags: patch
X-Debbugs-Cc: debian-hppa@lists.debian.org
User: debian-hppa@lists.debian.org
Usertags: hppa

Dear Maintainer,

The gnat patches applied to gcc-14 to support building with -D_TIME_BITS=64
-D_FILE_OFFSET_BITS=64 broke numerous tests in the gnat testsuite.

Analysis of the array39 test showed that the ada timespec record was
not correctly layed out.  See:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114065

In s-c_time.ads, we have

   type timespec is record
      tv_sec  : time_t range 0 .. OS_Constants.MAX_tv_sec;  --  seconds
      tv_nsec : nsec_t range 0 .. 999_999_999;              --  nanoseconds
   end record

but the struct __timespec64 is defined as follows:

#if __TIMESIZE == 64
# define __timespec64 timespec
#else
#include <endian.h>
/* The glibc Y2038-proof struct __timespec64 structure for a time value.
   To keep things Posix-ish, we keep the nanoseconds field a 32-bit
   signed long, but since the Linux field is a 64-bit signed int, we
   pad our tv_nsec with a 32-bit unnamed bit-field padding.

   As a general rule the Linux kernel is ignoring upper 32 bits of
   tv_nsec field.  */
struct __timespec64
{
  __time64_t tv_sec;         /* Seconds */
# if BYTE_ORDER == BIG_ENDIAN
  __int32_t :32;             /* Padding */
  __int32_t tv_nsec;         /* Nanoseconds */
# else
  __int32_t tv_nsec;         /* Nanoseconds */
  __int32_t :32;             /* Padding */
# endif
};
#endif

The nsec_t is currently defined using the size of the tv_nsec in
the __timespec 64 struct  but this ignores the padding on big-endian
targets.

The attached patch fixes this issue.

Regards,
Dave Anglin

-- System Information:
Debian Release: 13.0
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 6.12.33-dirty (SMP w/4 CPU threads)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), LANGUAGE=en_CA:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

-- no debconf information
Index: gcc-14-14.2.0/src/gcc/ada/s-oscons-tmplt.c
===================================================================
--- gcc-14-14.2.0.orig/src/gcc/ada/s-oscons-tmplt.c
+++ gcc-14-14.2.0/src/gcc/ada/s-oscons-tmplt.c
@@ -1769,9 +1769,12 @@ CNS(MAX_tv_sec, "")
   struct timespec ts;
 /*
    --  Sizes (in bytes) of the components of struct timespec.
-   --  The tv_sec field is the same than in struct timeval.
+   --  The tv_sec component is the same size as in struct timeval.
+   --  In order to avoid the endian issues in the glibc __timespec64
+   --  struct, we use the same size for the tv_nsec component as the
+   --  tv_sec component.
 */
-#define SIZEOF_tv_nsec (sizeof (ts.tv_nsec))
+#define SIZEOF_tv_nsec (sizeof (ts.tv_sec))
 CND(SIZEOF_tv_nsec, "tv_nsec");
 }
 

--- End Message ---
--- Begin Message ---
Source: gcc-14
Source-Version: 14.3.0-4
Done: Matthias Klose <doko@debian.org>

We believe that the bug you reported is fixed in the latest version of
gcc-14, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1108322@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matthias Klose <doko@debian.org> (supplier of updated gcc-14 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Mon, 28 Jul 2025 17:42:09 +0200
Source: gcc-14
Architecture: source
Version: 14.3.0-4
Distribution: experimental
Urgency: medium
Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org>
Changed-By: Matthias Klose <doko@debian.org>
Closes: 1108322
Changes:
 gcc-14 (14.3.0-4) experimental; urgency=medium
 .
   * Update to git 20250728 from the gcc-14 branch.
     - Fix PR target/121027 (AArch64), PR target/118891 (AArch64),
       PR tree-optimization/118891, PR tree-optimization/121131,
       PR target/120908 (x86), PR target/120624 (AArch64),
       PR tree-optimization/116674, PR middle-end/120631, PR middle-end/117811,
       PR tree-optimization/120638, PR middle-end/120547, PR c++/120577,
       PR c++/120940, PR c++/120471, PR fortran/121060, PR libstdc++/120548,
       PR libstdc++/99832.
   * Fix broken ada timespec record with -D_TIME_BITS=64 on 32-bit big-endian
     targets (John David Anglin). Closes: #1108322.
Checksums-Sha1:
 a45dbb56efd6093503a4d87296c51cc7d01eaca4 42270 gcc-14_14.3.0-4.dsc
 8bb0371e9203e71167aca9262b246c9a4afebb61 601952 gcc-14_14.3.0-4.debian.tar.xz
 9752af2cb1eda8510dea0a13360074f4931588d9 9887 gcc-14_14.3.0-4_source.buildinfo
Checksums-Sha256:
 bc881bf5b78c44418b24b071c53025c659addd35cdc8a636a1038247e741da88 42270 gcc-14_14.3.0-4.dsc
 22596fa57e738c785b9e05c54044e864077a4219ff397840f90f8ba3e13813a1 601952 gcc-14_14.3.0-4.debian.tar.xz
 9625d907a5238dd45ea8dfe3e67d395c537423ddadfb78b42ab4e194f31819ad 9887 gcc-14_14.3.0-4_source.buildinfo
Files:
 e79cbad9eb672ca960adeddbb0edc0c5 42270 devel optional gcc-14_14.3.0-4.dsc
 6c5b7971422b7d2a66ca4abf521b8459 601952 devel optional gcc-14_14.3.0-4.debian.tar.xz
 008a73640be9c60d460c5da60b18a9fc 9887 devel optional gcc-14_14.3.0-4_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJEBAEBCgAuFiEE1WVxuIqLuvFAv2PWvX6qYHePpvUFAmiHr38QHGRva29AZGVi
aWFuLm9yZwAKCRC9fqpgd4+m9R2dEACrOQv3mctnhS+tLOL1kPXPT8KhLvNUevyp
XysPYqGTeoPyLNcNDZ8x6vrDKb6n7UH1jUHk+yRnyxzwKZ+LUcLMiSCevPpN4nr+
NsyFJNo5MTukyqdrIAtqStfjQgZPDsEOPFmUUFgjAk6c07qIbv9wwWjqSBhv8Rwg
4b5/tf5BLvCfjZg0PweyECCGCpfbdKfnoq1MxTy9FjDAMDJvHTQeiVw7lr9vi+Kr
/u6YvhNhilANdTgbesgd1/VQhVKdAMj2mgPQ45X87sM1wnRTVKmmfpFLrbzxaHph
6F6JZ4xmoDgvkwLjAdvXdSrCWhSW3mWmEwsfxCeSDSKAVAQg4e2Dv7F4hs2lbY+t
FtW0ILHT8B/w0O5slDR8lJWkNOgGicdOr/npVpUym9iZt5trk40pLt1PaP+PwcT6
Xp6YsFPr/vltkcLo3x9lzSyT1Z4xUeWJsnABvlu/CoHQiqINkQ6pzyBDnBHm5DbF
XdkQl+sNgexsIYQpSKJAh8UNmsOxb8GHlROjVrsCAqdcK3sx+u5eW5WyTe/zl2gG
I0hqk8QtNse4BPuDvVA4tS+VPqk/NYEP3QdxE7+r+U4y6UY5GusQtqpvTYRSIHyk
XZZAXGHjxUWwHrK0yIBZP7i94Dh2mue4J9fa8kotrtPFRG5h2WYeqa57DWwar3wh
ieOd9QFgqA==
=Jh8z
-----END PGP SIGNATURE-----

Attachment: pgplLP__pN_VA.pgp
Description: PGP signature


--- End Message ---

Reply to: