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 From d91813aaaa0dc1ae41364526ad148334a19c9c36 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Fri, 17 Apr 2020 23:55:26 +0100 Subject: Replaced name of directory under akhlaghi.org as backup server Until now, when a the raw tarball of some software wasn't usable, I would put it under my own webpage, or `akhlaghi.org/reproduce-software'. That same address was also used as a backup server. However, now the project has a proper name: Maneage. So I changed the directory on my own server to `akhlaghi.org/maneage-software'. With this commit, this new address has replaced the old one. But to avoid crashes in projects that haven't yet merged with the main Maneage branch, the old `reproduce-software' still works (its actually a symbolic link to the new directory now). --- reproduce/software/make/basic.mk | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index e8fc105..19f5500 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -85,7 +85,7 @@ all: $(foreach p, $(top-level-programs), $(ibidir)/$(p)) # Servers to use as backup, later this should go in a file that is not # under version control (the actual server that the tarbal comes from is # irrelevant). -backupservers = http://akhlaghi.org/reproduce-software +backupservers = http://akhlaghi.org/maneage-software @@ -99,7 +99,7 @@ backupservers = http://akhlaghi.org/reproduce-software # we can preserve the variables). # # Software with main webpage at our backup repository -# (http://akhlaghi.org/reproduce-software): As of our latest check their +# (http://akhlaghi.org/maneage-software): As of our latest check their # major release tarballs either crash or don't build on some systems (for # example Make or Gzip), or they don't exist (for example Bzip2). So we are # building them from their Git history (which builds properly) or host them @@ -164,10 +164,10 @@ $(tarballs): $(tdir)/%: | $(lockdir) | awk '{print $$1}' ); \ \ mergenames=1; \ - if [ $$n = bash ]; then c=$(bash-checksum); w=http://akhlaghi.org/reproduce-software; \ + if [ $$n = bash ]; then c=$(bash-checksum); w=http://akhlaghi.org/maneage-software; \ elif [ $$n = binutils ]; then c=$(binutils-checksum); w=http://ftp.gnu.org/gnu/binutils; \ - elif [ $$n = bzip ]; then c=$(bzip2-checksum); w=http://akhlaghi.org/reproduce-software; \ - elif [ $$n = cert ]; then c=$(cert-checksum); w=http://akhlaghi.org/reproduce-software; \ + elif [ $$n = bzip ]; then c=$(bzip2-checksum); w=http://akhlaghi.org/maneage-software; \ + elif [ $$n = cert ]; then c=$(cert-checksum); w=http://akhlaghi.org/maneage-software; \ elif [ $$n = coreutils ]; then c=$(coreutils-checksum); w=http://ftp.gnu.org/gnu/coreutils;\ elif [ $$n = curl ]; then c=$(curl-checksum); w=https://curl.haxx.se/download; \ elif [ $$n = diffutils ]; then c=$(diffutils-checksum); w=http://ftp.gnu.org/gnu/diffutils;\ @@ -187,9 +187,9 @@ $(tarballs): $(tdir)/%: | $(lockdir) elif [ $$n = m ]; then \ mergenames=0; \ c=$(m4-checksum); \ - w=http://akhlaghi.org/reproduce-software/m4-1.4.18-patched.tar.gz; \ + w=http://akhlaghi.org/maneage-software/m4-1.4.18-patched.tar.gz; \ elif [ $$n = make ]; then c=$(make-checksum); w=https://ftp.gnu.org/gnu/make; \ - elif [ $$n = metastore ]; then c=$(metastore-checksum); w=http://akhlaghi.org/reproduce-software; \ + elif [ $$n = metastore ]; then c=$(metastore-checksum); w=http://akhlaghi.org/maneage-software; \ elif [ $$n = mpc ]; then c=$(mpc-checksum); w=http://ftp.gnu.org/gnu/mpc; \ elif [ $$n = mpfr ]; then c=$(mpfr-checksum); w=http://www.mpfr.org/mpfr-current;\ elif [ $$n = ncurses ]; then c=$(ncurses-checksum); w=http://ftp.gnu.org/gnu/ncurses; \ -- cgit v1.2.1 From 3a49e2c1a627a1240919439bb1b52005e260e099 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Sat, 18 Apr 2020 00:34:20 +0100 Subject: Properly adding libiconv to the libraries that libstdc++ links with Of the GCC dynamically linked libraries we need to manually add RPATH to all and for `libstdc++' we also need to tell it to link with `libiconv'. Until now, the conditional to check for libstdc++ was not working and thus libiconv wasn't been added to it. With this commit the conditional has been corrected and is now working. Also, to help in reading the logs, an echo statement was added after every call to PatchELF. --- reproduce/software/make/basic.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index 19f5500..d1fbc3f 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -1330,8 +1330,11 @@ $(ibidir)/gcc: | $(ibidir)/binutils \ if [ x"$$isdynamic" != x ]; then \ cp $$f $$tempname; \ patchelf --set-rpath $(ildir) $$tempname; \ - if [ "$$f" = $(ildir)/libstdc++.so ]; then \ + echo "$$f: added rpath"; \ + islibcpp=$$(echo $$f | grep "libstdc++"); \ + if [ x"$$islibcpp" != x ]; then \ patchelf --add-needed $(ildir)/libiconv.so $$tempname; \ + echo "$$f: linked with libiconv"; \ fi; \ mv $$tempname $$f; \ fi; \ -- cgit v1.2.1