diff options
author | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2019-07-26 01:17:57 +0100 |
---|---|---|
committer | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2019-07-26 01:17:57 +0100 |
commit | 23e26355b11ce562dc7f9c4ad85b78e4b7c60f83 (patch) | |
tree | 37fe57201a2ee08e05e61eb51bfb3b4895c684f2 /reproduce | |
parent | af43062b5eb5f8af9f6c59e1cb6b0ee003bf107a (diff) |
PatchELF built statically and updated
Until now, like all other software, PatchELF would install with dynamic
linking. However, PatchELF links with `libstdc++' so on one system, I
noticed that PatchELF gives a segmentation fault and corrupts `libstdc++'
while correcting its RPATH (after installing GCC). The solution is to build
PatchELF statically.
With this commit, we force PatchELF to be built statically (it only
installs on GNU/Linux systems anyway, so there is no problem with static
linking on macOS). This solved the problem on that system.
While looking at its documentation, I also noticed that a new version of
PatchELF has been released after almost three years, so it has been updated
in the template also.
This fixes bug #56673.
Diffstat (limited to 'reproduce')
-rw-r--r-- | reproduce/software/config/installation/versions.mk | 2 | ||||
-rw-r--r-- | reproduce/software/make/basic.mk | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/reproduce/software/config/installation/versions.mk b/reproduce/software/config/installation/versions.mk index 80d9619..14c43d1 100644 --- a/reproduce/software/config/installation/versions.mk +++ b/reproduce/software/config/installation/versions.mk @@ -47,7 +47,7 @@ mpfr-version = 4.0.2 mpc-version = 1.1.0 ncurses-version = 6.1 openssl-version = 1.1.1a -patchelf-version = 0.9 +patchelf-version = 0.10 pkgconfig-version = 0.29.2 readline-version = 8.0 sed-version = 4.7 diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index 5535019..e544234 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -519,8 +519,14 @@ $(ibidir)/readline: $(tdir)/readline-$(readline-version).tar.gz \ SHLIB_LIBS="-lncursesw" -j$(numthreads)) \ && echo "GNU Readline $(readline-version)" > $@ +# Patchelf has to be built statically because it links with the C++ +# standard library. Therefore while fixing rpath in `libstdc++' with +# Patchelf we can have a segmentation fault. Note that Patchelf is only for +# GNU/Linux systems, so there is no problem with having the `-static' flag +# in LDFLAGS. $(ibidir)/patchelf: $(tdir)/patchelf-$(patchelf-version).tar.gz \ $(ibidir)/make + export LDFLAGS="$$LDFLAGS -static"; \ $(call gbuild, $<, patchelf-$(patchelf-version), static) \ && echo "PatchELF $(patchelf-version)" > $@ @@ -1153,7 +1159,7 @@ $(ibidir)/gcc: $(gcc-tarball) \ && cd ../.. \ && rm -rf gcc-$(gcc-version) \ && if [ "x$(on_mac_os)" != xyes ]; then \ - for f in $$(find $(idir)/libexec/gcc) $(ildir)/libstdc++**; do \ + for f in $$(find $(idir)/libexec/gcc) $(ildir)/libstdc++*; do \ if ldd $$f &> /dev/null; then \ patchelf --set-rpath $(ildir) $$f; \ fi; \ |