From c207514c59864a91641c5258d91e1de5731b52d5 Mon Sep 17 00:00:00 2001 From: Peter Volkov Date: Sun, 28 Dec 2008 18:20:32 +0000 Subject: Finally fixed test failure on ppc64 and marking it stable, bug #244256. Thank Brent Baude for hardware access. (Portage version: 2.2_rc17/cvs/Linux 2.6.26-openvz.git-89451f9 i686) --- dev-libs/geoip/ChangeLog | 7 +++++- dev-libs/geoip/files/geoip-1.4.5-ppc-fix.patch | 35 ++++++++++++++++++++++++++ dev-libs/geoip/geoip-1.4.5.ebuild | 5 ++-- 3 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 dev-libs/geoip/files/geoip-1.4.5-ppc-fix.patch diff --git a/dev-libs/geoip/ChangeLog b/dev-libs/geoip/ChangeLog index 1236763000a8..82dd90b73600 100644 --- a/dev-libs/geoip/ChangeLog +++ b/dev-libs/geoip/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for dev-libs/geoip # Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/geoip/ChangeLog,v 1.95 2008/10/26 12:24:38 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/geoip/ChangeLog,v 1.96 2008/12/28 18:20:32 pva Exp $ + + 28 Dec 2008; Peter Volkov + +files/geoip-1.4.5-ppc-fix.patch, geoip-1.4.5.ebuild: + Finally fixed test failure on ppc64 and marking it stable, bug #244256. + Thank Brent Baude for hardware access. 26 Oct 2008; Raúl Porcel geoip-1.4.5.ebuild: alpha/ia64/sparc/x86 stable wrt #244256 diff --git a/dev-libs/geoip/files/geoip-1.4.5-ppc-fix.patch b/dev-libs/geoip/files/geoip-1.4.5-ppc-fix.patch new file mode 100644 index 000000000000..423c0712f797 --- /dev/null +++ b/dev-libs/geoip/files/geoip-1.4.5-ppc-fix.patch @@ -0,0 +1,35 @@ +Status of this patch: Reported upstream. + +The following assignment in libGeoIP/GeoIP.c is broken on ppc64: + addr = *((unsigned long *) phe->h_addr_list[0]); + +phe->h_addr_list[0] on linux has type in_addr_t which is defined as: + typedef uint32_t in_addr_t; + +On ppc64 sizeof(unsigned long) is 8 (!= 4, sizeof(uint32_t)). This code works +on amd64 as it's little endian, while it became broken on big endian ppc64 +systems. + + +--- libGeoIP/GeoIP.c 2008-12-28 17:36:55 +0000 ++++ libGeoIP/GeoIP.c 2008-12-28 17:37:41 +0000 +@@ -811,8 +811,7 @@ + buflength = buflength * 2; + buf = realloc(buf,buflength); + } +-#endif +-#ifndef HAVE_GETHOSTBYNAME_R ++#else + /* Some systems do not support gethostbyname_r, such as Mac OS X */ + phe = gethostbyname(host); + #endif +@@ -820,7 +819,7 @@ + free(buf); + return 0; + } +- addr = *((unsigned long *) phe->h_addr_list[0]); ++ addr = *((in_addr_t *) phe->h_addr_list[0]); + } + #ifdef HAVE_GETHOSTBYNAME_R + free(buf); + diff --git a/dev-libs/geoip/geoip-1.4.5.ebuild b/dev-libs/geoip/geoip-1.4.5.ebuild index de77b0e7d7ff..eed7385c15d1 100644 --- a/dev-libs/geoip/geoip-1.4.5.ebuild +++ b/dev-libs/geoip/geoip-1.4.5.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/geoip/geoip-1.4.5.ebuild,v 1.5 2008/10/26 12:24:38 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/geoip/geoip-1.4.5.ebuild,v 1.6 2008/12/28 18:20:32 pva Exp $ inherit autotools eutils libtool @@ -12,7 +12,7 @@ SRC_URI="http://www.maxmind.com/download/geoip/api/c/${MY_P}.tar.gz" # GPL-2 for md5.c - part of libGeoIPUpdate, MaxMind for GeoLite Country db LICENSE="LGPL-2.1 GPL-2 MaxMind" SLOT="0" -KEYWORDS="alpha amd64 hppa ia64 ppc ~ppc64 sparc x86 ~x86-fbsd" +KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd" IUSE="" S=${WORKDIR}/${MY_P} @@ -23,6 +23,7 @@ src_unpack() { epatch "${FILESDIR}"/${PN}-1.4.4-parallel-build.patch epatch "${FILESDIR}"/${PN}-1.4.4-no-noinst_PROGRAMS.patch + epatch "${FILESDIR}"/${P}-ppc-fix.patch eautoreconf # FreeBSD requires this #elibtoolize -- cgit v1.2.3-65-gdbad