this adds support for riscv and fixes a bug in swab.h, allowing
to build newer kernels - the objtool component is built using
host kernel headers, not the ones available in-tree.
http://isl.gforge.inria.fr was deprecated for some time and is now
down. This patch updates the download location to the new sourceforge
upstream location of the ISL project.
gmp has its own wrapper version of this file and calls the real one
configfsf.sub. within the gcc build, replacing the wrong one is
harmless, but it breaks independent use of the patched gmp tree and
it's logically wrong.
patch by Laurent Bercot.
PWD is set by the shell, not make, and might not match.
For example, this broke the build through Homebrew, because
PWD stays at the directory where brew is ran.
approach in commit 8a92c5230c only
worked for the "current version" of the packages configured with
GCC_VER, etc. now, all versions have proper dependencies so that it's
possible to test applicability of new patches just by running make
with the directory name.
error out if there are any slashes in the name that will later be
passed to rm -rf since these are implicit rules and could
theoretically get instantiated in unintended ways.
As part of creating a CoW source tree, we symlink all top-level paths
from the original directory. In commit ebf93035c, we removed a shell
glob used for this and replaced it with an invocation of `find`.
However, our invocation of `find ... -exec sh -c '... $@ ...' {} \+`
is causing the first path in every directory to be skipped, breaking
the build. This is because arguments to `sh -c ...` begin with the
zeroth argument, while `$@` only returns the first argument onward.
Let's fix this by providing an explicit zeroth argument to `sh -c`.
shell glob of ../$</* fails to catch filenames beginning with dot, and
the easy mitigations for that all produce bad results on non-match.
use find to do it robustly.
this makes it far easier to iterate testing of patches, and sets the
stage for enforcing re-patching with makefile-level dependencies.
the pristine sources are kept in directories suffixed with ".orig",
and the unsuffixed directory now contains the result of running
cowpatch -- that is, a mix of symlinks to the original files, and
modified copies of the files/directories affected by patches.
using slim headers-only version. this change is needed to support all
future versions of musl on 32-bit archs, since prior to 4.16 the
kernel headers had incompatibility with userspace time_t not matching
the kernel's old (32-bit) time_t. support for older headers will be
dropped entirely soon.
as maintained in https://github.com/sabotage-linux/kernel-headers .
downloading (and extracting) a 100+ MB kernel source tarball just for
the headers is extremely inefficient.
sabotage linux' kernel-headers tarball provides the same (including
musl compatibility fixes) in ~800 KB.
in order to use it, specify
LINUX_VER = headers-4.4.2-4
in your config.mak.
if LINUX_VER lacks the "headers-" prefix, the official source tarball
will be downloaded as usual.
the logic for processing the NATIVE var (shortcut for HOST=$(TARGET))
and HOST var took place before inclusion of config.mak, causing NATIVE
not to be honored and wrong BUILD_DIR and OUTPUT defaults to be used
if either was set from config.mak rather than on the make command
line. the current preferred interface is the command line, but the
regression was unintentional.
to fix it, replace the conditional blocks of the makefile with
conditional functions in recursively-expanded variables HOST,
BUILD_DIR, and OUTPUT. this way, assignments to NATIVE or HOST that
take place later in config.mak will affect the resulting values, as
intended.
cross (or native) compilers meant to be run on a host different from
the build environment can now be built by setting the HOST make
variable on the command line or in config.mak. this requires (for
building the target libraries) a cross toolchain for the same TARGET,
but that can run on the build system, to be present already in the
PATH. future enhancements may make it possible to automatically build
and use the needed toolchain.
leaving HOST blank produces a toolchain that runs on the build system
(host==build in gcc jargon), the same as before with NATIVE unset.
the NATIVE make variable is now obsolete but still supported; it
simply causes HOST to be set equal to TARGET (thus producing a native
toolchain for the target).
builds are now placed in build/$(HOST)/$(TARGET) when HOST is set, and
build/local/$(TARGET) when it's not, so that builds for the same
target but different host do not clobber each other.
default OUTPUT directory when HOST is set is now output-$(HOST). as
usual, multiple targets can safely go in the same output directory,
but toolchains for different hosts should not.
based on patch by Michael Forney, but using a plain variable without
without the need for $(call ...). I used a different name for the
variable so that it won't break if anyone has an HTTP_GET variable for
use with the original patch in their config.mak.