From bbc6dd96dc87bd3be7d2a4cecab5072e3f7edb46 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 2 Aug 2017 16:23:19 +0200 Subject: [PATCH] make: revert adding -rpath by default This reverts commits 89ebf5293 and 1d8b5706cd. I didn't realize that setting rpath is considered bad practice by most distributions. I'm really "spoiled" by nix(pkgs/os). --- doc/build.rst | 6 ++++++ platform.mk | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/build.rst b/doc/build.rst index 6ba6f5314..9b47b7ee5 100644 --- a/doc/build.rst +++ b/doc/build.rst @@ -125,6 +125,12 @@ When you have all the dependencies ready, you can build and install. Production code should be compiled with ``-DNDEBUG``. If you build the binary with ``-DNOVERBOSELOG``, it won't be possible to turn on verbose logging; we advise packagers against using that flag. +.. note:: If you build with ``PREFIX``, you may need to also set the ``LDFLAGS`` for the libraries: + +.. code-block:: bash + + make LDFLAGS="-Wl,-rpath=/usr/local/lib" PREFIX="/usr/local" + Alternatively you can build only specific parts of the project, i.e. ``library``. .. code-block:: bash diff --git a/platform.mk b/platform.mk index b56be0226..ad3367c18 100644 --- a/platform.mk +++ b/platform.mk @@ -43,7 +43,7 @@ else SOVER = $(if $(1), -compatibility_version $(2) -current_version $(1),) else PLATFORM := POSIX - LDFLAGS += -pthread -lm -Wl,-E "-Wl,-rpath=$(LIBDIR)" + LDFLAGS += -pthread -lm -Wl,-E # ELF hardening options ifneq ($(HARDENING),no) BINFLAGS += -pie -- 2.47.2