Dear All,

 

I hope this is the right place to raise a bug / provide a patch,

as I couldn't find information for a separate bug-tracker for Nettle.

 

I have observed that Nettle throws a compilation error upon introducing the gcc flag "-fno-common".

Specifically, configuring Nettle ver 2.2 as
`configure CFLAGS="$CFLAGS -fno-common" CXXFLAGS="$CXXFLAGS -fno-common"´

is successful, but issuing a  make throws the following kinds of errors:

ctr.po: In function `nettle_ctr_crypt':
/home/s.addepalli/downloads/nettle-2.2/ctr.c:47: multiple definition of `nettle_gcm_aes128'
cbc.po:/home/s.addepalli/downloads/nettle-2.2/cbc.c:44: first defined here

Many such errors are thrown, the full list is attached.

 

I have also observed, that these errors are avoided, if nettle-internal.h is changed as follows:

-const struct nettle_aead nettle_gcm_aes128;

+extern const struct nettle_aead nettle_gcm_aes128;

This is also a sample change, the full patch is attached.

After "extern"-ing all such nettle_aead structs, the error disappears, and make check succeeds too.

 

Please review if the attached patch is the correct fix for this bug.

 

Yours sincerely,

Sarat Addepalli.