From c148d4c35419607354fd1cecd1aaa776e7b71569 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 27 Aug 2019 15:49:09 +0200 Subject: Force use of RPATH instead of RUNPATH on Linux RUNPATH messes up our use of dlopen(). --- build2/buildfile | 13 ++++++++++--- libbuild2/buildfile | 10 +++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/build2/buildfile b/build2/buildfile index a1b299d..196c485 100644 --- a/build2/buildfile +++ b/build2/buildfile @@ -56,13 +56,20 @@ if ($cxx.target == $build.host) -DBUILD2_NATIVE_CXX=\"$regex.replace($recall($cxx.path), '\\', '\\\\')\" } -if ($cxx.target.class != "windows") +if ($cxx.target.class != 'windows') { - # Make sure backtrace includes function names. - # if ($cxx.target.class == 'linux') + { + # Make sure backtrace includes function names. + # cxx.loptions += -rdynamic + # Make sure we use RPATH and not RUNPATH since the latter messes up + # dlopen(). + # + cxx.loptions += -Wl,--disable-new-dtags + } + cxx.libs += -lpthread } else diff --git a/libbuild2/buildfile b/libbuild2/buildfile index 881b6e8..b536eba 100644 --- a/libbuild2/buildfile +++ b/libbuild2/buildfile @@ -94,8 +94,16 @@ if! $cross obja{context}: cxx.poptions += -DLIBBUILD2_STATIC_BUILD objs{context}: cxx.poptions += -DLIBBUILD2_SHARED_BUILD -if ($cxx.target.class != "windows") +if ($cxx.target.class != 'windows') { + if ($cxx.target.class == 'linux') + { + # Make sure we use RPATH and not RUNPATH since the latter messes up + # dlopen(). + # + cxx.loptions += -Wl,--disable-new-dtags + } + cxx.libs += -lpthread if ($cxx.target.class != "bsd") -- cgit v1.1