Skip to content

Commit

Permalink
julia: remove leftover RPATH from pcre shared libraries
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
donald committed Aug 18, 2016
1 parent 37a479d commit afaf258
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion julia.be0
Original file line number Diff line number Diff line change
@@ -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.)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit afaf258

Please sign in to comment.