tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[PATCH] make devel/zlib compatible with Linux distro builds by including versioned symbols



Hi,

I had trouble with pkgsrc needing to update to a fresher zlib that what
is in the base Linux distro. The special build of devel/zlib, which
does forgo the normal configure script, fails to include the zlib.map
that provides the versioned symbols Linux binaries expect.

It's still not clean mixing the same lib possibly from pkgsrc prefix
and system, but with this change, I don't get complaints from the
linker anymore about something from /usr/lib missing the versioned
libz.so.1 symbols when a pkgsrc package pulls in zlib and a system
library.

So, I humbly ask if it is OK for me to commit the attached patch to
bring pkgsrc's zlib more in line with what is expected on Linux systems
(or any system that uses the upstream build scripts).

You might want to consider -DHAVE_HIDDEN, too (with the configure
check).


Alrighty then,

Thomas

-- 
Dr. Thomas Orgis
HPC @ Universität Hamburg
diff -ruN pkgsrc-2023Q4/devel/zlib/files/zlib.map pkgsrc/devel/zlib/files/zlib.map
--- pkgsrc-2023Q4/devel/zlib/files/zlib.map	1970-01-01 01:00:00.000000000 +0100
+++ pkgsrc/devel/zlib/files/zlib.map	2024-01-23 10:43:37.968955908 +0100
@@ -0,0 +1,100 @@
+ZLIB_1.2.0 {
+  global:
+    compressBound;
+    deflateBound;
+    inflateBack;
+    inflateBackEnd;
+    inflateBackInit_;
+    inflateCopy;
+  local:
+    deflate_copyright;
+    inflate_copyright;
+    inflate_fast;
+    inflate_table;
+    zcalloc;
+    zcfree;
+    z_errmsg;
+    gz_error;
+    gz_intmax;
+    _*;
+};
+
+ZLIB_1.2.0.2 {
+    gzclearerr;
+    gzungetc;
+    zlibCompileFlags;
+} ZLIB_1.2.0;
+
+ZLIB_1.2.0.8 {
+    deflatePrime;
+} ZLIB_1.2.0.2;
+
+ZLIB_1.2.2 {
+    adler32_combine;
+    crc32_combine;
+    deflateSetHeader;
+    inflateGetHeader;
+} ZLIB_1.2.0.8;
+
+ZLIB_1.2.2.3 {
+    deflateTune;
+    gzdirect;
+} ZLIB_1.2.2;
+
+ZLIB_1.2.2.4 {
+    inflatePrime;
+} ZLIB_1.2.2.3;
+
+ZLIB_1.2.3.3 {
+    adler32_combine64;
+    crc32_combine64;
+    gzopen64;
+    gzseek64;
+    gztell64;
+    inflateUndermine;
+} ZLIB_1.2.2.4;
+
+ZLIB_1.2.3.4 {
+    inflateReset2;
+    inflateMark;
+} ZLIB_1.2.3.3;
+
+ZLIB_1.2.3.5 {
+    gzbuffer;
+    gzoffset;
+    gzoffset64;
+    gzclose_r;
+    gzclose_w;
+} ZLIB_1.2.3.4;
+
+ZLIB_1.2.5.1 {
+    deflatePending;
+} ZLIB_1.2.3.5;
+
+ZLIB_1.2.5.2 {
+    deflateResetKeep;
+    gzgetc_;
+    inflateResetKeep;
+} ZLIB_1.2.5.1;
+
+ZLIB_1.2.7.1 {
+    inflateGetDictionary;
+    gzvprintf;
+} ZLIB_1.2.5.2;
+
+ZLIB_1.2.9 {
+    inflateCodesUsed;
+    inflateValidate;
+    uncompress2;
+    gzfread;
+    gzfwrite;
+    deflateGetDictionary;
+    adler32_z;
+    crc32_z;
+} ZLIB_1.2.7.1;
+
+ZLIB_1.2.12 {
+	crc32_combine_gen;
+	crc32_combine_gen64;
+	crc32_combine_op;
+} ZLIB_1.2.9;
diff -ruN pkgsrc-2023Q4/devel/zlib/Makefile pkgsrc/devel/zlib/Makefile
--- pkgsrc-2023Q4/devel/zlib/Makefile	2024-01-13 13:50:39.000000000 +0100
+++ pkgsrc/devel/zlib/Makefile	2024-01-23 10:44:23.959088428 +0100
@@ -2,6 +2,7 @@
 
 DISTNAME=	zlib-1.2.13
 CATEGORIES=	devel
+PKGREVISION=	1
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=libpng/}
 MASTER_SITES+=	http://zlib.net/
 DISTFILES=	# empty
@@ -26,6 +27,8 @@
 .endif
 LDFLAGS.SunOS+=	-Wl,-zignore	# avoid unused reference to libgcc_s.so
 
+LDFLAGS.Linux+=	-Wl,--version-script,zlib.map
+
 SUBST_CLASSES+=		pc
 SUBST_MESSAGE.pc=	pkg-config file substitutions
 SUBST_STAGE.pc=		pre-configure


Home | Main Index | Thread Index | Old Index