gnutls-devel
[Top][All Lists]
Advanced

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

Re: [gnutls-dev] Re: gnutls 1.0.22


From: Joe Orton
Subject: Re: [gnutls-dev] Re: gnutls 1.0.22
Date: Thu, 28 Oct 2004 19:21:46 +0100
User-agent: Mutt/1.4.1i

On Thu, Oct 28, 2004 at 03:11:22PM +0200, Simon Josefsson wrote:
> Joe Orton <address@hidden> writes:
> 
> > On Thu, Oct 28, 2004 at 12:49:42PM +0200, Simon Josefsson wrote:
> >> Hello.  Similar bug fixes as in 1.1.21.
> >
> > Thanks for the releases Simon!
> >
> > I noticed that GNU TLS is using hand-crafted symbol version scripts for
> > GNU ld -- did you know that using libtool's -export-symbols{,-regex}
> > flags can be used to the same in a portable fashion?  It's rather neat.
> 
> I am not that familiar with these features, I thought they all were
> inherently unportable.  Not that it means they shouldn't be used, of
> course, since they are useful for GNU systems.

It's supported on at least Solaris and AIX as well as with GNU ld; and
libtool just ignores it on platforms where it's not supported, so it's
OK.

> Further thoughts on this?  Or preferably, specific patches...

Patch below.  Attached list of symbols which get hidden in libgnutls.so
with this applied vs not using it at all, for verification: some of
these should probably get namespace-protected for systems on which
-export-symbols* isn't implemented: memmem, firstElement, bit_mask for
instance.

Index: configure.in
===================================================================
RCS file: /cvs/gnutls/gnutls/configure.in,v
retrieving revision 2.329
diff -u -r2.329 configure.in
--- configure.in        27 Oct 2004 21:29:32 -0000      2.329
+++ configure.in        28 Oct 2004 18:12:44 -0000
@@ -474,26 +474,6 @@
 ])
 AM_PROG_LIBTOOL
 
-dnl This is after AM_PROG_LIBTOOL so that the LD variable
-dnl has been set.
-
-AC_MSG_CHECKING([whether we have GNU ld or compatible])
-
-GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
-if test "$GLD"; then
-have_ld_version_script=yes
-  AC_MSG_RESULT(yes)
-else
-have_ld_version_script=no
-  AC_MSG_RESULT(no)
-AC_MSG_WARN(***
-*** You may want to rerun configure using --with-gnu-ld to enable versioned 
symbols.
-)
-fi
-
-AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
-
-
 LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBTASN1_LIBS $LIBGCRYPT_LIBS $LIBS"
 LIBGNUTLS_CFLAGS="$LIBGCRYPT_CFLAGS $LIBTASN1_CFLAGS -I${includedir}"
 
Index: lib/Makefile.am
===================================================================
RCS file: /cvs/gnutls/gnutls/lib/Makefile.am,v
retrieving revision 2.148
diff -u -r2.148 Makefile.am
--- lib/Makefile.am     24 Oct 2004 14:12:08 -0000      2.148
+++ lib/Makefile.am     28 Oct 2004 18:12:44 -0000
@@ -9,11 +9,7 @@
 pkgconfig_DATA = gnutls.pc
 DISTCLEANFILES = $(pkgconfig_DATA)
 
-if HAVE_LD_VERSION_SCRIPT
-  libgnutls_version_script_cmd = -Wl,--version-script=$(srcdir)/libgnutls.vers
-else
-  libgnutls_version_script_cmd =
-endif
+LIBGNUTLS_EXPORTS = -export-symbols-regex '^(_gnutls|gnutls|_E_).*'
 
 DIST_SUBDIRS = minitasn1 x509
 if ENABLE_MINITASN1
@@ -79,7 +75,7 @@
 
 libgnutls_la_LDFLAGS = $(LIBTASN1_LIBS) $(LIBGCRYPT_LIBS) \
        ../crypto/libgc.la \
-       $(libgnutls_version_script_cmd) \
+       $(LIBGNUTLS_EXPORTS) \
        -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
 
 pkix_asn1_tab.c: pkix.asn
Index: libextra/Makefile.am
===================================================================
RCS file: /cvs/gnutls/gnutls/libextra/Makefile.am,v
retrieving revision 1.51
diff -u -r1.51 Makefile.am
--- libextra/Makefile.am        24 Oct 2004 14:12:09 -0000      1.51
+++ libextra/Makefile.am        28 Oct 2004 18:12:44 -0000
@@ -10,11 +10,7 @@
 pkgconfig_DATA = gnutls-extra.pc
 DISTCLEANFILES = $(pkgconfig_DATA)
 
-if HAVE_LD_VERSION_SCRIPT
-  libgnutls_extra_version_script_cmd = 
-Wl,--version-script=$(srcdir)/libgnutls-extra.vers
-else
-  libgnutls_extra_version_script_cmd =
-endif
+LIBGNUTLS_EXTRA_EXPORTS = -export-symbols-regex '^gnutls.*'
 
 EXTRA_DIST = libgnutls-extra.vers \
        openssl_compat.h gnutls-extra-api.texi \
@@ -70,7 +66,7 @@
        gnutls_extra.c
 
 
-libgnutls_extra_la_LDFLAGS = $(libgnutls_extra_version_script_cmd) \
+libgnutls_extra_la_LDFLAGS = $(LIBGNUTLS_EXTRA_EXPORTS) \
        -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
        $(LIBOPENCDK_LIBS) $(LZO_LIBS)
 

Attachment: gt_hidden.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]