diff options
-rw-r--r-- | libc/debian/changelog | 6 | ||||
-rw-r--r-- | libc/debian/libc1-illumos-i386.symbols | 2 | ||||
-rw-r--r-- | libc/debian/libc1.symbols.illumos-amd64 | 2 | ||||
-rw-r--r-- | libc/debian/patches/features.patch | 13 | ||||
-rw-r--r-- | libc/debian/patches/struct-tm.patch | 175 | ||||
-rwxr-xr-x | libc/debian/rules | 1 |
6 files changed, 107 insertions, 92 deletions
diff --git a/libc/debian/changelog b/libc/debian/changelog index c4aebfc..c253273 100644 --- a/libc/debian/changelog +++ b/libc/debian/changelog @@ -1,3 +1,9 @@ +libc (4.3+16) unstable; urgency=medium + + * More ABI fixes related to struct tm + + -- Igor Pashev <pashev.igor@gmail.com> Wed, 01 Apr 2015 11:36:18 +0300 + libc (4.3+15) unstable; urgency=medium * Updated debian/patches/struct-tm.patch: drop redefine_extname diff --git a/libc/debian/libc1-illumos-i386.symbols b/libc/debian/libc1-illumos-i386.symbols index 5831366..334bdc4 100644 --- a/libc/debian/libc1-illumos-i386.symbols +++ b/libc/debian/libc1-illumos-i386.symbols @@ -190,6 +190,8 @@ libc.so.1 libc1-illumos-i386 #MINVER# __getwchar_xpg5@SUNWprivate_1.1 2.10-1 __gnu_gmtime_r@DYSON_1 4.3+14 __gnu_localtime_r@DYSON_1 4.3+14 + __gnu_mktime@DYSON_1 4.3+15 + __gnu_timegm@DYSON_1 4.3+15 __huge_val@SYSVABI_1.3 2.10-1 __i_size@SUNWprivate_1.1 2.10-1 __idmap_flush_kcache@SUNWprivate_1.1 2.10-1 diff --git a/libc/debian/libc1.symbols.illumos-amd64 b/libc/debian/libc1.symbols.illumos-amd64 index 6bfa768..a8b512b 100644 --- a/libc/debian/libc1.symbols.illumos-amd64 +++ b/libc/debian/libc1.symbols.illumos-amd64 @@ -203,6 +203,8 @@ libc.so.1 libc1 #MINVER# __getwchar_xpg5@SUNWprivate_1.1 2.10-1 __gnu_gmtime_r@DYSON_1 4.3+14 __gnu_localtime_r@DYSON_1 4.3+14 + __gnu_mktime@DYSON_1 4.3+15 + __gnu_timegm@DYSON_1 4.3+15 __huge_val@SUNW_0.7 2.10-1 __i_size@SUNWprivate_1.1 2.10-1 __idmap_flush_kcache@SUNWprivate_1.1 2.10-1 diff --git a/libc/debian/patches/features.patch b/libc/debian/patches/features.patch index 845ba7a..6139130 100644 --- a/libc/debian/patches/features.patch +++ b/libc/debian/patches/features.patch @@ -563,3 +563,16 @@ Index: libc/usr/src/head/wordexp.h #include <sys/types.h> #ifdef __cplusplus +Index: libc/usr/src/head/iso/wchar_iso.h +=================================================================== +--- libc.orig/usr/src/head/iso/wchar_iso.h ++++ libc/usr/src/head/iso/wchar_iso.h +@@ -41,7 +41,7 @@ + + #pragma ident "%Z%%M% %I% %E% SMI" + +-#include <sys/feature_tests.h> ++#include <features.h> + #include <stdio_tag.h> + #include <wchar_impl.h> + #include <iso/time_iso.h> diff --git a/libc/debian/patches/struct-tm.patch b/libc/debian/patches/struct-tm.patch index a46e600..fa0f781 100644 --- a/libc/debian/patches/struct-tm.patch +++ b/libc/debian/patches/struct-tm.patch @@ -14,7 +14,7 @@ Index: libc/usr/src/head/iso/time_iso.h #ifdef __cplusplus extern "C" { -@@ -94,6 +94,13 @@ struct tm { /* see ctime(3) */ +@@ -94,8 +94,17 @@ struct tm { /* see ctime(3) */ int tm_wday; int tm_yday; int tm_isdst; @@ -27,6 +27,10 @@ Index: libc/usr/src/head/iso/time_iso.h +#endif }; ++#undef mktime ++#define mktime __gnu_mktime + + #if defined(__STDC__) Index: libc/usr/src/head/time.h =================================================================== @@ -41,38 +45,43 @@ Index: libc/usr/src/head/time.h #include <iso/time_iso.h> #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \ (_POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__) -@@ -80,10 +80,14 @@ typedef int timer_t; +@@ -80,6 +80,10 @@ typedef int timer_t; #if defined(__EXTENSIONS__) || \ (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \ (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT) --extern struct tm *gmtime_r(const time_t *_RESTRICT_KYWD, -+extern struct tm *__gnu_gmtime_r(const time_t *_RESTRICT_KYWD, - struct tm *_RESTRICT_KYWD); --extern struct tm *localtime_r(const time_t *_RESTRICT_KYWD, -+extern struct tm *__gnu_localtime_r(const time_t *_RESTRICT_KYWD, - struct tm *_RESTRICT_KYWD); +#undef gmtime_r +#undef localtime_r +#define gmtime_r __gnu_gmtime_r +#define localtime_r __gnu_localtime_r - #endif + extern struct tm *gmtime_r(const time_t *_RESTRICT_KYWD, + struct tm *_RESTRICT_KYWD); + extern struct tm *localtime_r(const time_t *_RESTRICT_KYWD, +@@ -178,6 +182,8 @@ extern int daylight; #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \ + defined(__EXTENSIONS__) ++#undef timegm ++#define timegm __gnu_timegm + extern time_t timegm(struct tm *); + extern int cftime(char *, char *, const time_t *); + extern int ascftime(char *, const char *, const struct tm *); Index: libc/usr/src/lib/libc/port/gen/localtime.c =================================================================== --- libc.orig/usr/src/lib/libc/port/gen/localtime.c +++ libc/usr/src/lib/libc/port/gen/localtime.c -@@ -117,6 +117,9 @@ +@@ -117,6 +117,11 @@ #include <sys/stat.h> #include <sys/mman.h> +#undef gmtime_r +#undef localtime_r ++#undef mktime ++#undef timegm + /* JAN_01_1902 cast to (int) - negative number of seconds from 1970 */ #define JAN_01_1902 (int)0x8017E880 #define LEN_TZDIR (sizeof (TZDIR) - 1) -@@ -488,6 +491,14 @@ gmtime_r(const time_t *timep, struct tm +@@ -488,6 +493,14 @@ gmtime_r(const time_t *timep, struct tm return (offtime_u((time_t)*timep, 0L, p_tm)); } @@ -87,7 +96,7 @@ Index: libc/usr/src/lib/libc/port/gen/localtime.c /* * Accepts a time_t, returns a tm struct based on it, with * no local timezone adjustment. -@@ -507,7 +518,7 @@ gmtime(const time_t *timep) +@@ -507,7 +520,7 @@ gmtime(const time_t *timep) if (p_tm == NULL) /* memory allocation failure */ p_tm = &tm; /* use static buffer and hope for the best */ @@ -96,7 +105,7 @@ Index: libc/usr/src/lib/libc/port/gen/localtime.c } /* -@@ -649,6 +660,34 @@ localtime_r(const time_t *timep, struct +@@ -649,6 +662,34 @@ localtime_r(const time_t *timep, struct return (rt); } @@ -131,7 +140,7 @@ Index: libc/usr/src/lib/libc/port/gen/localtime.c /* * Accepts a time_t, returns a tm struct based on it, correcting * for the local timezone. Produces documented side-effects to -@@ -673,7 +712,7 @@ localtime(const time_t *timep) +@@ -673,7 +714,7 @@ localtime(const time_t *timep) if (p_tm == NULL) /* memory allocation failure */ p_tm = &tm; /* use static buffer and hope for the best */ @@ -140,95 +149,77 @@ Index: libc/usr/src/lib/libc/port/gen/localtime.c } /* -Index: libc/usr/src/head/iso/wchar_iso.h -=================================================================== ---- libc.orig/usr/src/head/iso/wchar_iso.h -+++ libc/usr/src/head/iso/wchar_iso.h -@@ -41,7 +41,7 @@ +@@ -682,7 +723,7 @@ localtime(const time_t *timep) + * extern global zone state variables. (See mktime(3C)). + */ + static time_t +-mktime1(struct tm *tmptr, int usetz) ++mktime1(struct tm *tmptr, int usetz, int gnu) + { + struct tm _tm; + long long t; /* must hold more than 32-bit time_t */ +@@ -823,7 +864,19 @@ mktime1(struct tm *tmptr, int usetz) + mketimerrno = EOVERFLOW; + t = -1; + } else { +- *tmptr = _tm; ++ if (gnu) ++ *tmptr = _tm; ++ else { ++ tmptr->tm_sec = _tm.tm_sec; ++ tmptr->tm_min = _tm.tm_min; ++ tmptr->tm_hour = _tm.tm_hour; ++ tmptr->tm_mday = _tm.tm_mday; ++ tmptr->tm_mon = _tm.tm_mon; ++ tmptr->tm_year = _tm.tm_year; ++ tmptr->tm_wday = _tm.tm_wday; ++ tmptr->tm_yday = _tm.tm_yday; ++ tmptr->tm_isdst = _tm.tm_isdst; ++ } + } - #pragma ident "%Z%%M% %I% %E% SMI" + lmutex_unlock(&_time_lock); +@@ -837,15 +890,26 @@ mktime1(struct tm *tmptr, int usetz) + time_t + mktime(struct tm *tmptr) + { +- return (mktime1(tmptr, TRUE)); ++ return (mktime1(tmptr, TRUE, 0)); + } --#include <sys/feature_tests.h> -+#include <features.h> - #include <stdio_tag.h> - #include <wchar_impl.h> - #include <iso/time_iso.h> + time_t + timegm(struct tm *tmptr) + { +- return (mktime1(tmptr, FALSE)); ++ return (mktime1(tmptr, FALSE, 0)); + } + ++time_t ++__gnu_mktime(struct tm *tmptr) ++{ ++ return (mktime1(tmptr, TRUE, 1)); ++} ++ ++time_t ++__gnu_timegm(struct tm *tmptr) ++{ ++ return (mktime1(tmptr, FALSE, 1)); ++} + + /* + * Sets extern global zone state variables based on the current Index: libc/usr/src/lib/libc/port/mapfile-vers =================================================================== --- libc.orig/usr/src/lib/libc/port/mapfile-vers +++ libc/usr/src/lib/libc/port/mapfile-vers -@@ -120,6 +120,8 @@ SYMBOL_VERSION ILLUMOS_0.4 { # Illumos a +@@ -120,6 +120,10 @@ SYMBOL_VERSION ILLUMOS_0.4 { # Illumos a SYMBOL_VERSION DYSON_1 { global: + __gnu_gmtime_r; + __gnu_localtime_r; ++ __gnu_mktime; ++ __gnu_timegm; _so_accept4; cfmakeraw; error; -Index: libc/usr/src/lib/libc/port/gen/cftime.c -=================================================================== ---- libc.orig/usr/src/lib/libc/port/gen/cftime.c -+++ libc/usr/src/lib/libc/port/gen/cftime.c -@@ -76,7 +76,7 @@ cftime(char *buf, char *format, const ti - struct tm res; - struct tm *p; - -- p = localtime_r(t, &res); -+ p = __gnu_localtime_r(t, &res); - if (p == NULL) { - *buf = '\0'; - return (0); -Index: libc/usr/src/lib/libc/port/gen/ctime_r.c -=================================================================== ---- libc.orig/usr/src/lib/libc/port/gen/ctime_r.c -+++ libc/usr/src/lib/libc/port/gen/ctime_r.c -@@ -86,6 +86,8 @@ - #include "libc.h" - - -+/* TODO: __gnu_localtime_r is not actually used here. */ -+ - /* - * POSIX.1c Draft-6 version of the function ctime_r. - * It was implemented by Solaris 2.3. -@@ -95,7 +97,7 @@ ctime_r(const time_t *t, char *buffer, i - { - struct tm res; - -- if (localtime_r(t, &res) == NULL) -+ if (__gnu_localtime_r(t, &res) == NULL) - return (NULL); - - if (asctime_r(&res, buffer, buflen) == NULL) -@@ -113,7 +115,7 @@ __posix_ctime_r(const time_t *t, char *b - { - struct tm res; - -- if (localtime_r(t, &res) == NULL) -+ if (__gnu_localtime_r(t, &res) == NULL) - return (NULL); - - if (__posix_asctime_r(&res, buffer) == NULL) -Index: libc/usr/src/lib/libc/port/locale/strptime.c -=================================================================== ---- libc.orig/usr/src/lib/libc/port/locale/strptime.c -+++ libc/usr/src/lib/libc/port/locale/strptime.c -@@ -419,7 +419,7 @@ label: - } - errno = sverrno; - buf = cp; -- (void) gmtime_r(&t, tm); -+ (void) __gnu_gmtime_r(&t, tm); - *flagsp |= F_GMT; - } - break; -@@ -511,7 +511,7 @@ label: - if (!recurse) { - if (buf && (*flagsp & F_GMT)) { - time_t t = timegm(tm); -- (void) localtime_r(&t, tm); -+ (void) __gnu_localtime_r(&t, tm); /* TODO: not actually used here. */ - } - } - diff --git a/libc/debian/rules b/libc/debian/rules index 94d2327..0ac1acd 100755 --- a/libc/debian/rules +++ b/libc/debian/rules @@ -99,6 +99,7 @@ unpack-stamp: dh_testdir # TODO: unpack only required stuff dh_illumos_gate + rm -fv usr/src/uts/common/sys/feature_tests.h echo 'export DEB_CRYPT_MODULE_DIR_32="$$DEB_LIBDIR_32/security"' >> usr/env.sh echo 'export DEB_CRYPT_MODULE_DIR_64="$$DEB_LIBDIR_64/security"' >> usr/env.sh touch $@ |