Ticket #775 (closed bug: fixed)

Opened 7 years ago

Last modified 7 years ago

ctime_r call in Solaris 10 SPARC

Reported by: florenz@… Owned by:
Priority: normal Milestone:
Component: Runtime System Version: 6.4.2
Keywords: Cc:
Operating System: Solaris Architecture: sparc
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

GHC 6.4.2 does not build on Solaris 10 because ctime_r takes three instead of two arguments.

The error is in file ghc/rts/RtsUtils.c. I did a quickfix to continue building but it is not very nice:

$ diff patched/ghc/rts/RtsUtils.c orig/ghc/rts/RtsUtils.c
190c190
<       ctime_r(&now, nowstr, 26);
---
>       ctime_r(&now, nowstr);

An extract of

$ man ctime

shows

SYNOPSIS
     #include <time.h>

     char *ctime(const time_t *clock);

     struct tm *localtime(const time_t *clock);

     struct tm *gmtime(const time_t *clock);

     char *asctime(const struct tm *tm);

     extern time_t timezone, altzone;
     extern int daylight;
     extern char *tzname[2];

     void tzset(void);

     char *ctime_r(const time_t *clock, char *buf, int buflen);

     struct tm *localtime_r(const time_t *restrict clock,  struct
     tm *restrict res);

     struct tm *gmtime_r(const time_t *restrict clock, struct  tm
     *restrict res);

     char *asctime_r(const struct tm *restrict tm, char *restrict
     buf, int buflen);

The exact OS version is

$ uname -a

SunOS bruja 5.10 Generic_118833-03 sun4u sparc SUNW,Sun-Fire

My suspect is that something in the autoconf spec is not correct for Solaris 10.

Regards,

Florian

Change History

Changed 7 years ago by simonmar

  • status changed from new to closed
  • resolution set to fixed

Fixed in 6.4 branch and HEAD.

Note: See TracTickets for help on using tickets.