aboutsummaryrefslogtreecommitdiff
path: root/reproduce/software/make
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2019-07-26 01:17:57 +0100
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2019-07-26 01:17:57 +0100
commit23e26355b11ce562dc7f9c4ad85b78e4b7c60f83 (patch)
tree37fe57201a2ee08e05e61eb51bfb3b4895c684f2 /reproduce/software/make
parentaf43062b5eb5f8af9f6c59e1cb6b0ee003bf107a (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/software/make')
-rw-r--r--reproduce/software/make/basic.mk8
1 files changed, 7 insertions, 1 deletions
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; \