This commit is contained in:
parent
10808c0ed5
commit
c339ac5fd4
45
zlib-1.2.3-visibility-support.patch
Normal file
45
zlib-1.2.3-visibility-support.patch
Normal file
@ -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
|
@ -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
|
Wed Jan 7 12:34:56 CET 2009 - olh@suse.de
|
||||||
|
|
||||||
|
28
zlib.spec
28
zlib.spec
@ -30,13 +30,14 @@ Obsoletes: zlib-64bit
|
|||||||
%endif
|
%endif
|
||||||
#
|
#
|
||||||
Version: 1.2.3
|
Version: 1.2.3
|
||||||
Release: 133
|
Release: 137
|
||||||
Summary: Data Compression Library
|
Summary: Data Compression Library
|
||||||
Source: zlib-%{version}.tar.bz2
|
Source: zlib-%{version}.tar.bz2
|
||||||
Patch: zlib-1.2.1-make-test.patch
|
Patch: zlib-1.2.1-make-test.patch
|
||||||
Patch1: zlib-1.2.1-vsnprintf.patch
|
Patch1: zlib-1.2.1-vsnprintf.patch
|
||||||
Patch2: zlib-1.2.1-CFLAGS.dif
|
Patch2: zlib-1.2.1-CFLAGS.dif
|
||||||
Patch3: zlib-1.2.2-format.patch
|
Patch3: zlib-1.2.2-format.patch
|
||||||
|
Patch4: zlib-1.2.3-visibility-support.patch
|
||||||
Url: http://www.zlib.net/
|
Url: http://www.zlib.net/
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
|
||||||
@ -79,29 +80,30 @@ libraries.
|
|||||||
%patch1
|
%patch1
|
||||||
%patch2
|
%patch2
|
||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
|
%patch4 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
CFLAGS="$RPM_OPT_FLAGS" ./configure --shared
|
CFLAGS="$RPM_OPT_FLAGS" ./configure --shared
|
||||||
make
|
%{__make} %{?jobs:-j%jobs}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
make test
|
make test
|
||||||
|
|
||||||
%install
|
%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/%{_mandir}/man3
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/include
|
mkdir -p $RPM_BUILD_ROOT%{_includedir}
|
||||||
make install \
|
make install \
|
||||||
prefix=$RPM_BUILD_ROOT/%{_prefix} \
|
prefix=$RPM_BUILD_ROOT/%{_prefix} \
|
||||||
libdir=$RPM_BUILD_ROOT/%{_lib}
|
libdir=$RPM_BUILD_ROOT/%{_lib}
|
||||||
ln -sf ../../%{_lib}/libz.so.1 $RPM_BUILD_ROOT/usr/%{_lib}/libz.so
|
%{__ln_s} -v /%{_lib}/$(readlink %{buildroot}/%{_lib}/libz.so) %{buildroot}%{_libdir}/libz.so
|
||||||
rm $RPM_BUILD_ROOT/%{_lib}/libz.so
|
%{__rm} -v %{buildroot}/%{_lib}/libz.so
|
||||||
# static lib
|
# static lib
|
||||||
make libz.a
|
#make libz.a
|
||||||
install -m 644 libz.a $RPM_BUILD_ROOT/usr/%{_lib}
|
#install -m 644 libz.a $RPM_BUILD_ROOT/usr/%{_lib}
|
||||||
# manpage
|
# manpage
|
||||||
install -m 644 zlib.3 $RPM_BUILD_ROOT/%{_mandir}/man3
|
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
|
%clean
|
||||||
rm -rf %{buildroot}
|
rm -rf %{buildroot}
|
||||||
@ -123,9 +125,15 @@ rm -rf %{buildroot}
|
|||||||
/usr/include/zconf.h
|
/usr/include/zconf.h
|
||||||
/usr/include/zutil.h
|
/usr/include/zutil.h
|
||||||
/usr/%{_lib}/libz.so
|
/usr/%{_lib}/libz.so
|
||||||
/usr/%{_lib}/libz.a
|
#/usr/%{_lib}/libz.a
|
||||||
|
|
||||||
%changelog
|
%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
|
* Wed Jan 07 2009 olh@suse.de
|
||||||
- obsolete old -XXbit packages (bnc#437293)
|
- obsolete old -XXbit packages (bnc#437293)
|
||||||
* Thu Apr 10 2008 ro@suse.de
|
* Thu Apr 10 2008 ro@suse.de
|
||||||
|
Loading…
Reference in New Issue
Block a user