diff options
author | dholland <dholland@pkgsrc.org> | 2012-12-17 01:28:29 +0000 |
---|---|---|
committer | dholland <dholland@pkgsrc.org> | 2012-12-17 01:28:29 +0000 |
commit | 7b2974bd6b12edb338108b99ee7bb04157b28567 (patch) | |
tree | a4a80d4bae824c26560ea8cdba18809d98685579 | |
parent | 0cc1e6941d334eeb7594546bc80b9b26c5dd9348 (diff) | |
download | pkgsrc-7b2974bd6b12edb338108b99ee7bb04157b28567.tar.gz |
Disable (on NetBSD) ill-conceived GNUish mktime() code that generates
a compile-time assertion. There is no need for this code on NetBSD, or
probably anywhere else, as mktime() is a standard part of libc.
The broken code was apparently reported upstream last year, with
predictable results: http://sourceware.org/bugzilla/show_bug.cgi?id=12401
While here also fix the mktime configure test, which exercises
undefined behavior. With gcc 4.5 this causes the build to hang in an
infinite loop for sixty seconds until an alarm() goes off.
Fixes the build on 32-bit NetBSD.
-rw-r--r-- | devel/blame/distinfo | 4 | ||||
-rw-r--r-- | devel/blame/patches/patch-configure | 29 | ||||
-rw-r--r-- | devel/blame/patches/patch-lib_mktime_c | 28 |
3 files changed, 60 insertions, 1 deletions
diff --git a/devel/blame/distinfo b/devel/blame/distinfo index e7e60a492bc..1f1e5829754 100644 --- a/devel/blame/distinfo +++ b/devel/blame/distinfo @@ -1,6 +1,8 @@ -$NetBSD: distinfo,v 1.2 2012/07/03 18:11:38 joerg Exp $ +$NetBSD: distinfo,v 1.3 2012/12/17 01:28:29 dholland Exp $ SHA1 (blame-1.3.1.tar.gz) = 9183b9b5f1db0611bda1b724e99957480764bbd7 RMD160 (blame-1.3.1.tar.gz) = fef43320fd6148f4543824642d6b2e86227af245 Size (blame-1.3.1.tar.gz) = 483406 bytes +SHA1 (patch-configure) = dda113d5e55ada8d3464942c01d1a16f3543b92f SHA1 (patch-lib_argp-fmtstream.h) = 9cdd925d9eb80ab69b31e600d7cd01c5e8fe65b2 +SHA1 (patch-lib_mktime_c) = f0fce40e57ec736e60dfff62a0ef5bb973d5a4bd diff --git a/devel/blame/patches/patch-configure b/devel/blame/patches/patch-configure new file mode 100644 index 00000000000..63c39e911e0 --- /dev/null +++ b/devel/blame/patches/patch-configure @@ -0,0 +1,29 @@ +$NetBSD: patch-configure,v 1.1 2012/12/17 01:28:29 dholland Exp $ + +Avoid undefined behavior (causing infinite loop with gcc 4.5) in +mktime configure test. + +--- configure~ 2012-12-17 01:03:14.000000000 +0000 ++++ configure +@@ -9434,7 +9434,8 @@ int + main () + { + time_t t, delta; +- int i, j; ++ int i; ++ unsigned j; + + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that +@@ -9462,9 +9463,9 @@ main () + return 1; + + for (j = 1; 0 < j; j *= 2) +- if (! bigtime_test (j)) ++ if (! bigtime_test ((int)j)) + return 1; +- if (! bigtime_test (j - 1)) ++ if (! bigtime_test ((int)(j - 1))) + return 1; + } + return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); diff --git a/devel/blame/patches/patch-lib_mktime_c b/devel/blame/patches/patch-lib_mktime_c new file mode 100644 index 00000000000..574c557f46a --- /dev/null +++ b/devel/blame/patches/patch-lib_mktime_c @@ -0,0 +1,28 @@ +$NetBSD: patch-lib_mktime_c,v 1.1 2012/12/17 01:28:29 dholland Exp $ + +This code is broken and uncompilable on 32-bit NetBSD. The problem +is the same as reported here: + http://sourceware.org/bugzilla/show_bug.cgi?id=12401 + +The path of least resistance is just to skip the entire file on +NetBSD, as there is a perfectly good mktime() in libc. + +--- lib/mktime.c~ 2006-11-18 10:07:43.000000000 +0000 ++++ lib/mktime.c +@@ -21,6 +21,8 @@ + mktime. */ + /* #define DEBUG 1 */ + ++#ifndef __NetBSD__ ++ + #ifdef HAVE_CONFIG_H + # include <config.h> + #endif +@@ -657,6 +659,7 @@ main (int argc, char **argv) + } + + #endif /* DEBUG */ ++#endif /* __NetBSD__ */ + + /* + Local Variables: |