diff --git a/zlib-1.2.3-visibility-support.patch b/zlib-1.2.3-visibility-support.patch new file mode 100644 index 0000000..7a98288 --- /dev/null +++ b/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 </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 < + #include + #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/zlib.changes b/zlib.changes index 69cc631..1b69331 100644 --- a/zlib.changes +++ b/zlib.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Feb 27 19:58:04 CET 2009 - crrodriguez@suse.de + +- add patch from gentoo that makes zlib to only export + its public API using GCC visibility features, this will + of course break wrong code that uses private symbols +- exclude static zlib, at least temporarily, in order to clearly know + what is using it. + ------------------------------------------------------------------- Wed Jan 7 12:34:56 CET 2009 - olh@suse.de diff --git a/zlib.spec b/zlib.spec index 241af0f..d0f631d 100644 --- a/zlib.spec +++ b/zlib.spec @@ -30,13 +30,14 @@ Obsoletes: zlib-64bit %endif # Version: 1.2.3 -Release: 133 +Release: 137 Summary: Data Compression Library Source: zlib-%{version}.tar.bz2 Patch: zlib-1.2.1-make-test.patch Patch1: zlib-1.2.1-vsnprintf.patch Patch2: zlib-1.2.1-CFLAGS.dif Patch3: zlib-1.2.2-format.patch +Patch4: zlib-1.2.3-visibility-support.patch Url: http://www.zlib.net/ BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -79,29 +80,30 @@ libraries. %patch1 %patch2 %patch3 -p1 +%patch4 -p1 %build CFLAGS="$RPM_OPT_FLAGS" ./configure --shared -make +%{__make} %{?jobs:-j%jobs} %check make test %install -mkdir -p $RPM_BUILD_ROOT/{%_lib,/usr/%_lib} +mkdir -p $RPM_BUILD_ROOT/{%_lib,%_libdir} mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man3 -mkdir -p $RPM_BUILD_ROOT/usr/include +mkdir -p $RPM_BUILD_ROOT%{_includedir} make install \ prefix=$RPM_BUILD_ROOT/%{_prefix} \ libdir=$RPM_BUILD_ROOT/%{_lib} -ln -sf ../../%{_lib}/libz.so.1 $RPM_BUILD_ROOT/usr/%{_lib}/libz.so -rm $RPM_BUILD_ROOT/%{_lib}/libz.so +%{__ln_s} -v /%{_lib}/$(readlink %{buildroot}/%{_lib}/libz.so) %{buildroot}%{_libdir}/libz.so +%{__rm} -v %{buildroot}/%{_lib}/libz.so # static lib -make libz.a -install -m 644 libz.a $RPM_BUILD_ROOT/usr/%{_lib} +#make libz.a +#install -m 644 libz.a $RPM_BUILD_ROOT/usr/%{_lib} # manpage install -m 644 zlib.3 $RPM_BUILD_ROOT/%{_mandir}/man3 -install -m 644 zutil.h $RPM_BUILD_ROOT/usr/include +install -m 644 zutil.h $RPM_BUILD_ROOT%{_includedir} %clean rm -rf %{buildroot} @@ -123,9 +125,15 @@ rm -rf %{buildroot} /usr/include/zconf.h /usr/include/zutil.h /usr/%{_lib}/libz.so -/usr/%{_lib}/libz.a +#/usr/%{_lib}/libz.a %changelog +* Fri Feb 27 2009 crrodriguez@suse.de +- add patch from gentoo that makes zlib to only export + its public API using GCC visibility features, this will + of course break wrong code that uses private symbols +- exclude static zlib, at least temporarily, in order to clearly know + what is using it. * Wed Jan 07 2009 olh@suse.de - obsolete old -XXbit packages (bnc#437293) * Thu Apr 10 2008 ro@suse.de