The attached patches fix compilation issues with mini-gmp, add a gitlab build rule, and prevent the symbols defined in gmp-glue.h from being exported into nettle's ABI.
The latter was to avoid abidiff differences to hogweed's ABI when built with different gmp versions. For that I renamed the gmp-glue _nettle_* symbols to _inettle_*.
regards, Nikos
Nikos Mavrogiannopoulos nmav@redhat.com writes:
The latter was to avoid abidiff differences to hogweed's ABI when built with different gmp versions. For that I renamed the gmp-glue _nettle_* symbols to _inettle_*.
Can you explain what the problem is? I know there's been some hassle also for the debian maintainer, but apparently solvable by other means.
I don't like the "_inettle_" prefix, though. We shouldn't add even more prefixes to the symbol namespace (for an ELF shared library, it might not matter much, if the point is to make the symbols in question unexported, but we also have static libraries).
Would it work to instead exclude _nettle_mp?_* or so?
--- a/testsuite/Makefile.in +++ b/testsuite/Makefile.in @@ -84,7 +84,7 @@ all: $(EXTRA_TARGETS) # explicit rule for each and every executable.
LIB_HOGWEED = @IF_HOGWEED@ -lhogweed -TEST_OBJS = testutils.$(OBJEXT) ../nettle-internal.$(OBJEXT) \ +TEST_OBJS = testutils.$(OBJEXT) ../gmp-glue.$(OBJEXT) ../nettle-internal.$(OBJEXT) \ $(LIB_HOGWEED) -lnettle $(LIBS)
Why is this? Test code using the gmp-glue functions, and they're now hidden in the library?
From f13aae72cba67bb8bc7462b88d79a7e29ca2d6bb Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos nmav@redhat.com Date: Thu, 10 Mar 2016 17:44:08 +0100 Subject: [PATCH 2/3] configure: export mp_ symbols when compiling with mini-gmp
This addresses build issue when compiling with --enable-mini-gmp and the symbol script being used.
Applied.
From 97731353e81dba097c533a1b5be285508efc3384 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos nmav@redhat.com Date: Thu, 10 Mar 2016 17:45:07 +0100 Subject: [PATCH 3/3] .gitlab-ci.yml: enhance with mini-gmp builds
Applied.
Regards, /Niels
On Tue, 2016-03-15 at 19:50 +0100, Niels Möller wrote:
Nikos Mavrogiannopoulos nmav@redhat.com writes:
The latter was to avoid abidiff differences to hogweed's ABI when built with different gmp versions. For that I renamed the gmp-glue _nettle_* symbols to _inettle_*.
Can you explain what the problem is? I know there's been some hassle also for the debian maintainer, but apparently solvable by other means.
It's a question of, if they are not part of the ABI then why export them to applications? By exporting internal functions you allow applications to use them and you'll have issues when you try to refactor them; see previous discussion with RSA blinding: https://lists.lysator.liu.se/pipermail/nettle-bugs/2015/002995.html
One other approach would to be keep a different namespace for private symbols that need to be exported for test applications and so.
I don't like the "_inettle_" prefix, though. We shouldn't add even more prefixes to the symbol namespace (for an ELF shared library, it might not matter much, if the point is to make the symbols in question unexported, but we also have static libraries).
Would it work to instead exclude _nettle_mp?_* or so?
That could be an option if it would work with the version script. However, that would make the version script a place to list the functions not to be exported, rather than vice-versa, and thus would be hard to manage.
--- a/testsuite/Makefile.in
+++ b/testsuite/Makefile.in @@ -84,7 +84,7 @@ all: $(EXTRA_TARGETS) # explicit rule for each and every executable. LIB_HOGWEED = @IF_HOGWEED@ -lhogweed -TEST_OBJS = testutils.$(OBJEXT) ../nettle-internal.$(OBJEXT) \ +TEST_OBJS = testutils.$(OBJEXT) ../gmp-glue.$(OBJEXT) ../nettle- internal.$(OBJEXT) \ $(LIB_HOGWEED) -lnettle $(LIBS)
Why is this? Test code using the gmp-glue functions, and they're now hidden in the library?
It includes the gmp-glue functions directly since they are not available for use.
regards, Nikos
Nikos Mavrogiannopoulos nmav@redhat.com writes:
One other approach would to be keep a different namespace for private symbols that need to be exported for test applications and so.
That makes sense. But I don't understand what type of "namespaces" you refer to here. Can you explain? How would a test program gain access to functions in the internal namespace?
Would it work to instead exclude _nettle_mp?_* or so?
That could be an option if it would work with the version script. However, that would make the version script a place to list the functions not to be exported, rather than vice-versa, and thus would be hard to manage.
Hmm. And yet another option might be to use visibility attributes (an ELF feature, I understand roughly how they work, but I don't have any real experience).
Regards, /Niels
On Wed, 2016-03-16 at 10:46 +0100, Niels Möller wrote:
Nikos Mavrogiannopoulos nmav@redhat.com writes:
One other approach would to be keep a different namespace for private symbols that need to be exported for test applications and so.
That makes sense. But I don't understand what type of "namespaces" you refer to here. Can you explain? How would a test program gain access to functions in the internal namespace?
In gnutls I keep the supported ABI under the GNUTLS_3_4 namespace while functions that need to be exported for testing or other purposes are assigned to GNUTLS_PRIVATE_3_4.
I set that using the version script: https://gitlab.com/gnutls/gnutls/blob/master/lib/libgnutls.map
I don't know if there are any other best practices.
regards, Nikos
nettle-bugs@lists.lysator.liu.se