From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mediacenter.hi.pengutronix.de ([2001:6f8:1178:2::65]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1SewOR-0005Cj-9d for ptxdist@pengutronix.de; Thu, 14 Jun 2012 00:50:27 +0200 Received: from mol by mediacenter.hi.pengutronix.de with local (Exim 4.72) (envelope-from ) id 1SewOR-0006gC-8f for ptxdist@pengutronix.de; Thu, 14 Jun 2012 00:50:27 +0200 Date: Thu, 14 Jun 2012 00:50:27 +0200 From: Michael Olbrich Message-ID: <20120613225027.GB14446@pengutronix.de> References: <20120530071904.GH19394@pengutronix.de> <1339320638-1534-1-git-send-email-bernhard@bwalle.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1339320638-1534-1-git-send-email-bernhard@bwalle.de> Subject: Re: [ptxdist] [PATCH 1/3] host-gettext: Fix build on Darwin Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Sun, Jun 10, 2012 at 11:30:36AM +0200, Bernhard Walle wrote: > See the comments of the patches for a description. > = > Signed-off-by: Bernhard Walle > --- > ...-Fix-build-if-stpncpy-is-defined-as-macro.patch | 44 ++++++++++++++= ++++++ > ...02-Fix-relocatable-installation-on-Darwin.patch | 44 ++++++++++++++= ++++++ > patches/gettext-0.18.1/series | 5 +++ > 3 Dateien ge=E4ndert, 93 Zeilen hinzugef=FCgt(+) > create mode 100644 patches/gettext-0.18.1/0001-Fix-build-if-stpncpy-is-d= efined-as-macro.patch > create mode 100644 patches/gettext-0.18.1/0002-Fix-relocatable-installat= ion-on-Darwin.patch > create mode 100644 patches/gettext-0.18.1/series > = > diff --git a/patches/gettext-0.18.1/0001-Fix-build-if-stpncpy-is-defined-= as-macro.patch b/patches/gettext-0.18.1/0001-Fix-build-if-stpncpy-is-define= d-as-macro.patch > new file mode 100644 > index 0000000..e5c45a9 > --- /dev/null > +++ b/patches/gettext-0.18.1/0001-Fix-build-if-stpncpy-is-defined-as-macr= o.patch > @@ -0,0 +1,44 @@ > +From 1e2d81ef811df58db004191d21b2d5e15ef4cf0d Mon Sep 17 00:00:00 2001 > +From: Bernhard Walle > +Date: Sat, 5 May 2012 10:16:16 +0200 > +Subject: [PATCH] Fix build if stpncpy is defined as macro > + > +One such operating system where stpncpy is defined as macro is Mac OS X > +(Darwin). > + > +The problem is already fixed with following commit in gnulib: > + > + commit c5728261c324a75f8d23dd7d10cb42dde9420227 > + Author: Bruno Haible > + Date: Mon Aug 16 02:09:11 2010 +0200 > + > + stpncpy: Allow stpncpy to be defined as a macro. > + > +However, applying that patch involves re-running autotools. As they rely > +on specific versions, this is a mess. This change is not nice but it > +avoids that problems. And from the bug tracker: "there will be a new minor gettext release soon". That was almost a year ago :-( > + > +Signed-off-by: Bernhard Walle > +--- > + gettext-tools/gnulib-lib/stpncpy.c | 4 ++++ > + 1 Datei ge=E4ndert, 4 Zeilen hinzugef=FCgt(+) > + > +diff --git a/gettext-tools/gnulib-lib/stpncpy.c b/gettext-tools/gnulib-l= ib/stpncpy.c > +index ca53ebb..4ad6db5 100644 > +--- a/gettext-tools/gnulib-lib/stpncpy.c > ++++ b/gettext-tools/gnulib-lib/stpncpy.c > +@@ -24,6 +24,8 @@ > + /* Specification. */ > + #include > + = > ++#ifndef stpncpy > ++ > + #ifndef weak_alias > + # define __stpncpy stpncpy > + #endif > +@@ -90,3 +92,5 @@ __stpncpy (char *dest, const char *src, size_t n) > + #ifdef weak_alias > + weak_alias (__stpncpy, stpncpy) > + #endif > ++ > ++#endif /* stpncpy */ > diff --git a/patches/gettext-0.18.1/0002-Fix-relocatable-installation-on-= Darwin.patch b/patches/gettext-0.18.1/0002-Fix-relocatable-installation-on-= Darwin.patch > new file mode 100644 > index 0000000..289d030 > --- /dev/null > +++ b/patches/gettext-0.18.1/0002-Fix-relocatable-installation-on-Darwin.= patch > @@ -0,0 +1,44 @@ > +From 5b6020579a18b0c81ad6a20ae87f9681e856151b Mon Sep 17 00:00:00 2001 > +From: Bernhard Walle > +Date: Sun, 6 May 2012 20:32:56 +0200 > +Subject: [PATCH] Fix relocatable installation on Darwin > + > +Without the patch, I get following error when installing host-gettext: > + > +----------------------------- 8< ------------------------------------ > +.../platform-versatilepb/sysroot-host/include -g -O2 > + -L..../platform-versatilepb/sysroot-host/lib > + -Wl,-rpath -Wl,..../platform-versatilepb/sysroot-host/lib > + -Wl,-rpath -Wl,/this/is/a/long/path/to/make/host/tools/relocatea= ble/with/chrpath/when/using/dev/packages > + -I../gnulib-lib -I../gnulib-lib -I.. -DHAVE_CONFIG_H -DIN_RELOCW= RAPPER -DNO_XMALLOC -DINSTALLPREFIX=3D"" > + -DINSTALLDIR=3D"/bin" -DLIBPATHVAR=3D"DYLD_LIBRARY_PATH" -DLIBDI= RS=3D"/lib", -DEXEEXT=3D"" ../gnulib-lib/relocwrapper.c > + ../gnulib-lib/progname.c ../gnulib-lib/progreloc.c ../gnulib-lib= /areadlink.c ../gnulib-lib/readlink.c > + ../gnulib-lib/canonicalize-lgpl.c ../gnulib-lib/malloca.c ../gnu= lib-lib/relocatable.c > + ../gnulib-lib/setenv.c ../gnulib-lib/strerror.c ../gnulib-lib/c-= ctype.c > + -o ..../packages/host-gettext-0.18.1/bin/gettext.wrapper > +Undefined symbols for architecture x86_64: > + "_rpl_stat", referenced from: > + _rpl_readlink in ccx1kquY.o > + "_rpl_lstat", referenced from: > + _rpl_realpath in ccDavvkQ.o > +ld: symbol(s) not found for architecture x86_64 > +----------------------------- >8 ------------------------------------ > + > +Signed-off-by: Bernhard Walle > +--- > + build-aux/install-reloc | 2 ++ > + 1 Datei ge=E4ndert, 2 Zeilen hinzugef=FCgt(+) > + > +diff --git a/build-aux/install-reloc b/build-aux/install-reloc > +index b5223a9..dd6fc51 100755 > +--- a/build-aux/install-reloc > ++++ b/build-aux/install-reloc > +@@ -157,6 +157,8 @@ func_verbose $compile_command \ > + "$srcdir"/progreloc.c \ > + "$srcdir"/areadlink.c \ > + "$srcdir"/readlink.c \ > ++ "$srcdir"/stat.c \ > ++ "$srcdir"/lstat.c \ Hmmm, I don't really like this. 'install-reloc' is a generated file. It seems this works here because these functions are only used for some workaround. Have you tried building gettext outside ptxdist? I've not seen any other bug reports this. Maybe we confuse the build system somewhere. Michael > + "$srcdir"/canonicalize-lgpl.c \ > + "$srcdir"/malloca.c \ > + "$srcdir"/relocatable.c \ > diff --git a/patches/gettext-0.18.1/series b/patches/gettext-0.18.1/series > new file mode 100644 > index 0000000..206380e > --- /dev/null > +++ b/patches/gettext-0.18.1/series > @@ -0,0 +1,5 @@ > +# generated by git-ptx-patches > +#tag:base --start-number 1 > +0001-Fix-build-if-stpncpy-is-defined-as-macro.patch > +0002-Fix-relocatable-installation-on-Darwin.patch > +# 0dc9ec23506a7d86f04d8566cdf8d62c - git-ptx-patches magic > -- = > 1.7.10.4 > = > = > -- = > ptxdist mailing list > ptxdist@pengutronix.de -- = Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- = ptxdist mailing list ptxdist@pengutronix.de