problems with --enable-shared

James Ralston qralston+ml.nettle-bugs at andrew.cmu.edu
Fri, 1 Nov 2002 02:37:26 -0500 (EST)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--625095215-203981426-1036136246=:5831
Content-Type: TEXT/PLAIN; charset=US-ASCII

I tried building nettle 1.6 with --enabled-shared on Red Hat Linux 8.0
on x86.

The command to build the shared library doesn't get the soname or the
filename correct:

    gcc  -shared -Wl,-soname=libnettle.so. aes_p.o [...] nettle-openssl_p.o -o libnettle.so

The attached patch fixes the problem.

The example programs are built like this:

    [...] ../libnettle.a -lcrypto -lgmp

In order to test the shared libraries, that needs to be something like
this:

    [...] -L.. -lnettle -lcrypto -lgmp

That will work even if a shared library wasn't build.  The example
programs will need to be invoked with LD_LIBRARY_PATH set
appropriately.

However, when I tested linking one of the example programs with the
shared library, it failed:

gcc  -I.. -g -O2 -ggdb3 -Wall -W   -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes   -Wpointer-arith -Wbad-function-cast -Wnested-externs   -o rsa-keygen  rsa-keygen.o io.o -L.. -lnettle -lcrypto -lgmp
../libnettle.so: undefined reference to `memxor'
collect2: ld returned 1 exit status

I haven't had time to look at this one any further...

Regards,

-- 
James Ralston, Information Technology
Software Engineering Institute
Carnegie Mellon University, Pittsburgh, PA, USA

--625095215-203981426-1036136246=:5831
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="nettle-1.6-shared.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0211010237260.5831@shieldbreaker.l33tskillz.org>
Content-Description: 
Content-Disposition: attachment; filename="nettle-1.6-shared.patch"

LS0tIG5ldHRsZS0xLjYvTWFrZWZpbGUuaW4uc2hhcmVkCTIwMDItMTAtMDIg
MTU6NDA6MDguMDAwMDAwMDAwIC0wNDAwDQorKysgbmV0dGxlLTEuNi9NYWtl
ZmlsZS5pbgkyMDAyLTExLTAxIDAyO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