From a0384b8b70896e9a162fb7f725f196fc994abf10 Mon Sep 17 00:00:00 2001 From: BtbN Date: Fri, 14 May 2021 19:23:11 +0200 Subject: [PATCH] Set $ORIGIN based rpath on shared linux binaries --- scripts.d/99-rpath.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 scripts.d/99-rpath.sh diff --git a/scripts.d/99-rpath.sh b/scripts.d/99-rpath.sh new file mode 100644 index 0000000..448c98c --- /dev/null +++ b/scripts.d/99-rpath.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +ffbuild_enabled() { + [[ $TARGET == linux* ]] +} + +ffbuild_dockerfinal() { + return 0 +} + +ffbuild_dockerlayer() { + return 0 +} + +ffbuild_dockerstage() { + return 0 +} + +ffbuild_dockerbuild() { + return 0 +} + +ffbuild_configure() { + if [[ $VARIANT == *shared* ]]; then + # Can't escape escape hell + echo --extra-ldexeflags=\'-Wl,-rpath='\\\\\\\$\\\$ORIGIN'\\ -Wl,-rpath='\\\\\\\$\\\$ORIGIN/../lib'\' + fi +}