It looks like Nettle is no longer building or installing hogweed on some Apple platforms.
This is from a PowerMac G5 running OS X 10.5:
$ ls /usr/local/lib | grep -E 'gmp|nettle|hogweed' libgmp.10.dylib libgmp.a libgmp.dylib libgmp.la libnettle.8.2.dylib libnettle.8.3.dylib libnettle.8.dylib libnettle.a libnettle.dylib libpari-gmp.dylib
It is causing a failure in GnuTLS:
checking for NETTLE... yes checking for HOGWEED... no configure: error: *** *** Libhogweed (nettle's companion library) 3.4.1 was not found. Note that you must compile nettle with gmp support.
Jeff
The last version of Nettle to build and install Hogweed on PowerMac was 3.5.
I think this flew under the radar because prefix=/usr/local. Through subsequent upgrades, GnuTLS was picking up the old version of Hogwwed.
Jeff
On Wed, Mar 24, 2021 at 9:47 PM Jeffrey Walton noloader@gmail.com wrote:
It looks like Nettle is no longer building or installing hogweed on some Apple platforms.
This is from a PowerMac G5 running OS X 10.5:
$ ls /usr/local/lib | grep -E 'gmp|nettle|hogweed' libgmp.10.dylib libgmp.a libgmp.dylib libgmp.la libnettle.8.2.dylib libnettle.8.3.dylib libnettle.8.dylib libnettle.a libnettle.dylib libpari-gmp.dylib
It is causing a failure in GnuTLS:
checking for NETTLE... yes checking for HOGWEED... no configure: error:
*** Libhogweed (nettle's companion library) 3.4.1 was not found. Note that you must compile nettle with gmp support.
Jeff
Jeffrey Walton noloader@gmail.com writes:
It looks like Nettle is no longer building or installing hogweed on some Apple platforms.
This is from a PowerMac G5 running OS X 10.5:
Most likely the configure check for libgmp failed. Check config.log for details. I think the most recent change to the gmp dependency was in nettle-3.6, which requires gmp-6.1 or later.
Regards, /Niels
On Thu, Mar 25, 2021 at 3:48 AM Niels Möller nisse@lysator.liu.se wrote:
Jeffrey Walton noloader@gmail.com writes:
It looks like Nettle is no longer building or installing hogweed on some Apple platforms.
This is from a PowerMac G5 running OS X 10.5:
Most likely the configure check for libgmp failed. Check config.log for details. I think the most recent change to the gmp dependency was in nettle-3.6, which requires gmp-6.1 or later.
Here is what the GMP install looks like:
$ ls -al /usr/local/lib/*gmp* -rwxr-xr-x 1 root wheel 543216 Mar 24 21:39 /usr/local/lib/libgmp.10.dylib -rw-r--r-- 1 root wheel 3078944 Mar 24 21:39 /usr/local/lib/libgmp.a lrwxr-xr-x 1 root wheel 15 Mar 24 21:39 /usr/local/lib/libgmp.dylib -> libgmp.10.dylib -rwxr-xr-x 1 root wheel 947 Mar 24 21:39 /usr/local/lib/libgmp.la
And:
$ cat /usr/local/lib/pkgconfig/gmp.pc prefix=/usr/local exec_prefix=${prefix} includedir=${prefix}/include libdir=${prefix}/lib
Name: GNU MP Description: GNU Multiple Precision Arithmetic Library URL: https://gmplib.org Version: 6.2.1 Cflags: -I${includedir} Libs: -L${libdir} -lgmp
Attached is config.log.
Jeff
On Thu, Mar 25, 2021 at 1:20 PM Jeffrey Walton noloader@gmail.com wrote:
On Thu, Mar 25, 2021 at 3:48 AM Niels Möller nisse@lysator.liu.se wrote:
Jeffrey Walton noloader@gmail.com writes:
It looks like Nettle is no longer building or installing hogweed on some Apple platforms.
This is from a PowerMac G5 running OS X 10.5:
Most likely the configure check for libgmp failed. Check config.log for details. I think the most recent change to the gmp dependency was in nettle-3.6, which requires gmp-6.1 or later.
Here is what the GMP install looks like:
$ ls -al /usr/local/lib/*gmp* -rwxr-xr-x 1 root wheel 543216 Mar 24 21:39 /usr/local/lib/libgmp.10.dylib -rw-r--r-- 1 root wheel 3078944 Mar 24 21:39 /usr/local/lib/libgmp.a lrwxr-xr-x 1 root wheel 15 Mar 24 21:39 /usr/local/lib/libgmp.dylib -> libgmp.10.dylib -rwxr-xr-x 1 root wheel 947 Mar 24 21:39 /usr/local/lib/libgmp.la
And:
$ cat /usr/local/lib/pkgconfig/gmp.pc prefix=/usr/local exec_prefix=${prefix} includedir=${prefix}/include libdir=${prefix}/lib
Name: GNU MP Description: GNU Multiple Precision Arithmetic Library URL: https://gmplib.org Version: 6.2.1 Cflags: -I${includedir} Libs: -L${libdir} -lgmp
Attached is config.log.
OK, so I can work around this with:
./configure \ ac_cv_lib_gmp___gmpn_zero_p=yes
But the test is shady. It does not include the proper header and then looks for a mangled symbol name. If you would have used the proper header then gmpn_zero_p would have been available to you.
| /* Override any GCC internal prototype to avoid an error. | Use char because int might match the return type of a GCC | builtin and then its argument prototype would still apply. */ | #ifdef __cplusplus | extern "C" | #endif | char __gmpn_zero_p (); | int | main () | { | return __gmpn_zero_p (); | ; | return 0; | }
GMP needs a fair amount of patching on OS X 10.5 due to the extern inline problems. Here's what my patches look like: https://github.com/noloader/Build-Scripts/blob/master/patch/gmp-darwin.patch. It includes a patch for mpn_zero_p.
The GMP folks have been aware of the problem for about 15 years but have not fixed it. Also see https://gmplib.org/list-archives/gmp-bugs/2009-May/001423.html. I also wrote to one of the maintainers and offered the patch. "Patches welcome" is utter bullshit in the free software world. I laugh when I see someone use the phrase.
I think you should reconsider how you do things. The recommended way to check for a version of the library is with pkg-config. I.e.:
pkg-config --libs "gmp >= 6.1.0"
I also think you should pay more attention to the dominant use case of nettle+hogweed. It is dominant because distros and users expect/need nettle+hogweed. GnuTLS requires nettle+hogweed. (Can you name anyone who just wants nettle?).
The current behavior of silent failure is not appropriate. You should fail configure _if_ GMP is not satisfactory in the absence of --disable-hogweed. Folks who do not want hogweed are _not_ the majority. They should have to do something special like --disable-hogweed. That's good security engineering.
Jeff
nettle-bugs@lists.lysator.liu.se