From be73ea496657099603cce7e20413b9c6ee993c94 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Sun, 19 Jan 2020 21:15:37 +0000 Subject: LIBRARY_PATH is set accordingly based on the host Until now, GCC wouldn't build properly on Debian-based operating systems because `ld' needed to link with several necessary C library features like `crti.o' and `crtn.o' (this is an `ld' issue, not GCC). The solution is to add the directory containing them to `LIBRARY_PATH'. In the previous commit, I actually searched for these files, but while testing on another system, I noticed that it can be problematic (other architectures may exist). With this commit, we are actually finding the build architecture of the running GCC (which is the same as the `ld') and using that to fix a fixed directory to `LIBRARY_PATH'. --- reproduce/software/make/basic.mk | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index e7d00df..9eba04b 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -1174,6 +1174,7 @@ $(ibidir)/binutils: | $(ibidir)/sed \ $(ibidir)/diffutils \ $(ibidir)/coreutils \ $(gcc-prerequisites) + if [ x$(on_mac_os) = xyes ]; then \ $(call makelink,as); \ $(call makelink,ar); \ @@ -1183,7 +1184,9 @@ $(ibidir)/binutils: | $(ibidir)/sed \ $(call makelink,ranlib); \ echo "" > $@; \ else \ - $(call gbuild, binutils-$(binutils-version), static) \ + $(call gbuild, binutils-$(binutils-version), static, \ + --with-lib-path=$(sys_library_path), \ + -j$(numthreads) ) \ && echo "GNU Binutils $(binutils-version)" > $@; \ fi @@ -1257,15 +1260,19 @@ $(ibidir)/gcc: | $(ibidir)/binutils \ && make SHELL=$(ibdir)/bash -j$(numthreads) \ && make SHELL=$(ibdir)/bash install \ && cd ../.. \ - && rm -rf gcc-$(gcc-version) \ + && tempname=$(ddir)/gcc-$(gcc-version)/build/rpath-temp-copy \ && if [ "x$(on_mac_os)" != xyes ]; then \ patchelf --add-needed $(ildir)/libiconv.so $(ildir)/libstdc++.so; \ for f in $$(find $(idir)/libexec/gcc) $(ildir)/libstdc++*; do \ - if ldd $$f &> /dev/null; then \ - patchelf --set-rpath $(ildir) $$f; \ + isdynamic=$$(file $$f | grep "dynamically linked"); \ + if [ x"$$isdynamic" != x ]; then \ + cp $$f $$tempname; \ + patchelf --set-rpath $(ildir) $$tempname; \ + mv $$tempname $$f; echo "corrected"; \ fi; \ done; \ fi \ + && rm -rf gcc-$(gcc-version) \ && ln -sf $(ibdir)/gcc $(ibdir)/cc \ && echo "GNU Compiler Collection (GCC) $(gcc-version)" > $@; \ fi -- cgit v1.2.1 From e3bbc17c051c7ccbf9e5375b85c90e5e41af2adb Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Sun, 19 Jan 2020 23:30:26 +0000 Subject: GNU Make updated to version 4.3 GNU Make 4.3 was just announced, so I have updated it here is well. This was important because until now the installable version was in alpha-mode (4.2.90), now its a stable version. --- reproduce/software/make/basic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index 9eba04b..343b3b0 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -176,7 +176,7 @@ $(tarballs): $(tdir)/%: | $(lockdir) mergenames=0; \ c=$(m4-checksum); \ w=http://akhlaghi.org/reproduce-software/m4-1.4.18-patched.tar.gz; \ - elif [ $$n = make ]; then c=$(make-checksum); w=https://alpha.gnu.org/gnu/make; \ + 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 = 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;\ -- cgit v1.2.1 From 7ac86df891798fd1f0ef4d7a40aff43ec9621854 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Mon, 20 Jan 2020 00:05:41 +0000 Subject: IMPORTANT!!! Configuration Makefiles now have a .conf suffix Until now, the configuration Makefiles (in `reproduce/software/config/installation' and `reproduce/analysis/config') had a `.mk' suffix, similar to the workhorse Makefiles. Although they are indeed Makefiles, but given their nature (to only keep configuration parameters), it is confusing (especially to early users) for them to also have a `.mk' (similar to the analysis or software building Makefiles). To address this issue, with this commit, all the configuration Makefiles (in those directories) are now given a `.conf' suffix. This is also assumed for all the files that are loaded. The configuration (software building) and running of the template have been checked with this change from scratch, but please report any error that may not have been noticed. THIS IS AN IMPORTANT CHANGE AND WILL CAUSE CRASHES OR UNEXPECTED BEHAVIORS FOR PROJECTS THAT HAVE BRANCHED FROM THIS TEMPLATE. PLEASE CORRECT THE SUFFIX OF ALL YOUR PROJECT'S CONFIGURATION MAKEFILES (IN THE DIRECTORIES ABOVE), OTHERWISE THEY AREN'T AUTOMATICALLY LOADED ANYMORE. --- reproduce/software/make/basic.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index 343b3b0..93dcdc2 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -34,9 +34,9 @@ # Top level environment include reproduce/software/make/build-rules.mk -include reproduce/software/config/installation/LOCAL.mk -include reproduce/software/config/installation/versions.mk -include reproduce/software/config/installation/checksums.mk +include reproduce/software/config/installation/LOCAL.conf +include reproduce/software/config/installation/versions.conf +include reproduce/software/config/installation/checksums.conf lockdir = $(BDIR)/locks tdir = $(BDIR)/software/tarballs -- cgit v1.2.1 From efa5baf0fd68f4ba178a0a4f0bb59ccfbecaf7e7 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Wed, 22 Jan 2020 14:31:50 +0000 Subject: Perl is now a dependency of Coreutils, LD_LIBRARY_PATH in basic.mk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Until now Perl was built after Coreutils, but I recently noticed that Coreutils actually uses Perl while creating its manpages. So it is now built before Coreutils. Also, while testing on an Amazon AWS EC2 server, we noticed that Coreutils can't build its man page for `md5sum'. The problem was found to be due to the fact that until now, we weren't actually setting LD_LIBRARY_PATH to our installed library path in `basic.mk'. Therefore, it would crash because the server had an older version of OpenSSL than the one that the template's Coreutils was built with. In the meantime (while addressing the issues above, because we only had one thread on the AWS server) I also noticed a few programs that were using a summarize compilation command (that just prints `CC xxx.c' instead of the whole command) so I fixed them by adding `V=1'. This bug was found by Idafen Santana PĂ©rez. --- reproduce/software/make/basic.mk | 145 +++++++++++++++++++++------------------ 1 file changed, 79 insertions(+), 66 deletions(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index 93dcdc2..48ba3de 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -58,7 +58,15 @@ export PKG_CONFIG_PATH := $(ildir)/pkgconfig export PKG_CONFIG_LIBDIR := $(ildir)/pkgconfig export CPPFLAGS := -I$(idir)/include $(CPPFLAGS) export LDFLAGS := $(rpath_command) -L$(ildir) $(LDFLAGS) -export LD_LIBRARY_PATH := $(shell echo $(LD_LIBRARY_PATH) \ + +# This is the "basic" tools where we are relying on the host operating +# system, but are slowly populating our basic software envirnoment. To run +# (system or template) programs, `LD_LIBRARY_PATH' is necessary, so here, +# we'll first tell the programs to look into any possible pre-defined +# `LD_LIBRARY_PATH', then we'll add our own newly installed libraries. We +# will also make sure that there is no "current directory" in it (by +# removing a starting or trailing `:' and any occurance of `::'. +export LD_LIBRARY_PATH := $(shell echo $(LD_LIBRARY_PATH):$(ildir) \ | sed -e's/::/:/g' -e's/^://' -e's/:$$//') # RPATH is automatically written in macOS, so `DYLD_LIBRARY_PATH' is @@ -658,6 +666,66 @@ $(ibidir)/bash: $(ibidir)/readline \ +# The `-shared' flag will cause problems while building Perl on macOS, so +# we'll only use this configuration option when we are GNU/Linux +# systems. However, since the whole option must be used (which includes `=' +# and empty space), its easier to define the variable as a Make variable +# outside the recipe, not as a shell variable inside it. +ifeq ($(on_mac_os),yes) +perl-conflddlflags = +else +perl-conflddlflags = -Dlddlflags="-shared $$LDFLAGS" +endif +$(ibidir)/perl: | $(ibidir)/bash \ + $(tdir)/perl-$(perl-version).tar.gz + major_version=$$(echo $(perl-version) \ + | sed -e's/\./ /g' \ + | awk '{printf("%d", $$1)}'); \ + base_version=$$(echo $(perl-version) \ + | sed -e's/\./ /g' \ + | awk '{printf("%d.%d", $$1, $$2)}'); \ + cd $(ddir) \ + && rm -rf perl-$(perl-version) \ + && if ! tar xf $(word 1,$(filter $(tdir)/%,$|)); then \ + echo; echo "Tar error"; exit 1; \ + fi \ + && cd perl-$(perl-version) \ + && sed -e's|\#\! /bin/sh|\#\! $(ibdir)/bash|' \ + -e's|\#\!/bin/sh|\#\! $(ibdir)/bash|' \ + Configure > Configure-tmp \ + && mv -f Configure-tmp Configure \ + && chmod +x Configure \ + && ./Configure -des \ + -Dusethreads \ + -Duseshrplib \ + -Dprefix=$(idir) \ + -Dvendorprefix=$(idir) \ + -Dprivlib=$(idir)/share/perl$$major_version/core_perl \ + -Darchlib=$(idir)/lib/perl$$major_version/$$base_version/core_perl \ + -Dsitelib=$(idir)/share/perl$$major_version/site_perl \ + -Dsitearch=$(idir)/lib/perl$$major_version/$$basever/site_perl \ + -Dvendorlib=$(idir)/share/perl$$major_version/vendor_perl \ + -Dvendorarch=$(idir)/lib/perl$$major_version/$$base_version/vendor_perl \ + -Dscriptdir=$(idir)/bin/core_perl \ + -Dsitescript=$(idir)/bin/site_perl \ + -Dvendorscript=$(idir)/bin/vendor_perl \ + -Dinc_version_list=none \ + -Dman1ext=1perl \ + -Dman3ext=3perl \ + -Dcccdlflags='-fPIC' \ + $(perl-conflddlflags) \ + -Dldflags="$$LDFLAGS" \ + && make SHELL=$(ibdir)/bash -j$(numthreads) \ + && make SHELL=$(ibdir)/bash install \ + && cd .. \ + && rm -rf perl-$(perl-version) \ + && cd $$topdir \ + && echo "Perl $(perl-version)" > $@ + + + + + # Coreutils # --------- # @@ -677,8 +745,10 @@ $(ibidir)/bash: $(ibidir)/readline \ # The echo after the PatchELF loop is to avoid a crash if the last # file that PatchELF encounters is not usable (and it returns with # an error). +# +# Coreutils uses Perl to create man pages! $(ibidir)/coreutils: $(ibidir)/openssl \ - | $(ibidir)/bash \ + | $(ibidir)/perl \ $(tdir)/coreutils-$(coreutils-version).tar.xz cd $(ddir) \ && rm -rf coreutils-$(coreutils-version) \ @@ -847,17 +917,17 @@ $(ibidir)/wget: $(ibidir)/libiconv \ # there is no access to the system's PATH. $(ibidir)/diffutils: | $(ibidir)/coreutils \ $(tdir)/diffutils-$(diffutils-version).tar.xz - $(call gbuild, diffutils-$(diffutils-version), static, , V=1) \ + $(call gbuild, diffutils-$(diffutils-version), static,,V=1) \ && echo "GNU Diffutils $(diffutils-version)" > $@ $(ibidir)/file: | $(ibidir)/coreutils \ $(tdir)/file-$(file-version).tar.gz - $(call gbuild, file-$(file-version), static) \ + $(call gbuild, file-$(file-version), static,,V=1) \ && echo "File $(file-version)" > $@ $(ibidir)/findutils: | $(ibidir)/coreutils \ $(tdir)/findutils-$(findutils-version).tar.xz - $(call gbuild, findutils-$(findutils-version), static, , V=1) \ + $(call gbuild, findutils-$(findutils-version), static,,V=1) \ && echo "GNU Findutils $(findutils-version)" > $@ $(ibidir)/gawk: $(ibidir)/gmp \ @@ -910,13 +980,13 @@ $(ibidir)/gmp: | $(ibidir)/m4 \ $(ibidir)/glibtool: | $(ibidir)/m4 \ $(tdir)/libtool-$(libtool-version).tar.xz $(call gbuild, libtool-$(libtool-version), static, \ - --program-prefix=g) \ + --program-prefix=g, V=1) \ && ln -s $(ibdir)/glibtoolize $(ibdir)/libtoolize \ && echo "GNU Libtool $(libtool-version)" > $@ $(ibidir)/grep: | $(ibidir)/coreutils \ $(tdir)/grep-$(grep-version).tar.xz - $(call gbuild, grep-$(grep-version), static) \ + $(call gbuild, grep-$(grep-version), static,,V=1) \ && echo "GNU Grep $(grep-version)" > $@ $(ibidir)/libbsd: | $(ibidir)/coreutils \ @@ -927,7 +997,7 @@ $(ibidir)/libbsd: | $(ibidir)/coreutils \ $(ibidir)/m4: | $(ibidir)/coreutils \ $(ibidir)/texinfo \ $(tdir)/m4-$(m4-version).tar.gz - $(call gbuild, m4-$(m4-version), static) \ + $(call gbuild, m4-$(m4-version), static,,V=1) \ && echo "GNU M4 $(m4-version)" > $@ # Metastore is used (through a Git hook) to restore the source modification @@ -1020,63 +1090,6 @@ $(ibidir)/mpfr: $(ibidir)/gmp \ $(call gbuild, mpfr-$(mpfr-version), static, , , make check) \ && echo "GNU Multiple Precision Floating-Point Reliably $(mpfr-version)" > $@ -# The `-shared' flag will cause problems while building Perl on macOS, so -# we'll only use this configuration option when we are GNU/Linux -# systems. However, since the whole option must be used (which includes `=' -# and empty space), its easier to define the variable as a Make variable -# outside the recipe, not as a shell variable inside it. -ifeq ($(on_mac_os),yes) -perl-conflddlflags = -else -perl-conflddlflags = -Dlddlflags="-shared $$LDFLAGS" -endif -$(ibidir)/perl: | $(ibidir)/coreutils \ - $(tdir)/perl-$(perl-version).tar.gz - major_version=$$(echo $(perl-version) \ - | sed -e's/\./ /g' \ - | awk '{printf("%d", $$1)}'); \ - base_version=$$(echo $(perl-version) \ - | sed -e's/\./ /g' \ - | awk '{printf("%d.%d", $$1, $$2)}'); \ - cd $(ddir) \ - && rm -rf perl-$(perl-version) \ - && if ! tar xf $(word 1,$(filter $(tdir)/%,$|)); then \ - echo; echo "Tar error"; exit 1; \ - fi \ - && cd perl-$(perl-version) \ - && sed -e's|\#\! /bin/sh|\#\! $(ibdir)/bash|' \ - -e's|\#\!/bin/sh|\#\! $(ibdir)/bash|' \ - Configure > Configure-tmp \ - && mv -f Configure-tmp Configure \ - && chmod +x Configure \ - && ./Configure -des \ - -Dusethreads \ - -Duseshrplib \ - -Dprefix=$(idir) \ - -Dvendorprefix=$(idir) \ - -Dprivlib=$(idir)/share/perl$$major_version/core_perl \ - -Darchlib=$(idir)/lib/perl$$major_version/$$base_version/core_perl \ - -Dsitelib=$(idir)/share/perl$$major_version/site_perl \ - -Dsitearch=$(idir)/lib/perl$$major_version/$$basever/site_perl \ - -Dvendorlib=$(idir)/share/perl$$major_version/vendor_perl \ - -Dvendorarch=$(idir)/lib/perl$$major_version/$$base_version/vendor_perl \ - -Dscriptdir=$(idir)/bin/core_perl \ - -Dsitescript=$(idir)/bin/site_perl \ - -Dvendorscript=$(idir)/bin/vendor_perl \ - -Dinc_version_list=none \ - -Dman1ext=1perl \ - -Dman3ext=3perl \ - -Dcccdlflags='-fPIC' \ - $(perl-conflddlflags) \ - -Dldflags="$$LDFLAGS" \ - && make SHELL=$(ibdir)/bash -j$(numthreads) \ - && make SHELL=$(ibdir)/bash install \ - && cd .. \ - && rm -rf perl-$(perl-version) \ - && cd $$topdir \ - && echo "Perl $(perl-version)" > $@ - - $(ibidir)/pkg-config: | $(ibidir)/coreutils \ $(tdir)/pkg-config-$(pkgconfig-version).tar.gz # An existing `libiconv' can cause a conflict with `pkg-config', @@ -1101,7 +1114,7 @@ $(ibidir)/pkg-config: | $(ibidir)/coreutils \ $(ibidir)/sed: | $(ibidir)/coreutils \ $(tdir)/sed-$(sed-version).tar.xz - $(call gbuild, sed-$(sed-version), static) \ + $(call gbuild, sed-$(sed-version), static,,V=1) \ && echo "GNU Sed $(sed-version)" > $@ $(ibidir)/texinfo: | $(ibidir)/perl \ -- cgit v1.2.1 From f37005b729065f0e4ff6bfa99e5410ebb210cd60 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Mon, 27 Jan 2020 15:15:40 +0000 Subject: Initial scripts compatible with Dash (minimalistic POSIX) Until now, the initial project scripts were primarily tested with GNU Bash. But Bash is not generally available on all systems (it has many features beyond POSIX). Because of this, effectively we were imposing the requirement on the user that they must have Bash installed. We recently started this with setting the shebang of `project' and `reproduce/software/bash/configure.sh' to `/bin/sh'. After doing so, Raul and Gaspar reported an error on their systems. To fix the problem, I installed Dash (a minimalist POSIX-compliant shell) on my computer and temporarily set the shebangs to `/bin/dash', ran the project configuration step and fixed all issues that came up. With this commit, it can go all the way to building GCC on my system's Dash. After this stage (when `high-level.mk' is called), there is no problem, because we have our own version of GNU Bash and that installed version is used. Probably some more issues still remain and will hopefully be found in the future. While doing this, I also noticed the following two minor issues: - The `./project configure' option `--input-dir' was not recognized because it was mistakenly checking `--inputdir'. It has been corrected. - The test C programs now use the `< Date: Sat, 1 Feb 2020 21:24:00 +0100 Subject: IMPORTANT: reproduce/software/bash renamed to reproduce/software/shell Until now the shell scripts in the software building phase were in the `reproduce/software/bash' directory. But given our recent change to a POSIX-only start, the `configure.sh' shell script (which is the main component of this directory) is no longer written with Bash. With this commit, to fix that problem, that directory's name has been changed to `reproduce/software/shell'. --- reproduce/software/make/basic.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index 7e900b8..d08ba62 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -74,9 +74,9 @@ export LD_LIBRARY_PATH := $(shell echo $(LD_LIBRARY_PATH):$(ildir) \ # causes crashs (see bug #56682). So we'll just give it no value at all. export DYLD_LIBRARY_PATH := -# Recipe startup script, see `reproduce/software/bash/bashrc.sh'. +# Recipe startup script. export PROJECT_STATUS := configure_basic -export BASH_ENV := $(shell pwd)/reproduce/software/bash/bashrc.sh +export BASH_ENV := $(shell pwd)/reproduce/software/shell/bashrc.sh # Define the top-level basic programs (that don't depend on any other). top-level-programs = low-level-links gcc @@ -1067,7 +1067,7 @@ $(ibidir)/metastore: $(needlibbsd) \ -e's|@GROUP[@]|'$$group'|g' \ -e's|@BINDIR[@]|$(ibdir)|g' \ -e's|@TOP_PROJECT_DIR[@]|'$$current_dir'|g' \ - reproduce/software/bash/git-$$f > .git/hooks/$$f \ + reproduce/software/shell/git-$$f > .git/hooks/$$f \ && chmod +x .git/hooks/$$f; \ done; \ fi \ -- cgit v1.2.1 From 6d68865a5d083b8892c3f4854284bb2036f1efdf Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Tue, 11 Feb 2020 00:38:11 +0100 Subject: Using backup server when original download server fails Until now, the main download script could only check one server for the given URL. However, ultimately the actual server that a file is downloaded from is irrelevant for this project: we actually check its checksum. Especially in the case of software (which are distributed over many servers), this can usually be very annoying: the servers may not properly communicate with the running system and even the 10 trials won't be enough. With this commit, the download script `reproduce/analysis/bash/download-multi-try' can take a new optional argument (a 5th argument). It assumes this argument is a space-separated list of server(s) to use as backup for the original URL. When downloading from the original URL fails, it will look into this list and try downloading the same file from each given server. --- reproduce/software/make/basic.mk | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index d08ba62..2cad9f9 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -82,6 +82,10 @@ export BASH_ENV := $(shell pwd)/reproduce/software/shell/bashrc.sh top-level-programs = low-level-links gcc 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 @@ -236,15 +240,19 @@ $(tarballs): $(tdir)/%: | $(lockdir) \ touch $(lockdir)/download; \ $(downloadwrapper) "$$downloader" $(lockdir)/download \ - $$tarballurl "$@.unchecked"; \ + $$tarballurl "$@.unchecked" "$(backupservers)"; \ fi; \ \ \ if type sha512sum > /dev/null 2>/dev/null; then \ checksum=$$(sha512sum "$@.unchecked" | awk '{print $$1}'); \ - echo "$*: should be '$$c', is '$$checksum'"; \ - if [ x$$checksum = x$$c ]; then mv "$@.unchecked" "$@"; \ - else echo "ERROR: Non-matching checksum for '$*'."; exit 1; \ + if [ x"$$checksum" = x"$$c" ]; then \ + mv "$@.unchecked" "$@"; \ + else \ + echo "ERROR: Non-matching checksum for '$*'."; \ + echo "Checksum should be: $$c"; \ + echo "Checksum is: $$checksum"; \ + exit 1; \ fi; \ else mv "$@.unchecked" "$@"; \ fi; -- cgit v1.2.1 From 5baaa500439481514ca173db650f7b45e4994b54 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Thu, 13 Feb 2020 17:42:10 +0000 Subject: Adding a link to the *crt*.o files in the local install directory Until now, we defined `LIBRARY_PATH' to fix the problem of the `ld' linker of Binutils needing several `*crt*.o' files to run. However, some software (for example ImageMagick) over-write `LIBRARY_PATH', therefore there is no other way than to put a link to these necessary files in our local build directory. With this commit, we fixed the problem by putting a link to the system's relevant files in the local library directory. This fixed the problem with ImageMagick. Later, when we build the GNU C Library in the project, we should remove this step. This bug reported by Raul Castellanos Sanchez. --- reproduce/software/make/basic.mk | 17 ++++++++++++++++- 1 file changed, 16 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 2cad9f9..d8afccd 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -1182,6 +1182,15 @@ endif # programs (http://savannah.nongnu.org/bugs/?56294). Therefore, we'll set # all other basic programs as Binutils prerequisite and GCC (the final # basic target) ultimately just depends on Binutils. +# +# The `ld' linker of Binutils needs several `*crt*.o' file to run. On some +# systems these object files aren't installed in standard places. We +# defined `LIBRARY_PATH' and that fixed the problem for many +# systems. However, some software (for example ImageMagick) over-write +# `LIBRARY_PATH', therefore there is no other way than to put a link to +# these necessary files in our local build directory. IMPORTANT NOTE: +# later, when we build the GNU C Library in the project, we should remove +# this step. $(ibidir)/binutils: | $(ibidir)/sed \ $(ibidir)/wget \ $(ibidir)/grep \ @@ -1203,11 +1212,17 @@ $(ibidir)/binutils: | $(ibidir)/sed \ $(call makelink,nm); \ $(call makelink,ps); \ $(call makelink,ranlib); \ - echo "" > $@; \ + echo "" > $@; \ else \ $(call gbuild, binutils-$(binutils-version), static, \ --with-lib-path=$(sys_library_path), \ -j$(numthreads) ) \ + && if ! [ x"$(sys_library_path)" = x ]; then \ + for f in $(sys_library_path)/*crt*.o; do \ + b=$$($(ibdir)/basename $$f); \ + ln -s $$f $(ildir)/$$b; \ + done; \ + fi \ && echo "GNU Binutils $(binutils-version)" > $@; \ fi -- cgit v1.2.1 From 1c77635ff9cbf10adadbc11a90851f635de323af Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Thu, 13 Feb 2020 17:50:24 +0000 Subject: Corrected version of Texinfo when reporting Until now we were mistakenly reporting the version of SED instead of Texinfo. With this commit, we corrected it! This was reported by Raul Infante Sainz. --- reproduce/software/make/basic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index d8afccd..4a290b6 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -1132,7 +1132,7 @@ $(ibidir)/texinfo: | $(ibidir)/perl \ $(ibdir)/patchelf --set-rpath $(ildir) $(ibdir)/info; \ $(ibdir)/patchelf --set-rpath $(ildir) $(ibdir)/install-info; \ fi \ - && echo "GNU Texinfo $(sed-version)" > $@ + && echo "GNU Texinfo $(texinfo-version)" > $@ $(ibidir)/which: | $(ibidir)/coreutils \ $(tdir)/which-$(which-version).tar.gz -- cgit v1.2.1 From 6dcfac476fdb8334fc682304e12a5db6f21b3a22 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Wed, 19 Feb 2020 03:38:51 +0000 Subject: Building of GCC now only done when /dev/shm has more than 10GB free Until now, like all software on GNU/Linux systems GCC would be built in RAM (to speed up the build slightly and also not put too much stress on the HDDs/SSDs). But some systems don't have enough RAM for building GCC and will complain and crash. With this commit, we have added a check on the amount of free space in the `build_tmp' directory (which will be `/dev/shm' on GNU/Linux systems). If the amount of free space isn't more than 10GB, then GCC won't be built there and a temporary directory will be built under the `$(BDIR)/software' directory for it. This bug was found by Zahra Sharbaf. This fixes bug #57853. --- reproduce/software/make/basic.mk | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'reproduce/software/make/basic.mk') diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index 4a290b6..212c738 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -1261,15 +1261,27 @@ $(ibidir)/gcc: | $(ibidir)/binutils \ ccinfo=$$(gcc --version | awk 'NR==1'); \ echo "C compiler (""$$ccinfo"")" > $@; \ else \ + current_dir=$$(pwd); \ rm -f $(ibdir)/gcc* $(ibdir)/g++ $(ibdir)/gfortran $(ibdir)/gcov*;\ rm -rf $(ildir)/gcc $(ildir)/libcc* $(ildir)/libgcc*; \ rm -rf $(ildir)/libgfortran* $(ildir)/libstdc* rm $(idir)/x86_64*;\ \ ln -fs $(ildir) $(idir)/lib64; \ - \ - cd $(ddir); \ + \ + in_ram=$$(df $(ddir) \ + | awk 'NR==2{print ($$4>10000000) ? "yes" : "no"}'); \ + if [ $$in_ram = "yes" ]; then odir=$(ddir); \ + else \ + odir=$(BDIR)/software/build-tmp-gcc; \ + if [ -d $$odir ]; then rm -rf $$odir; fi; \ + mkdir $$odir; \ + fi; \ + cd $$odir; \ rm -rf gcc-$(gcc-version); \ - tar xf $(word 1,$(filter $(tdir)/%,$|)) \ + tar xf $(word 1,$(filter $(tdir)/%,$|)); \ + if [ $$odir != $(ddir) ]; then \ + ln -s $$odir/gcc-$(gcc-version) $(ddir)/gcc-$(gcc-version); \ + fi \ && cd gcc-$(gcc-version) \ && mkdir build \ && cd build \ @@ -1296,7 +1308,7 @@ $(ibidir)/gcc: | $(ibidir)/binutils \ && make SHELL=$(ibdir)/bash -j$(numthreads) \ && make SHELL=$(ibdir)/bash install \ && cd ../.. \ - && tempname=$(ddir)/gcc-$(gcc-version)/build/rpath-temp-copy \ + && tempname=$$odir/gcc-$(gcc-version)/build/rpath-temp-copy \ && if [ "x$(on_mac_os)" != xyes ]; then \ patchelf --add-needed $(ildir)/libiconv.so $(ildir)/libstdc++.so; \ for f in $$(find $(idir)/libexec/gcc) $(ildir)/libstdc++*; do \ @@ -1309,6 +1321,11 @@ $(ibidir)/gcc: | $(ibidir)/binutils \ done; \ fi \ && rm -rf gcc-$(gcc-version) \ + && cd $$current_dir \ + && if [ "$$odir" != "$(ddir)" ]; then \ + rm -rf $$odir; \ + rm $(ddir)/gcc-$(gcc-version); \ + fi \ && ln -sf $(ibdir)/gcc $(ibdir)/cc \ && echo "GNU Compiler Collection (GCC) $(gcc-version)" > $@; \ fi -- cgit v1.2.1