Nettle 3.5.1 and OS X 10.12 patch

Jeffrey Walton noloader at gmail.com
Sat Mar 28 06:52:05 CET 2020


Hi Everyone/Niels,

I've got a bare-bones Mac-mini without Xcode. It has CC Tools but that
is it. It is in a stock configuration.

When I attempt to run 'make check' nearly every test failed due to
missing libnettle and libhogweed. The libraries were present in .lib/,
but something was blowing away LD_LIBRARY_PATH and DYLD_LIBRARY_PATH.
My driver script set it, and the Nettle sources also set it after I
set it. But by the times the test runner scripts were run, they were
empty again (they were empty at the Makefile, before hitting the test
runners).

I know Apple did some hardening lately but I have not read anything
about scrubbing LD_LIBRARY_PATH and DYLD_LIBRARY_PATH. But it appears
something was sanitizing the environment.

Attached is the patch I needed for the issue on OS X 10.12. It also
tested good on Ubuntu 18.04 and Solaris 11.3. Earlier versions of OS
X, like OS X 10.9 and OS X 10.5, were OK. It was just OS X 10.12.

The short of it is, each test runner, like run-tests.sh, needed to
restore the variables using an absolute path. dirname is Posix so it
is available to strip the unwanted path component, like testsuite/ or
example/.

+nettle_lib_dir=`dirname $PWD`/.lib
+LD_LIBRARY_PATH=$nettle_lib_dir
+DYLD_LIBRARY_PATH=$nettle_lib_dir
+
+export LD_LIBRARY_PATH
+export DYLD_LIBRARY_PATH

Jeff



More information about the nettle-bugs mailing list