NetBSD Problem Report #49077

From www@NetBSD.org  Wed Aug  6 00:07:36 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id E952AA9647
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  6 Aug 2014 00:07:35 +0000 (UTC)
Message-Id: <20140806000734.3883BA9648@mollari.NetBSD.org>
Date: Wed,  6 Aug 2014 00:07:34 +0000 (UTC)
From: venture37@geeklan.co.uk
Reply-To: venture37@geeklan.co.uk
To: gnats-bugs@NetBSD.org
Subject: Unbreak textproc/icu on OS X TIger
X-Send-Pr-Version: www-1.0

>Number:         49077
>Category:       pkg
>Synopsis:       Unbreak textproc/icu on OS X TIger
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bsiegert
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 06 00:10:00 +0000 2014
>Closed-Date:    Sun Oct 26 19:49:25 +0000 2014
>Last-Modified:  Sun Oct 26 19:50:00 +0000 2014
>Originator:     Sevan Janiyan
>Release:        -current
>Organization:
>Environment:
Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh powerpc
>Description:
ICU fails to build on Tiger with the error
putil.cpp: In function ‘const char* uprv_tzname_49(int)’:
putil.cpp:1114: error: ‘localtime_r’ was not declared in this scope

followed by assembler errors as the version shipped with Xcode 2.5 & prior do not understand .balign

Patches lifted from the ICU trac via Tiger Brew 
http://bugs.icu-project.org/trac/ticket/9367

Modified the patch to putil.cpp so that it is specifically applies to Tiger on, in MacPorts this patch was handled by the port infrastructure rather than let cpp work it out.
>How-To-Repeat:

>Fix:
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/textproc/icu/distinfo,v
retrieving revision 1.49
diff -u -r1.49 distinfo
--- distinfo	18 Jul 2014 10:28:11 -0000	1.49
+++ distinfo	5 Aug 2014 23:57:13 -0000
@@ -9,6 +9,7 @@
 SHA1 (patch-acinclude.m4) = a6993fefca751d7e63e60130cdcd69f3adbc0589
 SHA1 (patch-ad) = c2a9469bf896b5f0702d5795c3b1c2b394893663
 SHA1 (patch-af) = dcfbaf16844292a9ae57536ae2fb62fd1659d067
+SHA1 (patch-common_putil.cpp) = 20e6b239179a529217c2d8e700eb87ebe1a8791c
 SHA1 (patch-common_putilimp.h) = a68faa97c2bffeecaca1586e26f5bbe48e71b262
 SHA1 (patch-common_umutex.h) = 096d3e15ef7b84533456af4570ed70747a4ef70c
 SHA1 (patch-common_unicode_platform.h) = 82786dff790782eb07cdc527061de33e771ec63c
@@ -18,3 +19,4 @@
 SHA1 (patch-config_mh-solaris-gcc) = f81fec8f0d232b9125c7ea7ec334b78872aa2025
 SHA1 (patch-configure) = aae0978c1eb1b2bafa229ba0f2e9d581554f80b2
 SHA1 (patch-configure.ac) = ea7586eb8131ff53a483b5bd7ca162886e9045f1
+SHA1 (patch-tools-toolutil-pkg_genc.c) = 028e6318f4cc025cab9b118f66be10514ae10b35
Index: patches/patch-common_putil.cpp
===================================================================
RCS file: patches/patch-common_putil.cpp
diff -N patches/patch-common_putil.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-common_putil.cpp	5 Aug 2014 23:57:13 -0000
@@ -0,0 +1,20 @@
+$NetBSD$
+
+Index: common/putil.cpp
+===================================================================
+--- common/putil.cpp.orig 2012-06-01 10:52:46.000000000 -0400
++++ common/putil.cpp 2012-10-05 19:53:14.000000000 -0400
+@@ -123,6 +123,13 @@
+ #endif
+ 
+ /*
++ * Mac OS X 10.4 doesn't use its localtime_r() declaration in <time.h> if either _ANSI_SOURCE or _POSIX_C_SOURCE is #defined.
++ */
++#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ == 1040
++U_CFUNC struct tm *localtime_r(const time_t *, struct tm *);
++#endif
++
++/*
+  * Only include langinfo.h if we have a way to get the codeset. If we later
+  * depend on more feature, we can test on U_HAVE_NL_LANGINFO.
+  *
Index: patches/patch-tools-toolutil-pkg_genc.c
===================================================================
RCS file: patches/patch-tools-toolutil-pkg_genc.c
diff -N patches/patch-tools-toolutil-pkg_genc.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-tools-toolutil-pkg_genc.c	5 Aug 2014 23:57:13 -0000
@@ -0,0 +1,23 @@
+$NetBSD$
+
+Index: tools/toolutil/pkg_genc.c
+===================================================================
+--- tools/toolutil/pkg_genc.c.orig 2013-12-12 03:14:23.000000000 +0000
++++ tools/toolutil/pkg_genc.c
+@@ -125,13 +125,15 @@ static const struct AssemblyType {
+ 
+         ".long ","",HEX_0X
+     },
++    // Older assemblers for Darwin (like the one from Xcode 2.5) do not
++    // have .balign, but they take .align 4 to mean 2^4 = 16 bytes.
+     {"gcc-darwin",
+         /*"\t.section __TEXT,__text,regular,pure_instructions\n"
+         "\t.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32\n"*/
+         ".globl _%s\n"
+         "\t.data\n"
+         "\t.const\n"
+-        "\t.balign 16\n"
++        "\t.align 4\n"
+         "_%s:\n\n",
+ 
+         ".long ","",HEX_0X

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->macos-pkg-people
Responsible-Changed-By: obache@NetBSD.org
Responsible-Changed-When: Wed, 20 Aug 2014 09:54:41 +0000
Responsible-Changed-Why:
Problem on OS X Tiger.


From: venture37 <venture37@geeklan.co.uk>
To: gnats-bugs@NetBSD.org, macos-pkg-people@netbsd.org, 
 pkg-manager@netbsd.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org, 
 obache@NetBSD.org
Cc: 
Subject: Re: pkg/49077 (Unbreak textproc/icu on OS X TIger)
Date: Sat, 25 Oct 2014 20:02:59 +0100

 Updated version of diff which applies cleanly to icu-54.1
 Updated ifdef to be more specific whilst only applying to OS X Tiger
 (the original definition in the patch upstream +
 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)

 Index: distinfo
 ===================================================================
 RCS file: /cvsroot/pkgsrc/textproc/icu/distinfo,v
 retrieving revision 1.50
 diff -u -r1.50 distinfo
 --- distinfo	7 Oct 2014 16:09:53 -0000	1.50
 +++ distinfo	25 Oct 2014 18:56:25 -0000
 @@ -9,6 +9,7 @@
  SHA1 (patch-acinclude.m4) = ab757e9bf7351e44edd92b96edbffc40acb44dae
  SHA1 (patch-ad) = c2a9469bf896b5f0702d5795c3b1c2b394893663
  SHA1 (patch-af) = 6f41d58f258361e28ce3283e1b46f8a762b7c5dd
 +SHA1 (patch-common_putil.cpp) = d2e2e7f4ca73bbd04eb8eba8ee3eafe2134ea922
  SHA1 (patch-common_putilimp.h) = a68faa97c2bffeecaca1586e26f5bbe48e71b262
  SHA1 (patch-common_umutex.h) = 096d3e15ef7b84533456af4570ed70747a4ef70c
  SHA1 (patch-common_unicode_platform.h) =
 82786dff790782eb07cdc527061de33e771ec63c
 @@ -17,3 +18,4 @@
  SHA1 (patch-config_mh-scoosr5) = 47703dcc184f58c0382da3225f849424ab74d472
  SHA1 (patch-configure) = 2d17823ee06693ce382745ce345eca37001a0a7c
  SHA1 (patch-configure.ac) = ea7586eb8131ff53a483b5bd7ca162886e9045f1
 +SHA1 (patch-tools-toolutil-pkg_genc.c) =
 a14451d912c9ea4bdba85ef5a920d3c7c1257d6e
 Index: patches/patch-common_putil.cpp
 ===================================================================
 RCS file: patches/patch-common_putil.cpp
 diff -N patches/patch-common_putil.cpp
 --- /dev/null	1 Jan 1970 00:00:00 -0000
 +++ patches/patch-common_putil.cpp	25 Oct 2014 18:56:25 -0000
 @@ -0,0 +1,19 @@
 +$NetBSD$
 +
 +--- common/putil.cpp.orig	2014-10-25 17:54:47.000000000 +0000
 ++++ common/putil.cpp
 +@@ -117,6 +117,14 @@
 + #endif
 +
 + /*
 ++ * Mac OS X 10.4 doesn't use its localtime_r() declaration in <time.h>
 if either _ANSI_SOURCE or _POSIX_C_SOURCE is #defined.
 ++ */
 ++#if defined(U_TZNAME) && U_PLATFORM_IS_DARWIN_BASED &&
 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ == 1040 \
 ++	&& (defined(_ANSI_SOURCE) || defined(_POSIX_C_SOURCE))
 ++U_CFUNC struct tm *localtime_r(const time_t *, struct tm *);
 ++#endif
 ++
 ++/*
 +  * Only include langinfo.h if we have a way to get the codeset. If we
 later
 +  * depend on more feature, we can test on U_HAVE_NL_LANGINFO.
 +  *
 Index: patches/patch-tools-toolutil-pkg_genc.c
 ===================================================================
 RCS file: patches/patch-tools-toolutil-pkg_genc.c
 diff -N patches/patch-tools-toolutil-pkg_genc.c
 --- /dev/null	1 Jan 1970 00:00:00 -0000
 +++ patches/patch-tools-toolutil-pkg_genc.c	25 Oct 2014 18:56:25 -0000
 @@ -0,0 +1,21 @@
 +$NetBSD$
 +
 +--- tools/toolutil/pkg_genc.c.orig	2014-10-25 17:58:50.000000000 +0000
 ++++ tools/toolutil/pkg_genc.c
 +@@ -125,13 +125,15 @@ static const struct AssemblyType {
 +
 +         ".long ","",HEX_0X
 +     },
 ++    // Older assemblers for Darwin (like the one from Xcode 2.5) do not
 ++    // have .balign, but they take .align 4 to mean 2^4 = 16 bytes.
 +     {"gcc-darwin",
 +         /*"\t.section __TEXT,__text,regular,pure_instructions\n"
 +         "\t.section
 __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32\n"*/
 +         ".globl _%s\n"
 +         "\t.data\n"
 +         "\t.const\n"
 +-        "\t.balign 16\n"
 ++        "\t.align 4\n"
 +         "_%s:\n\n",
 +
 +         ".long ","",HEX_0X

Responsible-Changed-From-To: macos-pkg-people->bsiegert
Responsible-Changed-By: bsiegert@NetBSD.org
Responsible-Changed-When: Sun, 26 Oct 2014 19:47:00 +0000
Responsible-Changed-Why:
taking this.



State-Changed-From-To: open->closed
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Sun, 26 Oct 2014 19:49:25 +0000
State-Changed-Why:
Patch applied, thanks!


From: "Benny Siegert" <bsiegert@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49077 CVS commit: pkgsrc/textproc/icu
Date: Sun, 26 Oct 2014 19:46:48 +0000

 Module Name:	pkgsrc
 Committed By:	bsiegert
 Date:		Sun Oct 26 19:46:48 UTC 2014

 Modified Files:
 	pkgsrc/textproc/icu: distinfo
 Added Files:
 	pkgsrc/textproc/icu/patches: patch-common_putil.cpp
 	    patch-tools-toolutil-pkg_genc.c

 Log Message:
 Fix compilation on Mac OS 10.4. From Sevan Janiyan in PR pkg/49077.


 To generate a diff of this commit:
 cvs rdiff -u -r1.50 -r1.51 pkgsrc/textproc/icu/distinfo
 cvs rdiff -u -r0 -r1.1 pkgsrc/textproc/icu/patches/patch-common_putil.cpp \
     pkgsrc/textproc/icu/patches/patch-tools-toolutil-pkg_genc.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.