On Mon, Jul 20, 2020 at 8:04 AM Niels Möller nisse@lysator.liu.se wrote:
Jeffrey Walton noloader@gmail.com writes:
You have to fix the makefiles. If you escape the dollar signs in LDFLAGS, then Autotools will fail its conftests because they don't use a makefile. Autotools conftests use CFLAGS, LDFLAGS (and friends) directly.
In that case, how is your "-Wl,-runpath,$(prefix)/lib" handled at that stage?
I'll reach out to other GNU maintainers to ask for advice. I don't want to depart much from what others do here.
$(prefix) is expanded to a path. It is no longer a variable.
Here's how my variables look on Ubuntu 18.04:
PREFIX: /usr/local LIBDIR: /usr/local/lib
AUTOCONF_BUILD: x86_64-pc-linux-gnu PKG_CONFIG_PATH: /usr/local/lib/pkgconfig CPPFLAGS: -I/usr/local/include -DNDEBUG ASFLAGS: -Wa,--noexecstack CFLAGS: -g2 -O2 -march=native -fPIC -pthread CXXFLAGS: -g2 -O2 -march=native -fPIC -pthread LDFLAGS: -L/usr/local/lib -Wl,-R,'$ORIGIN/../lib' -Wl,-R,/usr/local/lib -Wl,--enable-new-dtags -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-z,origin LDLIBS: -ldl -lpthread
It looks like Nettle is one of three libraries that don't handle the rpath tokens well. The other two are Perl and OpenLDAP.
Nettle is pretty easy to fix with editelf and patchelf. I can patch the programs and libraries after 'make' and 'make check'. Perl and OpenLDAP resist the fix by building shit during 'make install'. I don't have access to the programs and libraries at that point.
Jeff