Michael Weiser michael.weiser@gmx.de writes:
In a quick test on Mojave it appears that any attempt to setenv() a variable that starts with DYLD_ is silently ignored. Can you confirm that? My testcase is:
DYLD_FOO=foo DLYD_FOO=bar bash -c 'echo $DYLD_FOO $DLYD_FOO'
from which I get only 'bar' and no 'foo'.
Odd. I hope it's still possible to set DYLD_LIBRARY_PATH to a valid absolute name of a directory?
I recently ran into a similar problem where uClibc on Linux by default ignores relative paths in LD_LIBRARY_PATH causing the same problems when running the test suite. So there's two reasons to think about alternatives to setting the variable.
I think a reasonable way is to add
abs_top_builddir = @abs_top_builddir@
TEST_SHLIB_DIR = "${abs_top_builddir}/.lib"
to config.make.in, and use that to set LD_LIBRARY_PATH. And possibly only pass TEST_SHLIB_DIR to the run-tests script, and move the logic to setup the environment.
Is the testsuite supposed to be relocatable or installable?
Not the test programs, but the programs in tools/ are, and they're also run by the testsuite.
If not, we could link with something like -Wl,-rpath,$(dir $(shell pwd))/.lib to avoid this issue (until Apple or uClibc hardens some more ;). I see that configure already checks and sets RPATHFLAG (seems unused though!?), so we could reuse that to try and avoid other fallout.
It's used by LSH_RPATH_FIX, just after the check for gmp.
: # Checks for libraries : if test "x$enable_public_key" = "xyes" ; then : if test "x$enable_mini_gmp" = "xno" ; then : AC_CHECK_LIB(gmp, __gmpn_sec_div_r,, : [AC_MSG_WARN( : [GNU MP not found, or too old. GMP-6.0 or later is needed, see : https://gmplib.org/. : Support for public key algorithms will be unavailable.])] : enable_public_key=no) : : # Add -R flags needed to run programs linked with gmp : LSH_RPATH_FIX : fi : fi
This is intended to handle the case that gmp is in /usr/local, you configure with --with-lib-path=/usr/local/lib --with-inlcude-path=/usr/local/include, but the runtime linker doesn't look in /usr/local/lib. Then LSH_RPATH_FIX will add the appropriate flag to set rpath. (I see there are some other unused macros in aclocal.m4, left overs from when nettle was taken out of lsh).
Regards, /Niels