From afaf258fc936fd3155497e0b235c51e821e40c26 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 18 Aug 2016 09:19:18 +0200 Subject: [PATCH] julia: remove leftover RPATH from pcre shared libraries https://github.com/JuliaLang/julia/issues/18106 Without this change the julia build system installed the two pcre shared libraries /usr/lib/julia/libpcre2-8.so.0.2.0 and /usr/lib/julia/libpcre2-posix.so.0.0.0 with an RPATH to a build directory (eg. /dev/shm/bee-root/julia/julia-0.4.6-0/source/usr/lib) which is a security problem if the build directory is in a public writable temp space as is the case here. The patch --- a/deps/Makefile +++ b/deps/Makefile @@ -788,9 +788,6 @@ PCRE_OBJ_TARGET = $(build_shlibdir)/libpcre2-8.$(SHLIB_EXT) # Force optimization for PCRE flags (Issue #11668) PCRE_CFLAGS = -O3 -ifneq ($(OS),WINNT) -PCRE_LDFLAGS = "-Wl,-rpath,'$(build_libdir)'" -endif pcre2-$(PCRE_VER).tar.bz2: $(JLDOWNLOAD) $@ https://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-$(PCRE_VER).tar.bz2 -- fixed the problem only for one of the two libraries, as the RPATH of the other one is also set by the pcre build system. --- julia.be0 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/julia.be0 b/julia.be0 index 97e351fa6..f3e29363a 100755 --- a/julia.be0 +++ b/julia.be0 @@ -1,6 +1,6 @@ #!/usr/bin/env beesh -# BEE_VERSION julia-0.4.6-0 +# BEE_VERSION julia-0.4.6-1 ## this file was created by bee init and should be executed to build a ## bee-package. (Additional hints are located at the end of this file.) @@ -66,6 +66,12 @@ mee_install() { } # by default this may be 'make install DESTDIR="${D}"' +mee_install_post() { + # https://github.com/JuliaLang/julia/issues/18106 + patchelf --remove-rpath $D/$LIBDIR/julia/libpcre2-8.so.0.2.0 + patchelf --remove-rpath $D/$LIBDIR/julia/libpcre2-posix.so.0.0.0 +} + ############################################################################### ## ## Additional hints: