aboutsummaryrefslogtreecommitdiff
path: root/reproduce/software/make/basic.mk
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2022-08-05 20:27:56 +0200
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2022-08-13 22:36:13 +0200
commit79ee52ed1e136fbd2592a5c2a058f73024d8b5b0 (patch)
tree7bb96bf392f45a73cbfe56de75a840ccdfbeb0bd /reproduce/software/make/basic.mk
parentaf723d9c5b36b7b5580d1a00ca9fbe8778237e7c (diff)
IMPORTANT: Software update
SUMMARY: This is a software update to make Maneage more portable and up to date. It does not involve any Maneage infrastructure changes. You should just re-build your project to make sure the updated software haven't removed/changed any of their features that you were using. In particular, for Astrometry.net users, please see the respective note in P.S.2 below. Until now, there have been many updates in the software that are built within Maneage. The last software upadte was almost one year ago. With this commit, the software in the P.S.1 have been updated. A description of notable changes in the software environment is given in P.S.2. This software environment has been tested on an Arch GNU/Linux, Debian, CentOS-7 and macOS. This commit is the merging of 24 individual commits by Raul Infante-Sainz (who put a lot of energy on porting the software below for macOS, and updating citations), Boudewijn Roukema (who helped with memory checking for GCC, and testing on Debian and CentOS), Sepideh Eskandarlou (who tested the environment) and myself. Besides the updates in the core software, the followimg improvements have also been implemented in this commit: - When you run './project shell': - A welcome message is printed that will remind the caller that they have entered a new environment, it will print the location of 'HOME' and the location of the shell startup file. - The 'reproduce/software/shell/bashrc.sh' is loaded as a startup file. This allows you to customize your interactive Maneage shell. A default step has already been placed there that will put the git branch name (in green) within the shell prompt (which was purple). This greatly helps when dealing with directories under Git version control. These settings won't bother with Maneage's default operations: through environment variables we make sure that these './project shell' features will not slow-down the calls to the shell within the non-interactive Make calls. - The host's 'COLORTERM' is passed to the Maneage environment. It is used by some programs that can have color outputs on the terminal. - Updates to citations: - Numpy and Scipy (as requested on their pages): https://numpy.org/citing-numpy and https://scipy.org/citing-scipy - Gnuastro: Added https://arxiv.org/abs/1909.11230 which describes major updates to Gnuastro after 10 releases. - When a software's paper is indexed in the SAO/NASA Astrophysics Data System (ADS), Maneage now use the BibTeX entries provided by ADS. This helps to give a unified format to most software, and more information (like ADS+arXiv hyperlinks in the BibLaTeX compilation of the default bibliography). - We were able to build this version of Maneage on a Debian system from 2010 (+12 years ago!). Only three downgrades were necessary in the "basic" software (not affecting the high-level science software!). A description of the necessary downgrades for such old systems has been added in 'README.md'. P.S.1 List of updated software: Basic software: cURL 7.79.1 --> 7.84.0 Dash 0.5.11.5 --> 0.5.11-057cd65 File 5.41 --> 5.42 GNU AWK 5.1.0 --> 5.1.1 GNU Bash 5.1.8 --> 5.2-rc2 GNU Binutils 2.37 --> 2.39 GNU Compiler Collection (GCC) 11.2.1 --> 12.1.0 GNU Findutils 4.8.0 --> 4.9.0 GNU Gzip 1.11 --> 1.12 GNU Help2man 1.48.5 --> 1.49.2 GNU Integer Set Library (ISL) 0.18 --> 0.24 GNU Libtool 2.4.6 --> 2.4.7 GNU Nano 6.0 --> 6.4 GNU Readline 8.1.1 --> 8.2-rc2 GNU libiconv 0.16 --> 0.17 Git 2.36.0 --> 2.37.1 OpenSSL 3.0.0 --> 3.0.5 PatchELF 0.13 --> 0.15.0 Perl 5.34.0 --> 5.36.0 High-level software: Astrometry.net 0.89 --> 0.91 CFITSIO 4.0.0 --> 4.1.0 CMake 3.21.4 --> 3.24.0 GNU Astronomy Utilities (Gnuastro) 0.16.1 --> 0.18 GPL Ghostscript 9.55.0 --> 9.56.1 HDF5 1.10.5 --> 1.13.1 Libjpeg 9d --> 9e Libtiff 4.3.0 --> 4.4.0 OpenBLAS 0.3.18 --> 0.3.21 PLplot n/a --> 5.15.0 Python 3.10.0 --> 3.10.6 SCAMP 2.6.7 --> 2.10.0 SWarp 2.38.0 --> 2.41.5 Util-Linux 2.37.2 --> 2.38.1 Vim 8.2 --> 9.0 WCSLIB 7.7 --> 7.11 X.org packages (used by graphical software like Ghostscript and LaTeX): Fontconfig 2.13.94 --> 2.14.0 LibX11 1.7.2 --> 1.8 LibXCB 1.14 --> 1.15 XCB-proto 1.14.1 --> 1.15 Xorg-proto 2021.5 --> 2022.1 Python modules: Astropy 5.0 --> 5.1 GalSim 2.3.3 --> 2.3.5 P.S.2: Notable points regarding the software environment: - Two new links from the host's low-level tools are now included in Maneage's build environment: - On GNU/Linux systems, the host's 'ldd' is linked inside the custom environment. This belongs to the GNU C Library (which is not yet installed in Maneage). But helps in checking the linking status of the binaries on GNU/Linux systems. - On macOS: the 'codesign' binary is included, which is used by GNU Emacs on macOS to sign the built executable. - GNU Bison has been moved in basic software (necessary for GNU Binutils). - The Zip and Unzip programs have been moved as high-level software that have to be manually requested when necessary. This is because they are not used by any of the basic software anymore. They were just installed as dependencies of GNU Tar to be close the other compression programs. Also, in the past we would use the original tarballs, and some (for example Numpy) were distributed in Zip format. However, by default, we now use a custom Lzip tarball and don't need Zip or Unzip. This was suggested by Zahra Sharbaf and Raul Infante-Sainz. - Some minor edits in 'reproduce/software/shell/tarball-prepare.sh'. In particular the 'awk' command was effectively just replacing a '_' with '-', so it just uses a simple SED expression instead. - Fixed bug 62700 (https://savannah.nongnu.org/bugs/index.php?62700) by compiling 'xz' with a patched version of the xz source file 'src/liblzma/liblzma.map'. - Astrometry.net doesn't depend on NetPBM any more. NetPBM (and its dependencies) were causing many crashes on macOS and it also a very strange build system that is hard to maintain. Astrometry.net uses it to take images as input. However, it isn't necessary when you provide Astrometry.net with a catalog. Therefore, Raul added some instructions on how to run astrometry from your own custom X-Y catalog. These instruction can be seen on top of the build rule of Astrometry.net in 'reproduce/software/make/high-level.mk'. - h5py has been removed as a dependency of Astropy. It is an optional dependency to write tables into HDF5 format. But since we couldn't get it to build on macOS it has been removed. None of the current Maneage users/developers also use this feature of Astropy! - PLplot is added a new software, but not a default pre-requisite of SCAMP (which can use it to generate figures), because there were many build problems on macOS. Instructions have been added on top of SCAMP on how to add PLplot as a dependency. - With the aim of being able to install Plplot on macOS, we have wrote several lines to fix header problems. However, we didn't succeed. In any case we are leaving these lines in case they are useful in the future. - The '-Wno-nullability-completeness' compiler flag (which is primarily necessary for macOS) is now only added for macOS systems. It was causing many warnings of un-recognized option in GNU/Linux systems. - The 'mkswap' program of Util-Linux has been disabled because it caused crashes on older kernels. Generally, its not necessary for a Maneage project because it needs root permissions to run! - LibXT (of the x.org software) has been added as a dependency of Cairo. - ImageMagick and Lzip were using the host's C++ standard library! But on GNU/Linux we build our own C++ Standard Library with GCC, so with this commit, they properly link with Maneage's C++ standard library. - ImageMagick on macOS couldn't properly link with Maneage's Ghostscript library! This has been fixed using macOS's install_name_tool. - Necessary RAM to build GCC on GNU/Linux systems changed to ~8GB, see https://savannah.nongnu.org/task/?16244#comment12 - Pythran is no longer as prerequisite of Scipy. Until now, Pythran was a prerequisite of Scipy. But we noticed that it is optional and was causing problems on macOS. - The URLs of some of the software have been updated in 'reproduce/software/config/urls.conf'. By default, these are all commented, but they can be useful when searching for new versions or when a project needs custom software that is not (yet) in Maneage.
Diffstat (limited to 'reproduce/software/make/basic.mk')
-rw-r--r--reproduce/software/make/basic.mk207
1 files changed, 162 insertions, 45 deletions
diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk
index d90d945..14d63cf 100644
--- a/reproduce/software/make/basic.mk
+++ b/reproduce/software/make/basic.mk
@@ -55,6 +55,7 @@ ddir = $(BDIR)/software/build-tmp
idir = $(BDIR)/software/installed
ibdir = $(BDIR)/software/installed/bin
ildir = $(BDIR)/software/installed/lib
+iidir = $(BDIR)/software/installed/include
ibidir = $(BDIR)/software/installed/version-info/proglib
# Ultimate Makefile target. GNU Nano (a simple and very light-weight text
@@ -87,13 +88,18 @@ export SHELL := $(ibdir)/dash
export PATH := $(ibdir):$(PATH)
export PKG_CONFIG_PATH := $(ildir)/pkgconfig
export PKG_CONFIG_LIBDIR := $(ildir)/pkgconfig
-export CPPFLAGS := -I$(idir)/include $(CPPFLAGS) \
- -Wno-nullability-completeness
export LDFLAGS := $(rpath_command) -L$(ildir) $(LDFLAGS)
# Disable built-in rules (which are not needed here!)
.SUFFIXES:
+# See description of '-Wno-nullability-completeness' in
+# 'reproduce/software/shell/configure.sh'.
+ifeq ($(on_mac_os),yes)
+ noccwarnings=-Wno-nullability-completeness
+endif
+export CPPFLAGS := -I$(idir)/include $(CPPFLAGS) $(noccwarnings)
+
# 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,
@@ -202,6 +208,7 @@ $(ibidir)/low-level-links: $(ibidir)/grep-$(grep-version) \
$(call makelink,xcrun)
$(call makelink,sysctl)
$(call makelink,sw_vers)
+ $(call makelink,codesign)
$(call makelink,dsymutil)
$(call makelink,install_name_tool)
@@ -222,6 +229,10 @@ $(ibidir)/low-level-links: $(ibidir)/grep-$(grep-version) \
fi
done
+# Useful tools: 'ldd' (list libraries linked by binary on GNU
+# systems)
+ $(call makelink,ldd)
+
# We want this to be empty (so it doesn't interefere with the other
# files in 'ibidir'.
touch $@
@@ -252,10 +263,46 @@ $(ibidir)/gzip-$(gzip-version): | $(ibdir) $(ildir) $(lockdir)
$(call gbuild, gzip-$(gzip-version), static, , V=1)
echo "GNU Gzip $(gzip-version)" > $@
+# 2022-07-14 B Roukema
+#
+# xz-5.2.5 fails on (at least) CentOS 7 (Redhat) systems while trying
+# to compile 'cmake' in Maneage - this is Maneage bug 62700 [1].
+#
+# The fix appears to be just a few lines, although it's not clear
+# how robust or long-term it is. Since we don't yet have 'patch' in
+# 'basic.mk', this file has to be copied into place rather than patched.
+
+# xz-5.2.5_src_liblzma_liblzma.map is a patched
+# version of xz-5.2.5/src/liblzma/liblzma.map based on discussion at
+# [1] + [2] + the patch file [3].
+#
+# [1] https://savannah.nongnu.org/bugs/index.php?62700
+# [2] https://github.com/easybuilders/easybuild-easyconfigs/issues/14991
+# [3] https://raw.githubusercontent.com/easybuilders/easybuild-easyconfigs/bcebb3320ffb63f9804ca8d4d64d1822ec7c9792/easybuild/easyconfigs/x/XZ/XZ-5.2.5_compat-libs.patch
$(ibidir)/xz-$(xz-version): $(ibidir)/gzip-$(gzip-version)
+
+# Prepare the tarball.
tarball=xz-$(xz-version).tar.lz
$(call import-source, $(xz-url), $(xz-checksum))
- $(call gbuild, xz-$(xz-version), static)
+
+# Until the bug mentioned above is fixed, we'll can't use the generic
+# rule.
+# $(call gbuild, xz-$(xz-version), static)
+
+# Configure and build with patched file.
+ srcdir=$$(pwd)
+ unpackdir=xz-$(xz-version)
+ patchedfile=xz-5.2.5_src_liblzma_liblzma.map
+ cd $(ddir)
+ rm -rf $$unpackdir
+ tar -x -f $(tdir)/$$tarball
+ cd $$unpackdir
+ cp -pv $$srcdir/reproduce/software/patches/$$patchedfile \
+ src/liblzma/liblzma.map # copy the fixed file into place
+ ./configure --prefix=$(idir)
+ make install
+ cd ..
+ rm -rf $$unpackdir
echo "XZ Utils $(xz-version)" > $@
$(ibidir)/bzip2-$(bzip2-version): $(ibidir)/gzip-$(gzip-version)
@@ -303,26 +350,6 @@ $(ibidir)/bzip2-$(bzip2-version): $(ibidir)/gzip-$(gzip-version)
ln -fs libbz2.so.$(bzip2-version) libbz2.so
echo "Bzip2 $(bzip2-version)" > $@
-$(ibidir)/unzip-$(unzip-version): $(ibidir)/gzip-$(gzip-version)
- tarball=unzip-$(unzip-version).tar.lz
- $(call import-source, $(unzip-url), $(unzip-checksum))
- $(call gbuild, unzip-$(unzip-version), static,, \
- -f unix/Makefile generic \
- CFLAGS="-DBIG_MEM -DMMAP",,pwd, \
- -f unix/Makefile generic \
- BINDIR=$(ibdir) MANDIR=$(idir)/man/man1 )
- echo "Unzip $(unzip-version)" > $@
-
-$(ibidir)/zip-$(zip-version): $(ibidir)/gzip-$(gzip-version)
- tarball=zip-$(zip-version).tar.lz
- $(call import-source, $(zip-url), $(zip-checksum))
- $(call gbuild, zip-$(zip-version), static,, \
- -f unix/Makefile generic \
- CFLAGS="-DBIG_MEM -DMMAP",,pwd, \
- -f unix/Makefile generic \
- BINDIR=$(ibdir) MANDIR=$(idir)/man/man1 )
- echo "Zip $(zip-version)" > $@
-
# Some programs (like Wget and CMake) that use zlib need it to be dynamic
# so they use our custom build. So we won't force a static-only build.
#
@@ -341,11 +368,9 @@ $(ibidir)/zlib-$(zlib-version): $(ibidir)/gzip-$(gzip-version)
# software to be built).
$(ibidir)/tar-$(tar-version): \
$(ibidir)/xz-$(xz-version) \
- $(ibidir)/zip-$(zip-version) \
$(ibidir)/gzip-$(gzip-version) \
$(ibidir)/zlib-$(zlib-version) \
- $(ibidir)/bzip2-$(bzip2-version) \
- $(ibidir)/unzip-$(unzip-version)
+ $(ibidir)/bzip2-$(bzip2-version)
# Since all later programs depend on Tar, the configuration will hit
# a bottleneck here: only making Tar. So its more efficient to built
@@ -629,7 +654,7 @@ $(ibidir)/perl-$(perl-version): $(ibidir)/patchelf-$(patchelf-version)
-Dcccdlflags='-fPIC' \
$(perl-conflddlflags) \
-Dldflags="$$LDFLAGS"
- make -j$(numthreads)
+ make -j$(numthreads) V=1
make install
cd ..
rm -rf perl-$(perl-version)
@@ -807,6 +832,8 @@ $(ibidir)/curl-$(curl-version): $(ibidir)/coreutils-$(coreutils-version)
--without-librtmp \
--without-libidn2 \
--without-wolfssl \
+ --without-nghttp2 \
+ --without-nghttp3 \
--without-brotli \
--without-gnutls \
--without-cyassl \
@@ -814,6 +841,7 @@ $(ibidir)/curl-$(curl-version): $(ibidir)/coreutils-$(coreutils-version)
--without-axtls \
--disable-ldaps \
--disable-ldap \
+ --without-zstd \
--without-nss, V=1)
if [ -f $(ibdir)/patchelf ]; then
@@ -875,6 +903,12 @@ $(ibidir)/wget-$(wget-version): \
# process of the higher-level programs and libraries. Note that during the
# building of those higher-level programs (after this Makefile finishes),
# there is no access to the system's PATH.
+$(ibidir)/bison-$(bison-version): $(ibidir)/help2man-$(help2man-version)
+ tarball=bison-$(bison-version).tar.lz
+ $(call import-source, $(bison-url), $(bison-checksum))
+ $(call gbuild, bison-$(bison-version), static, ,V=1 -j$(numthreads))
+ echo "GNU Bison $(bison-version)" > $@
+
$(ibidir)/diffutils-$(diffutils-version): \
$(ibidir)/coreutils-$(coreutils-version)
tarball=diffutils-$(diffutils-version).tar.lz
@@ -928,6 +962,13 @@ $(ibidir)/gawk-$(gawk-version): \
# Build final target.
echo "GNU AWK $(gawk-version)" > $@
+$(ibidir)/help2man-$(help2man-version): \
+ $(ibidir)/coreutils-$(coreutils-version)
+ tarball=help2man-$(help2man-version).tar.lz
+ $(call import-source, $(help2man-url), $(help2man-checksum))
+ $(call gbuild, help2man-$(help2man-version), static, ,V=1)
+ echo "Help2man $(Help2man-version)" > $@
+
$(ibidir)/libiconv-$(libiconv-version): \
$(ibidir)/pkg-config-$(pkgconfig-version)
tarball=libiconv-$(libiconv-version).tar.lz
@@ -1070,6 +1111,17 @@ $(ibidir)/sed-$(sed-version): $(ibidir)/coreutils-$(coreutils-version)
$(ibidir)/texinfo-$(texinfo-version): \
$(ibidir)/perl-$(perl-version) \
$(ibidir)/gettext-$(gettext-version)
+
+# Setting for the XS sub-package. "This is because in theory, the XS
+# module could be built with a different compiler to the rest of the
+# project, needing completely different flags" (part of [1])
+#
+# [1] https://lists.gnu.org/archive/html/bug-texinfo/2022-08/msg00068.html
+ export PERL="$(ibdir)/perl"
+ export PERL_EXT_LDFLAGS="-L$(ildir)"
+ export PERL_EXT_CPPFLAGS="-I$(iidir)"
+
+# Basic build commands.
tarball=texinfo-$(texinfo-version).tar.lz
$(call import-source, $(texinfo-url), $(texinfo-checksum))
$(call gbuild, texinfo-$(texinfo-version), static)
@@ -1136,6 +1188,7 @@ $(ibidir)/binutils-$(binutils-version): \
$(ibidir)/gawk-$(gawk-version) \
$(ibidir)/grep-$(grep-version) \
$(ibidir)/wget-$(wget-version) \
+ $(ibidir)/bison-$(bison-version) \
$(ibidir)/which-$(which-version) \
$(ibidir)/libtool-$(libtool-version) \
$(ibidir)/texinfo-$(texinfo-version) \
@@ -1164,7 +1217,7 @@ $(ibidir)/binutils-$(binutils-version): \
# Build binutils with the standard 'gbuild' function.
$(call gbuild, binutils-$(binutils-version), static, \
--with-lib-path=$(sys_library_path), \
- -j$(numthreads) )
+ -j$(numthreads) V=1)
# The 'ld' linker of Binutils needs several '*crt*.o' files from
# the host's GNU C Library to run. On some systems these object
@@ -1287,20 +1340,35 @@ $(ibidir)/gcc-$(gcc-version): $(ibidir)/binutils-$(binutils-version)
current_dir=$$(pwd)
# By default 'ddir' (where GCC is decompressed and built) is in the
-# RAM (on systems that support '/dev/shm'). This is done to avoid
-# building so many small/temporary files and possibly harming the
-# hard-drive or SSD. But if the RAM doesn't have enough space, we
-# should use the hard-drive or SSD. During its build GCC's build
-# directory will become about 7GB (multiple of 1024 bytes, for GCC
-# 11.2.0). So at this step, we are making sure we have more than
-# 7.5GiB (multiple of 1000 bytes, which corresponds to 7.32GB)
-# before GCC starts to build. Note that the 4th column of 'df' is
-# the "available" space at the time of running, not the full
-# space. So the background RAM that the OS will be using during
-# Maneage is accounted for. Also consider that GCC is built alone
-# (no other Maneage software is built at the same time as GCC).
- in_ram=$$(df $(ddir) \
- | awk 'NR==2{print ($$4>7500000) ? "yes" : "no"}'); \
+# RAM (on systems that support a '/dev/shm' RAM disk). This is done
+# to avoid building so many small/temporary files and possibly
+# harming the hard-drive or SSD. But if the RAM doesn't have enough
+# space, we should use the hard-drive or SSD. During its build,
+# GCC's build directory will become about 7GiB (in units of 1024^3
+# bytes, for GCC 12.1.0, which corresponds to 7.5GB, in units of
+# 1000^3 bytes). So at this step, we make sure that we have more
+# than 12GiB before GCC starts to build. See the figure in the link
+# below for GCC's RAM consumption as a function of time:
+#
+# https://savannah.nongnu.org/task/?16244#comment12
+#
+# For POSIX portability and longevity (default sizes might change),
+# we use the '-P' option, and we use the environment variable
+# POSIXLY_CORRECT=1, so the 'block size' is 512 bytes. We'll also
+# allow for about ~0.5 GB at the start.
+#
+# So we need 8 GiB * 1024^3 (B/GiB) / 512 blocks/B = 16777216
+# blocks, in blocks of 512 bytes.
+#
+# The 4th column of 'df' is the "available" space at the time of
+# running, not the full space. So the 'RAM disk' that the OS
+# will be using as "pretend" disk space (e.g. using 'tmpfs'; this
+# is physically RAM, but appears as if it is disk space)
+# during this stage of Maneage is accounted for. GCC is built
+# alone - no other Maneage software is built at the same time as
+# GCC - so this amount of RAM should be enough.
+ in_ram=$$(POSIXLY_CORRECT=1 df -P $(ddir) \
+ | awk 'NR==2{print ($$4>16777216) ? "yes" : "no"}'); \
if [ $$in_ram = "yes" ]; then odir=$(ddir)
else
odir=$(BDIR)/software/build-tmp-gcc-due-to-lack-of-space
@@ -1308,9 +1376,11 @@ $(ibidir)/gcc-$(gcc-version): $(ibidir)/binutils-$(binutils-version)
mkdir $$odir
fi
-# Go into the proper directory, unpack GCC and prepare the 'build'
-# directory inside it for all the built files.
+# Go into the directory to uncompress GCC.
cd $$odir
+
+# Unpack GCC and prepare the 'build' directory inside it for all
+# the built files.
rm -rf gcc-$(gcc-version)
tar -xf $(tdir)/$$tarball
if [ $$odir != $(ddir) ]; then
@@ -1318,6 +1388,34 @@ $(ibidir)/gcc-$(gcc-version): $(ibidir)/binutils-$(binutils-version)
fi
cd gcc-$(gcc-version)
+# Unfortunately binutils installs headers like 'ansidecl.h' that
+# have been seen to conflict with GCC's internal versions of those
+# headers. For example in the 'ansidecl.h' of Binutils 2.39, the
+# 'PTR' macro isn't defined, while the same file in GCC 12.1.0 has
+# defined it. Therefore, without this change, GCC will include the
+# file installed from Binutils, not find what it needs and crash!
+# Therefore, with the 'CPPFLAGS' modification below, we tell GCC to
+# first look into its own 'include' directory before anything else.
+ export CPPFLAGS="-I$$(pwd)/include $(CPPFLAGS)"
+
+# In the GNU C Library 2.36 (which is more recent than GCC 12.1.0),
+# the 'linux/mount.h' (loaded by 'linux/fs.h', which is loaded by
+# 'libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp'
+# in GCC) conflicts with 'sys/mount.h' which is directly loaded by
+# the same file! This is a known conflict in glibc 2.36 (see
+# [1]). As described in [1], one solution is the final job done in
+# [2]. We therefore do this process here: 1) Not loading
+# 'linux/fs.h', and adding the necessary macros directly.
+#
+# [1] https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
+# [2] https://reviews.llvm.org/D129471
+ sed -e's|\#include <linux/fs.h>||' \
+ -e"s|FS_IOC_GETFLAGS;|_IOR('f', 1, long);|" \
+ -e"s|FS_IOC_GETVERSION;|_IOR('v', 1, long);|" \
+ -e"s|FS_IOC_SETFLAGS;|_IOW('f', 2, long);|" \
+ -e"s|FS_IOC_SETVERSION;|_IOW('v', 2, long);|" \
+ -i libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+
# Set the build directory for the processing.
mkdir build
cd build
@@ -1396,6 +1494,25 @@ $(ibidir)/gcc-$(gcc-version): $(ibidir)/binutils-$(binutils-version)
+# Software that need re-compilation (to use our own libraries)
+$(ibidir)/lzip-$(lzip-version): $(ibidir)/gcc-$(gcc-version)
+ tarball=lzip-$(lzip-version).tar
+ unpackdir=lzip-$(lzip-version)
+ cd $(ddir)
+ rm -rf $$unpackdir
+ tar -xf $(tdir)/$$tarball
+ cd $$unpackdir
+ ./configure --build --check --installdir="$(ibdir)"
+ if [ -f $(ibdir)/patchelf ]; then
+ $(ibdir)/patchelf --set-rpath $(ildir) $(ibdir)/lzip;
+ fi
+ cd ..
+ rm -rf $$unpackdir
+ echo "Lzip $(lzip-version)" > $@
+
+
+
+
@@ -1418,7 +1535,7 @@ $(ibidir)/gcc-$(gcc-version): $(ibidir)/binutils-$(binutils-version)
# nano (and use their own optional high-level text editor). To do this, you
# can just have to manually remove 'nano' from 'targets-proglib' above and
# add their optional text editor in 'TARGETS.conf'.
-$(ibidir)/nano-$(nano-version): $(ibidir)/gcc-$(gcc-version)
+$(ibidir)/nano-$(nano-version): $(ibidir)/lzip-$(lzip-version)
tarball=nano-$(nano-version).tar.lz
$(call import-source, $(nano-url), $(nano-checksum))
$(call gbuild, nano-$(nano-version), static)