public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/110779] New: SysClock can not read the clock
@ 2023-07-23 19:55 gaius at gcc dot gnu.org
  2023-07-23 19:56 ` [Bug modula2/110779] " gaius at gcc dot gnu.org
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-07-23 19:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

            Bug ID: 110779
           Summary: SysClock can not read the clock
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: gaius at gcc dot gnu.org
  Target Milestone: ---

Relayed from the gm2 mailing list:

can you please have a short check - my versions of the compiler now
always seem to have a return value of "FALSE" for SysClock.CanGetClock();

Just notices as I had update one test routine and noted that I was
always testing against the same set of data - the random number
generator uses a seed depended on the system time.


-----

Shot check routine:

MODULE TstSysClock;

IMPORT SysClock;
IMPORT STextIO;

BEGIN
       STextIO.WriteLn;
       STextIO.WriteLn;
       IF SysClock.CanGetClock() THEN
         STextIO.WriteString(" clock can be read");
       ELSE
         STextIO.WriteString(" clock can NOT be read");
       END;
       STextIO.WriteLn;
       STextIO.WriteLn;
END TstSysClock.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
@ 2023-07-23 19:56 ` gaius at gcc dot gnu.org
  2023-08-04  4:04 ` gaius at gcc dot gnu.org
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-07-23 19:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-07-23
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #1 from Gaius Mulley <gaius at gcc dot gnu.org> ---
$ gm2 -g TetSysClock.mod
$ ./a.out 

 clock can NOT be read

confirmed - many thanks for the bug report - will fix!

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
  2023-07-23 19:56 ` [Bug modula2/110779] " gaius at gcc dot gnu.org
@ 2023-08-04  4:04 ` gaius at gcc dot gnu.org
  2023-08-04 12:17 ` gaius at gcc dot gnu.org
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-08-04  4:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

--- Comment #2 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 55683
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55683&action=edit
Proposed fix

Here is a proposed fix together with three regression tests.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
  2023-07-23 19:56 ` [Bug modula2/110779] " gaius at gcc dot gnu.org
  2023-08-04  4:04 ` gaius at gcc dot gnu.org
@ 2023-08-04 12:17 ` gaius at gcc dot gnu.org
  2023-08-05 16:39 ` cvs-commit at gcc dot gnu.org
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-08-04 12:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #55683|0                           |1
        is obsolete|                            |

--- Comment #3 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 55687
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55687&action=edit
Proposed fix v2

The previous patch was missing some new files.  This has successfully
bootstrapped on x86_64 and aarch64.  I'd like to see it bootstrap on ppc64le,
x86_32 and armv7l before it is git committed (as the libgm2 automake
{Makefile.in, configure, config.h} have been regenerated).

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-08-04 12:17 ` gaius at gcc dot gnu.org
@ 2023-08-05 16:39 ` cvs-commit at gcc dot gnu.org
  2023-08-05 16:43 ` gaius at gcc dot gnu.org
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-05 16:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gaius Mulley <gaius@gcc.gnu.org>:

https://gcc.gnu.org/g:0826ebd633e38bd55abd161c15deb431420f82a3

commit r14-3006-g0826ebd633e38bd55abd161c15deb431420f82a3
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Sat Aug 5 17:35:12 2023 +0100

    PR modula2/110779 SysClock can not read the clock

    This patch completes the implementation of the ISO module
    SysClock.mod.  Three new testcases are provided.  wrapclock.{cc,def}
    are new support files providing access to clock_settime, clock_gettime
    and glibc timezone variables.

    gcc/m2/ChangeLog:

            PR modula2/110779
            * gm2-libs-iso/SysClock.mod: Re-implement using wrapclock.
            * gm2-libs-iso/wrapclock.def: New file.

    libgm2/ChangeLog:

            PR modula2/110779
            * config.h.in: Regenerate.
            * configure: Regenerate.
            * configure.ac (GM2_CHECK_LIB): Check for clock_gettime
            and clock_settime.
            * libm2iso/Makefile.am (M2DEFS): Add wrapclock.def.
            * libm2iso/Makefile.in: Regenerate.
            * libm2iso/wraptime.cc: Replace HAVE_TIMEVAL with
            HAVE_STRUCT_TIMEVAL.
            * libm2iso/wrapclock.cc: New file.

    gcc/testsuite/ChangeLog:

            PR modula2/110779
            * gm2/iso/run/pass/m2date.mod: New test.
            * gm2/iso/run/pass/testclock.mod: New test.
            * gm2/iso/run/pass/testclock2.mod: New test.

    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-08-05 16:39 ` cvs-commit at gcc dot gnu.org
@ 2023-08-05 16:43 ` gaius at gcc dot gnu.org
  2023-08-07 14:10 ` cvs-commit at gcc dot gnu.org
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-08-05 16:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Closing now that the patch has been applied.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-08-05 16:43 ` gaius at gcc dot gnu.org
@ 2023-08-07 14:10 ` cvs-commit at gcc dot gnu.org
  2023-08-07 17:07 ` ro at gcc dot gnu.org
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-07 14:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Gaius Mulley
<gaius@gcc.gnu.org>:

https://gcc.gnu.org/g:4f8d84955dd5c9d2882d09e9c249240efe3a02aa

commit r13-7691-g4f8d84955dd5c9d2882d09e9c249240efe3a02aa
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Mon Aug 7 15:08:49 2023 +0100

    PR modula2/110779 SysClock can not read the clock

    This patch completes the implementation of the ISO module
    SysClock.mod.  Three new testcases are provided.  wrapclock.{cc,def}
    are new support files providing access to clock_settime, clock_gettime
    and glibc timezone variables.

    gcc/m2/ChangeLog:

            PR modula2/110779
            * gm2-libs-iso/SysClock.mod: Re-implement using wrapclock.
            * gm2-libs-iso/wrapclock.def: New file.

    libgm2/ChangeLog:

            PR modula2/110779
            * config.h.in: Regenerate.
            * configure: Regenerate.
            * configure.ac (GM2_CHECK_LIB): Check for clock_gettime
            and clock_settime.
            * libm2iso/Makefile.am (M2DEFS): Add wrapclock.def.
            * libm2iso/Makefile.in: Regenerate.
            * libm2iso/wraptime.cc: Replace HAVE_TIMEVAL with
            HAVE_STRUCT_TIMEVAL.
            * libm2iso/wrapclock.cc: New file.

    gcc/testsuite/ChangeLog:

            PR modula2/110779
            * gm2/iso/run/pass/m2date.mod: New test.
            * gm2/iso/run/pass/testclock.mod: New test.
            * gm2/iso/run/pass/testclock2.mod: New test.

    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-08-07 14:10 ` cvs-commit at gcc dot gnu.org
@ 2023-08-07 17:07 ` ro at gcc dot gnu.org
  2023-08-07 23:51 ` gaius at gcc dot gnu.org
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ro at gcc dot gnu.org @ 2023-08-07 17:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ro at gcc dot gnu.org
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #7 from Rainer Orth <ro at gcc dot gnu.org> ---
This patch broke Solaris bootstrap:

/vol/gcc/src/hg/master/local/libgm2/libm2iso/wrapclock.cc: In function 'long
int m2iso_wrapclock_timezone()':
/vol/gcc/src/hg/master/local/libgm2/libm2iso/wrapclock.cc:77:21: error: 'struct
std::tm' has no member named 'tm_gmtoff'
   77 |       return result.tm_gmtoff;
      |                     ^~~~~~~~~
make[5]: *** [Makefile:914: wrapclock.lo] Error 1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-08-07 17:07 ` ro at gcc dot gnu.org
@ 2023-08-07 23:51 ` gaius at gcc dot gnu.org
  2023-08-08 11:40 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-08-07 23:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

--- Comment #8 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 55703
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55703&action=edit
Proposed fix (addendum)

Here is a patch which tests for all the functions and structs in wrapclock.cc.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-08-07 23:51 ` gaius at gcc dot gnu.org
@ 2023-08-08 11:40 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2023-08-09  8:36 ` cvs-commit at gcc dot gnu.org
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2023-08-08 11:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

--- Comment #9 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #8 from Gaius Mulley <gaius at gcc dot gnu.org> ---
> Created attachment 55703
>   --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55703&action=edit
> Proposed fix (addendum)
>
> Here is a patch which tests for all the functions and structs in wrapclock.cc.

That patch does restore i386-pc-solaris2.11 bootstrap, thanks.

Testsuite results are good, with two exceptions: for 32-bit compilation
(only, 64-bit is fine), two tests reliably time out at all optimization
levels:

WARNING: gm2/iso/run/pass/m2date.mod execution,  -O  program timed out.

WARNING: gm2/iso/run/pass/testclock2.mod execution,  -O  program timed out.

Running them under truss shows that the last system call each is

5032:   clock_settime(3, 0x080975F0)                    Err#1 EPERM [sys_time]

Running testclock2.mod under gdb shows

Thread 2 received signal SIGINT, Interrupt.
[Switching to Thread 1 (LWP 1)]
0x08064ad4 in daysInMonth (year=42582828, month=7)
    at
/vol/gcc/src/hg/master/local/libgm2/libm2iso/../../gcc/m2/gm2-libs-iso/SysClock.mod:225
225     BEGIN
(gdb) bt
#0  0x08064ad4 in daysInMonth (year=42582828, month=7)
    at
/vol/gcc/src/hg/master/local/libgm2/libm2iso/../../gcc/m2/gm2-libs-iso/SysClock.mod:225
#1  0x08065152 in daysInYear (year=42582828, month=<optimized out>, 
    day=<optimized out>)
    at
/vol/gcc/src/hg/master/local/libgm2/libm2iso/../../gcc/m2/gm2-libs-iso/SysClock.mod:132
#2  ExtractDate (day=@0x808748c: 0, month=@0x8087484: 0, year=@0x8087480: 0, 
    days=53508608997914)
    at
/vol/gcc/src/hg/master/local/libgm2/libm2iso/../../gcc/m2/gm2-libs-iso/SysClock.mod:152
#3  m2iso_SysClock_GetClock (userData=...)
    at
/vol/gcc/src/hg/master/local/libgm2/libm2iso/../../gcc/m2/gm2-libs-iso/SysClock.mod:204
#4  0x0805f652 in _M2_testclock2_init ()
#5  0x08068d7a in m2pim_M2Dependent_ConstructModules (
    applicationmodule=0x805c2b4, libname=0x805c2bf, 
    overrideliborder=0x805c2d8, argc=1, argv=0xfeffdafc, envp=0xfeffdb04)
    at
/vol/gcc/src/hg/master/local/libgm2/libm2pim/../../gcc/m2/gm2-libs/M2Dependent.mod:809
#6  0x0805fca9 in _M2_init ()
#7  0x0805fcee in main ()

That year value seems very strange.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-08-08 11:40 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2023-08-09  8:36 ` cvs-commit at gcc dot gnu.org
  2023-08-09 10:20 ` cvs-commit at gcc dot gnu.org
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-09  8:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gaius Mulley <gaius@gcc.gnu.org>:

https://gcc.gnu.org/g:e3476ed2233911e6a578488899179bd91e818947

commit r14-3097-ge3476ed2233911e6a578488899179bd91e818947
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Wed Aug 9 09:35:13 2023 +0100

    PR modula2/110779: libgm2 fix solaris bootstrap check for tm_gmtoff

    This patch defensively checks for every C function and every struct
    used in wrapclock.cc.  It adds return values to GetTimespec and
    SetTimespec to allow the module to return a code representing
    unavailable.

    gcc/m2/ChangeLog:

            PR modula2/110779
            * gm2-libs-iso/SysClock.mod (GetClock): Test GetTimespec
            return value.
            (SetClock): Test SetTimespec return value.
            * gm2-libs-iso/wrapclock.def (GetTimespec): Add integer
            return type.
            (SetTimespec): Add integer return type.

    libgm2/ChangeLog:

            PR modula2/110779
            * config.h.in: Regenerate.
            * configure: Regenerate.
            * configure.ac (AC_CACHE_CHECK): Check for tm_gmtoff field in
            struct tm.
            (GM2_CHECK_LIB): Check for daylight, timezone and tzname.
            * libm2iso/wrapclock.cc (timezone): Guard against absence of
            struct tm and tm_gmtoff.
            (daylight): Check for daylight.
            (timezone): Check for timezone.
            (isdst): Check for isdst.
            (tzname): Check for tzname.
            (GetTimeRealtime): Check for struct timespec.
            (SetTimeRealtime): Check for struct timespec.
            (InitTimespec): Check for struct timespec.
            (KillTimespec): Check for struct timespec.
            (SetTimespec): Check for struct timespec.
            (GetTimespec): Check for struct timespec.

    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2023-08-09  8:36 ` cvs-commit at gcc dot gnu.org
@ 2023-08-09 10:20 ` cvs-commit at gcc dot gnu.org
  2023-08-10 14:29 ` gaius at gcc dot gnu.org
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-09 10:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Gaius Mulley
<gaius@gcc.gnu.org>:

https://gcc.gnu.org/g:9043e8a8d82ac2afaf8b5fcdfcbbd12f759b14d4

commit r13-7702-g9043e8a8d82ac2afaf8b5fcdfcbbd12f759b14d4
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Wed Aug 9 11:19:50 2023 +0100

    PR modula2/110779: libgm2 fix solaris bootstrap check for tm_gmtoff

    This patch defensively checks for every C function and every struct
    used in wrapclock.cc.  It adds return values to GetTimespec and
    SetTimespec to allow the module to return a code representing
    unavailable.

    gcc/m2/ChangeLog:

            PR modula2/110779
            * gm2-libs-iso/SysClock.mod (GetClock): Test GetTimespec
            return value.
            (SetClock): Test SetTimespec return value.
            * gm2-libs-iso/wrapclock.def (GetTimespec): Add integer
            return type.
            (SetTimespec): Add integer return type.

    libgm2/ChangeLog:

            PR modula2/110779
            * config.h.in: Regenerate.
            * configure: Regenerate.
            * configure.ac (AC_CACHE_CHECK): Check for tm_gmtoff field in
            struct tm.
            (GM2_CHECK_LIB): Check for daylight, timezone and tzname.
            * libm2iso/wrapclock.cc (timezone): Guard against absence of
            struct tm and tm_gmtoff.
            (daylight): Check for daylight.
            (timezone): Check for timezone.
            (isdst): Check for isdst.
            (tzname): Check for tzname.
            (GetTimeRealtime): Check for struct timespec.
            (SetTimeRealtime): Check for struct timespec.
            (InitTimespec): Check for struct timespec.
            (KillTimespec): Check for struct timespec.
            (SetTimespec): Check for struct timespec.
            (GetTimespec): Check for struct timespec.

    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2023-08-09 10:20 ` cvs-commit at gcc dot gnu.org
@ 2023-08-10 14:29 ` gaius at gcc dot gnu.org
  2023-08-12 15:27 ` iains at gcc dot gnu.org
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-08-10 14:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

--- Comment #12 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 55717
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55717&action=edit
Another patch for Darwin

More portability configure checks and fixes to wrapclock.cc.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2023-08-10 14:29 ` gaius at gcc dot gnu.org
@ 2023-08-12 15:27 ` iains at gcc dot gnu.org
  2023-08-12 17:19 ` cvs-commit at gcc dot gnu.org
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: iains at gcc dot gnu.org @ 2023-08-12 15:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iains at gcc dot gnu.org

--- Comment #13 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Gaius Mulley from comment #12)
> Created attachment 55717 [details]
> Another patch for Darwin
> 
> More portability configure checks and fixes to wrapclock.cc.

This patch fixes bootstrap on the affected versions - I've tried it on old and
new Darwin + a cross.  There are some time-related test fails, but that can be
handled separately.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2023-08-12 15:27 ` iains at gcc dot gnu.org
@ 2023-08-12 17:19 ` cvs-commit at gcc dot gnu.org
  2023-08-12 19:21 ` cvs-commit at gcc dot gnu.org
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-12 17:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gaius Mulley <gaius@gcc.gnu.org>:

https://gcc.gnu.org/g:63fb0bedb8077ac1e6b6337f198b4eae30813fbc

commit r14-3180-g63fb0bedb8077ac1e6b6337f198b4eae30813fbc
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Sat Aug 12 18:17:41 2023 +0100

    PR modula2/110779 SysClock can not read the clock (Darwin portability
fixes)

    This patch adds corrections to defensively check against glibc functions,
    structures and contains fallbacks.  These fixes were required under Darwin.

    gcc/m2/ChangeLog:

            PR modula2/110779
            * gm2-libs-iso/SysClock.mod (EpochTime): New procedure.
            (GetClock): Call EpochTime if the C time functions are
            unavailable.
            * gm2-libs-iso/wrapclock.def (istimezone): New function
            definition.

    libgm2/ChangeLog:

            PR modula2/110779
            * configure: Regenerate.
            * configure.ac: Provide special case test for Darwin cross
            configuration.
            (GLIBCXX_CONFIGURE): New statement.
            (GLIBCXX_CHECK_GETTIMEOFDAY): New statement.
            (GLIBCXX_ENABLE_LIBSTDCXX_TIME): New statement.
            * libm2iso/wrapclock.cc: New sys/time.h conditional include.
            (sys/syscall.h): Conditional include.
            (unistd.h): Conditional include.
            (GetTimeRealtime): Re-implement.
            (SetTimeRealtime): Re-implement.
            (timezone): Re-implement.
            (istimezone): New function.
            (daylight): Re-implement.
            (isdst): Re-implement.
            (tzname): Re-implement.

    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2023-08-12 17:19 ` cvs-commit at gcc dot gnu.org
@ 2023-08-12 19:21 ` cvs-commit at gcc dot gnu.org
  2023-08-12 19:24 ` gaius at gcc dot gnu.org
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-12 19:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Gaius Mulley
<gaius@gcc.gnu.org>:

https://gcc.gnu.org/g:a11ca333df2b6abb4187b39f32bb35a195d8fb33

commit r13-7716-ga11ca333df2b6abb4187b39f32bb35a195d8fb33
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Sat Aug 12 20:20:45 2023 +0100

    PR modula2/110779 SysClock can not read the clock (Darwin fixes)

    This patch adds corrections to defensively check against glibc
    functions, structures and contains fallbacks.  These fixes were
    required under Darwin.

    gcc/m2/ChangeLog:

            PR modula2/110779
            * gm2-libs-iso/SysClock.mod (EpochTime): New procedure.
            (GetClock): Call EpochTime if the C time functions are
            unavailable.
            * gm2-libs-iso/wrapclock.def (istimezone): New function
            definition.

    libgm2/ChangeLog:

            PR modula2/110779
            * configure: Regenerate.
            * configure.ac: Provide special case test for Darwin cross
            configuration.
            (GLIBCXX_CONFIGURE): New statement.
            (GLIBCXX_CHECK_GETTIMEOFDAY): New statement.
            (GLIBCXX_ENABLE_LIBSTDCXX_TIME): New statement.
            * libm2iso/wrapclock.cc: New sys/time.h conditional include.
            (sys/syscall.h): Conditional include.
            (unistd.h): Conditional include.
            (GetTimeRealtime): Re-implement.
            (SetTimeRealtime): Re-implement.
            (timezone): Re-implement.
            (istimezone): New function.
            (daylight): Re-implement.
            (isdst): Re-implement.
            (tzname): Re-implement.

    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2023-08-12 19:21 ` cvs-commit at gcc dot gnu.org
@ 2023-08-12 19:24 ` gaius at gcc dot gnu.org
  2023-08-13 17:47 ` egallager at gcc dot gnu.org
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-08-12 19:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|REOPENED                    |RESOLVED

--- Comment #16 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Many thanks for all the testing - closing now that the patches have been
applied.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2023-08-12 19:24 ` gaius at gcc dot gnu.org
@ 2023-08-13 17:47 ` egallager at gcc dot gnu.org
  2023-11-09  7:45 ` tschwinge at gcc dot gnu.org
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: egallager at gcc dot gnu.org @ 2023-08-13 17:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egallager at gcc dot gnu.org

--- Comment #17 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #13)
> (In reply to Gaius Mulley from comment #12)
> > Created attachment 55717 [details]
> > Another patch for Darwin
> > 
> > More portability configure checks and fixes to wrapclock.cc.
> 
> This patch fixes bootstrap on the affected versions - I've tried it on old
> and new Darwin + a cross.  There are some time-related test fails, but that
> can be handled separately.

So is this why I was getting all the timeouts in my most recent test results?
https://gcc.gnu.org/pipermail/gcc-testresults/2023-August/793205.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2023-08-13 17:47 ` egallager at gcc dot gnu.org
@ 2023-11-09  7:45 ` tschwinge at gcc dot gnu.org
  2023-11-09 18:10 ` gaius at gcc dot gnu.org
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2023-11-09  7:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tschwinge at gcc dot gnu.org

--- Comment #18 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
Noticed by chance:

(In reply to CVS Commits from comment #15)
> commit r13-7716-ga11ca333df2b6abb4187b39f32bb35a195d8fb33
> Author: Gaius Mulley <gaiusmod2@gmail.com>
> Date:   Sat Aug 12 20:20:45 2023 +0100
> 
>     PR modula2/110779 SysClock can not read the clock (Darwin fixes)
>     
>     This patch adds corrections to defensively check against glibc
>     functions, structures and contains fallbacks.  These fixes were
>     required under Darwin.

>     libgm2/ChangeLog:
>     
>             PR modula2/110779

>             * configure.ac: Provide special case test for Darwin cross
>             configuration.

That's 'GLIBCXX_IS_NATIVE' -- but that's then not actually used anywhere?

>             (GLIBCXX_CONFIGURE): New statement.
>             (GLIBCXX_CHECK_GETTIMEOFDAY): New statement.
>             (GLIBCXX_ENABLE_LIBSTDCXX_TIME): New statement.

But without actual definitions; spotted during libgm2 'configure':

    [...]
    checking target system type... powerpc64le-unknown-linux-gnu
    [...]/source-gcc/libgm2/configure: line 4013: GLIBCXX_CONFIGURE: command
not found
    [...]/source-gcc/libgm2/configure: line 4016: GLIBCXX_CHECK_GETTIMEOFDAY:
command not found
    [...]/source-gcc/libgm2/configure: line 4019:
GLIBCXX_ENABLE_LIBSTDCXX_TIME: command not found
    checking for a BSD-compatible install... /usr/bin/install -c
    [...]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (17 preceding siblings ...)
  2023-11-09  7:45 ` tschwinge at gcc dot gnu.org
@ 2023-11-09 18:10 ` gaius at gcc dot gnu.org
  2023-11-10 20:04 ` gaius at gcc dot gnu.org
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-11-09 18:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #19 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Many thanks for spotting this error - will fix!

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (18 preceding siblings ...)
  2023-11-09 18:10 ` gaius at gcc dot gnu.org
@ 2023-11-10 20:04 ` gaius at gcc dot gnu.org
  2023-11-10 20:47 ` gaius at gcc dot gnu.org
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-11-10 20:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

--- Comment #20 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 56558
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56558&action=edit
Proposed fix (libgm2/acinclude.m4 and libgm2/configure.host)

Here is a proposed patch for a new file libgm2/acinclude.m4 and
libgm2/configure.host.  These were taken from libstdc++-v3 and heavily pruned.
I've seen it bootstrap under netbsd, freebsd, aarch64 linux, x86_64 linux.

acinclude.m4 provides the missing autoconf functions.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (19 preceding siblings ...)
  2023-11-10 20:04 ` gaius at gcc dot gnu.org
@ 2023-11-10 20:47 ` gaius at gcc dot gnu.org
  2023-11-13 15:12 ` cvs-commit at gcc dot gnu.org
  2024-01-24 13:45 ` gaius at gcc dot gnu.org
  22 siblings, 0 replies; 24+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-11-10 20:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

--- Comment #21 from Gaius Mulley <gaius at gcc dot gnu.org> ---
I've just noticed that the patch doesn't address the issue of
GLIBCXX_IS_NATIVE.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (20 preceding siblings ...)
  2023-11-10 20:47 ` gaius at gcc dot gnu.org
@ 2023-11-13 15:12 ` cvs-commit at gcc dot gnu.org
  2024-01-24 13:45 ` gaius at gcc dot gnu.org
  22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-13 15:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

--- Comment #22 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gaius Mulley <gaius@gcc.gnu.org>:

https://gcc.gnu.org/g:0036702555195d3fd8089577b7c1e2ce5f2ff5b1

commit r14-5416-g0036702555195d3fd8089577b7c1e2ce5f2ff5b1
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Mon Nov 13 15:11:50 2023 +0000

    PR modula2/110779: Add reduced acinclude.m4 to allow interrogation of time
features

    This patch adds libgm2/acinclude.m4 and libgm2/configure.host which
    are reduced versions from libstdc++-v3.  They currently allow for
    discovering the time features available in libc and will be extended
    to discover availability of ieee128 long double support in the near
    future.  These files were also added to provide the functions:
    GLIBCXX_CONFIGURE, GLIBCXX_CHECK_GETTIMEOFDAY and
    GLIBCXX_ENABLE_LIBSTDCXX_TIME called by configure.ac.

    libgm2/ChangeLog:

            PR modula2/110779
            * Makefile.in: Regenerate.
            * aclocal.m4: Regenerate.
            * config.h.in: Regenerate.
            * configure: Regenerate.
            * configure.ac: Remove newline.
            * libm2cor/Makefile.in: Regenerate.
            * libm2iso/Makefile.in: Regenerate.
            * libm2log/Makefile.in: Regenerate.
            * libm2min/Makefile.in: Regenerate.
            * libm2pim/Makefile.in: Regenerate.
            * acinclude.m4: New file.
            * configure.host: New file.

    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug modula2/110779] SysClock can not read the clock
  2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
                   ` (21 preceding siblings ...)
  2023-11-13 15:12 ` cvs-commit at gcc dot gnu.org
@ 2024-01-24 13:45 ` gaius at gcc dot gnu.org
  22 siblings, 0 replies; 24+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-01-24 13:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110779

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #23 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Closing now that the clock regression tests appear to pass on the reported
platforms.

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2024-01-24 13:45 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-23 19:55 [Bug modula2/110779] New: SysClock can not read the clock gaius at gcc dot gnu.org
2023-07-23 19:56 ` [Bug modula2/110779] " gaius at gcc dot gnu.org
2023-08-04  4:04 ` gaius at gcc dot gnu.org
2023-08-04 12:17 ` gaius at gcc dot gnu.org
2023-08-05 16:39 ` cvs-commit at gcc dot gnu.org
2023-08-05 16:43 ` gaius at gcc dot gnu.org
2023-08-07 14:10 ` cvs-commit at gcc dot gnu.org
2023-08-07 17:07 ` ro at gcc dot gnu.org
2023-08-07 23:51 ` gaius at gcc dot gnu.org
2023-08-08 11:40 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-09  8:36 ` cvs-commit at gcc dot gnu.org
2023-08-09 10:20 ` cvs-commit at gcc dot gnu.org
2023-08-10 14:29 ` gaius at gcc dot gnu.org
2023-08-12 15:27 ` iains at gcc dot gnu.org
2023-08-12 17:19 ` cvs-commit at gcc dot gnu.org
2023-08-12 19:21 ` cvs-commit at gcc dot gnu.org
2023-08-12 19:24 ` gaius at gcc dot gnu.org
2023-08-13 17:47 ` egallager at gcc dot gnu.org
2023-11-09  7:45 ` tschwinge at gcc dot gnu.org
2023-11-09 18:10 ` gaius at gcc dot gnu.org
2023-11-10 20:04 ` gaius at gcc dot gnu.org
2023-11-10 20:47 ` gaius at gcc dot gnu.org
2023-11-13 15:12 ` cvs-commit at gcc dot gnu.org
2024-01-24 13:45 ` gaius at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).