summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-10-07 05:40:48 +0000
committerMike Frysinger <vapier@gentoo.org>2006-10-07 05:40:48 +0000
commitd2f8bf22573d596963fed7c82c0136f0784fc7f4 (patch)
treed7ec4499b8f9bbfddf06fe717661efceaffaf784 /sys-libs/zlib
parentMarked ~hppa. (diff)
downloadgentoo-2-d2f8bf22573d596963fed7c82c0136f0784fc7f4.tar.gz
gentoo-2-d2f8bf22573d596963fed7c82c0136f0784fc7f4.tar.bz2
gentoo-2-d2f8bf22573d596963fed7c82c0136f0784fc7f4.zip
Use gcc visibility to handle exporting of symbols #149929 by galtgendo.
(Portage version: 2.1.2_pre2-r5)
Diffstat (limited to 'sys-libs/zlib')
-rw-r--r--sys-libs/zlib/ChangeLog9
-rw-r--r--sys-libs/zlib/files/digest-zlib-1.2.3-r13
-rw-r--r--sys-libs/zlib/files/zlib-1.2.3-r1-bsd-soname.patch15
-rw-r--r--sys-libs/zlib/files/zlib-1.2.3-visibility-support.patch45
-rw-r--r--sys-libs/zlib/zlib-1.2.3-r1.ebuild67
5 files changed, 138 insertions, 1 deletions
diff --git a/sys-libs/zlib/ChangeLog b/sys-libs/zlib/ChangeLog
index c1750af50ce9..c8414e642b7b 100644
--- a/sys-libs/zlib/ChangeLog
+++ b/sys-libs/zlib/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-libs/zlib
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/zlib/ChangeLog,v 1.59 2006/03/30 14:12:59 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/zlib/ChangeLog,v 1.60 2006/10/07 05:40:48 vapier Exp $
+
+*zlib-1.2.3-r1 (07 Oct 2006)
+
+ 07 Oct 2006; Mike Frysinger <vapier@gentoo.org>
+ +files/zlib-1.2.3-r1-bsd-soname.patch,
+ +files/zlib-1.2.3-visibility-support.patch, +zlib-1.2.3-r1.ebuild:
+ Use gcc visibility to handle exporting of symbols #149929 by galtgendo.
30 Mar 2006; Diego Pettenò <flameeyes@gentoo.org> zlib-1.2.3.ebuild:
Add ~x86-fbsd keyword.
diff --git a/sys-libs/zlib/files/digest-zlib-1.2.3-r1 b/sys-libs/zlib/files/digest-zlib-1.2.3-r1
new file mode 100644
index 000000000000..ebc6c4857eff
--- /dev/null
+++ b/sys-libs/zlib/files/digest-zlib-1.2.3-r1
@@ -0,0 +1,3 @@
+MD5 dee233bf288ee795ac96a98cc2e369b6 zlib-1.2.3.tar.bz2 425209
+RMD160 cfba9984b354dcc38da49331457e6bfc861c6f51 zlib-1.2.3.tar.bz2 425209
+SHA256 e3b9950851a19904d642c4dec518623382cf4d2ac24f70a76510c944330d28ca zlib-1.2.3.tar.bz2 425209
diff --git a/sys-libs/zlib/files/zlib-1.2.3-r1-bsd-soname.patch b/sys-libs/zlib/files/zlib-1.2.3-r1-bsd-soname.patch
new file mode 100644
index 000000000000..872070b03027
--- /dev/null
+++ b/sys-libs/zlib/files/zlib-1.2.3-r1-bsd-soname.patch
@@ -0,0 +1,15 @@
+Generate a DT_SONAME on *BSD machines
+
+http://bugs.gentoo.org/123571
+
+--- configure
++++ configure
+@@ -80,7 +80,7 @@
+ SFLAGS="${CFLAGS-"-O3"} -fPIC"
+ CFLAGS="$cflags"
+ case `(uname -s || echo unknown) 2>/dev/null` in
+- Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};;
++ Linux | linux | GNU | GNU/* | *BSD | DragonFly) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};;
+ CYGWIN* | Cygwin* | cygwin* | OS/2* )
+ EXE='.exe';;
+ QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
diff --git a/sys-libs/zlib/files/zlib-1.2.3-visibility-support.patch b/sys-libs/zlib/files/zlib-1.2.3-visibility-support.patch
new file mode 100644
index 000000000000..ceb065e9c7bb
--- /dev/null
+++ b/sys-libs/zlib/files/zlib-1.2.3-visibility-support.patch
@@ -0,0 +1,45 @@
+Only export symbols that should be exported.
+
+Patch by Mike Frysinger
+
+http://bugs.gentoo.org/32764
+http://bugs.gentoo.org/149929
+
+--- zlib-1.2.3/configure
++++ zlib-1.2.3/configure
+@@ -209,6 +209,20 @@
+ fi
+
+ cat > $test.c <<EOF
++int foo __attribute__ ((visibility ("hidden")));
++int main()
++{
++ return 0;
++}
++EOF
++if ($CC -c -fvisibility=hidden $CFLAGS $test.c) 2>/dev/null; then
++ CFLAGS="$CFLAGS -DHAS_attribute_visibility -fvisibility=hidden"
++ echo "Checking for attribute(visibility) support... Yes."
++else
++ echo "Checking for attribute(visibility) support... No."
++fi
++
++cat > $test.c <<EOF
+ #include <stdio.h>
+ #include <stdarg.h>
+ #include "zconf.h"
+--- zlib-1.2.3/zconf.in.h
++++ zlib-1.2.3/zconf.in.h
+@@ -244,7 +244,11 @@
+ #endif
+
+ #ifndef ZEXTERN
+-# define ZEXTERN extern
++# if defined(ZLIB_INTERNAL) && defined(HAS_attribute_visibility)
++# define ZEXTERN extern __attribute__ ((visibility("default")))
++# else
++# define ZEXTERN extern
++# endif
+ #endif
+ #ifndef ZEXPORT
+ # define ZEXPORT
diff --git a/sys-libs/zlib/zlib-1.2.3-r1.ebuild b/sys-libs/zlib/zlib-1.2.3-r1.ebuild
new file mode 100644
index 000000000000..921319a63676
--- /dev/null
+++ b/sys-libs/zlib/zlib-1.2.3-r1.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/zlib/zlib-1.2.3-r1.ebuild,v 1.1 2006/10/07 05:40:48 vapier Exp $
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Standard (de)compression library"
+HOMEPAGE="http://www.zlib.net/"
+SRC_URI="http://www.gzip.org/zlib/${P}.tar.bz2
+ http://www.zlib.net/${P}.tar.bz2"
+
+LICENSE="ZLIB"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="build"
+
+RDEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-visibility-support.patch #149929
+ # Make sure we link with glibc at all times
+ epatch "${FILESDIR}"/${PN}-1.2.1-glibc.patch
+ # Needed for Alpha and prelink
+ epatch "${FILESDIR}"/${PN}-1.2.1-build-fPIC.patch
+ epatch "${FILESDIR}"/${PN}-1.2.1-configure.patch #55434
+ # fix shared library test on -fPIC dependant archs
+ epatch "${FILESDIR}"/${PN}-1.2.1-fPIC.patch
+ epatch "${FILESDIR}"/${PN}-1.2.3-r1-bsd-soname.patch #123571
+ epatch "${FILESDIR}"/${PN}-1.2.3-LDFLAGS.patch #126718
+ sed -i -e '/ldconfig/d' Makefile.in
+}
+
+src_compile() {
+ tc-export CC RANLIB
+ export AR="$(tc-getAR) rc"
+ ./configure --shared --prefix=/usr --libdir=/$(get_libdir) || die
+ emake || die
+}
+
+src_install() {
+ einstall libdir="${D}"/$(get_libdir) || die
+ rm "${D}"/$(get_libdir)/libz.a
+ insinto /usr/include
+ doins zconf.h zlib.h
+
+ if ! use build ; then
+ doman zlib.3
+ dodoc FAQ README ChangeLog
+ docinto txt
+ dodoc algorithm.txt
+ fi
+
+ # we don't need the static lib in /lib
+ # as it's only for compiling against
+ dolib libz.a
+
+ # all the shared libs go into /lib
+ # for NFS based /usr
+ into /
+ dolib libz.so.${PV}
+ ( cd "${D}"/$(get_libdir) ; chmod 755 libz.so.* )
+ dosym libz.so.${PV} /$(get_libdir)/libz.so
+ dosym libz.so.${PV} /$(get_libdir)/libz.so.1
+ gen_usr_ldscript libz.so
+}