From 5950fb9d463b8258f2b1bbd633585eff1ff06002 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Fri, 17 Apr 2020 20:29:55 +0100 Subject: Patchelf is now built dynamically Until a few commits ago, PatchELF was built statically because it was used to patch `libstdc++' at the end of the GCC building phase, but PatchELF also depends on `libstdc++', so it would crash. However, recently when patching the GCC libraries, we don't directly apply Patchelf to the library, first we copy it to a temporary place, do the patching, then put it in its proper place. So the problem above won't happen any more. With this commit, I am thus removing the static flag from patchelf and letting it built dynamically all the time. The main problem was that some systems don't have a static C++ library, so PatchELF couldn't be built statically. Instead of adding more checks, we just fixed the core foundation of the problem. --- reproduce/software/make/basic.mk | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index 17bb47a..e8fc105 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -567,18 +567,9 @@ $(ibidir)/readline: $(ibidir)/ncurses \ SHLIB_LIBS="-lncursesw" -j$(numthreads)) \ && echo "GNU Readline $(readline-version)" > $@ -# When we have a static C library, PatchELF will be built statically. This -# is because PatchELF links with the C++ standard library. But we need to -# run PatchELF later on `libstdc++'! This circular dependency can cause a -# crash, so when PatchELF can't be built statically, we won't build GCC -# either, see the `configure.sh' script where we define `good_static_libc' -# for more. $(ibidir)/patchelf: | $(ibidir)/make \ $(tdir)/patchelf-$(patchelf-version).tar.gz - if [ $(good_static_libc) = 1 ]; then \ - export LDFLAGS="$$LDFLAGS -static"; \ - fi; \ - $(call gbuild, patchelf-$(patchelf-version), static) \ + $(call gbuild, patchelf-$(patchelf-version)) \ && echo "PatchELF $(patchelf-version)" > $@ @@ -1342,7 +1333,7 @@ $(ibidir)/gcc: | $(ibidir)/binutils \ if [ "$$f" = $(ildir)/libstdc++.so ]; then \ patchelf --add-needed $(ildir)/libiconv.so $$tempname; \ fi; \ - mv $$tempname $$f; echo "corrected"; \ + mv $$tempname $$f; \ fi; \ done; \ fi \ -- cgit v1.2.1