This recursive package definition really demonstrates how magical Guix
can be :-)
Try invoking:
./pre-inst-env guix build mingw-w64-{x86_64,i686}{,-winpthreads}
* gnu/packages/mingw.scm (make-mingw-w64): Add XGCC, XBINUTILS optional
arguments to specify using a non-default cross-compiler/binutils. Add
WITH-WINPTHREADS? optional argument to allow building with winpthreads
support. Adjust accordingly for the new arguments.
(mingw-w64-i686-winpthreads, mingw-w64-x86_64-winpthreads): Add
variables.
* gnu/packages/cross-base.scm (native-libc): Add XGCC, XBINUTILS
key arugments and pass to MAKE-MINGW-W64.
(cross-libc): Pass XGCC and XBINUTILS to NATIVE-LIBC.
This resurrects
./pre-inst-env guix build --target=i686-unknown-linux-gnu hello
* gnu/packages/cross-base.scm (cross-gcc-arguments): Do not build libmpx;
does not cross-configure.
* gnu/packages/patches/gcc-7-cross-mingw.patch: New file.
* gnu/packages/cross-base.scm (cross-gcc-patches): Add XGCC parameter; update
caller. Use it for target mingw and gcc >= 7.
* gnu/local.mk (dist_patch_DATA): Add it.
This patch parameterizes previously hard-coded instances of
i686-w64-mingw32, adding support for x86_64-w64-mingw32.
* gnu/packages/mingw.scm (make-mingw-w64): New procedure.
(mingw-w64-i686, mingw-w64-x86_64): New variables.
(%mingw-triplet): Remove.
(mingw-w64): Update to point to 'mingw-w64-i686'.
* gnu/packages/cross-base.scm (cross-gcc): Use 'libc' keyword argument
if specified, instead of treating it as a boolean.
(native-libc): Return the correct mingw-w64 depending on machine
specified in target.
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Add "x86_64-mingw".
* gnu/build/cross-toolchain.scm (set-cross-path/mingw): Replace
hardcoded 'i686-w64-mingw32' instances with 'target' keyword argument.
(cross-gcc-build-phases): Update accordingly; use 'target-mingw?'
implementation of target checking and add commentary.
* gnu/ci.scm (%cross-targets): Add "x86_64-w64-mingw32".
This makes sure it is inherited by packages using (cross-gcc ...). This
commit is a followup to 01e8263feb.
* gnu/build/cross-toolchain.scm (cross-gcc-build-phases): Move
'treat-glibc-as-system-header' phase ...
* gnu/packages/cross-base.scm (cross-gcc-arguments): ... here.
* gnu/packages/cross-base.scm (%gcc-cross-include-paths): Remove
CROSS_C_INCLUDE_PATH & co in favor of CROSS_CPATH.
* gnu/build/cross-toolchain.scm (%gcc-cross-include-paths): Likewise.
(cross-gcc-build-phases): Set CROSS_C_INCLUDE_PATH and
CROSS_CPLUS_INCLUDE_PATH when building the cross GCC.
* gnu/packages/commencement.scm (libstdc++): Add
"--disable-libstdcxx-dual-abi" to #:configure-flags.
(gcc-boot0)[arguments]: Add "--disable-libmpx"
to #:configure-flags.
(gcc-final): Add phase to set C_INCLUDE_PATH and CPLUS_INCLUDE_PATH before
building GCC.
(gcc-toolchain-5): Use MAKE-GCC-TOOLCHAIN.
(gcc-toolchain-7): Change to GCC-TOOLCHAIN.
* gnu/packages/gcc.scm (gcc): Change from GCC-5 to GCC-7.
(gfortran): Change to GFORTRAN-7.
(gcc-objc): Change to GCC-OBJC-7.
(gcc-objc++): Change to GCC-OBJC++-7.
* gnu/packages/rust.scm (rust-1.19.0)[native-search-paths]: Change from
C_INCLUDE_PATH & co to CPATH.
This patch is missing from glibc 2.28 and is needed to support
/proc/self lookup when using the Hurd's procfs, which in turn is needed
for our 'guile-relocatable.patch'.
See <https://lists.gnu.org/archive/html/bug-hurd/2018-12/msg00024.html>.
* gnu/packages/patches/glibc-hurd-magic-pid.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/base.scm (glibc)[arguments]: Add 'apply-hurd-patch'
phase.
[native-inputs]: Add "hurd-magic-pid-patch" input.
* gnu/packages/cross-base.scm (cross-libc)[arguments]: Duplicate
'apply-hurd-patch' phase.
Version 2.28 of glibc is the first in a long time that fully supports
GNU/Hurd. This change updates the Hurd and Mach to provide the features
glibc 2.28 expects and adjusts the cross-compilation tool chain for
"i586-pc-gnu".
* gnu/packages/base.scm (glibc/linux): Rename to...
(glibc): ... this.
[propagated-inputs]: Add 'hurd-target?' case.
[arguments]: Use '--disable-werror' when 'hurd-target?'. Add
'augment-libc.so' phase when 'hurd-target?'.
[native-inputs]: Add MIG and PERL when 'hurd-target?'.
(glibc/hurd, glibc-for-target): Remove
(glibc/hurd-headers): Inherit from GLIBC, not GLIBC/HURD.
[arguments]: Remove "--enable-obsolete-rpc" configure flag and
'patch-configure-script' phase.
* gnu/packages/cross-base.scm (cross-kernel-headers)[xglibc/hurd-headers]:
Move 'set-cross-headers-path' after 'unpack'.
* gnu/packages/cross-base.scm (cross-libc)[cross-libc-for-target]:
Remove.
Pass "--disable-werror" when TARGET matches 'hurd-triplet?'.
* gnu/packages/hurd.scm (hurd-target?, patch-url): New procedures.
(gnumach-headers)[source](patches, modules, snippet): New fields.
(hurd-headers): Use Git commit 98b3390.
[native-inputs]: Add AUTOCONF and AUTOMAKE.
[arguments]: Add "ac_cv_func_*" configure flags.
(hurd-minimal)[native-inputs]: Remove.
[arguments]: In 'build' phase, build "include/assert-backtrace.h"
first.
This shrinks glibc:out from 37 MiB to 29 MiB.
* gnu/packages/base.scm (glibc/linux)[outputs]: Add "static".
[arguments]: Add #:modules. Add 'move-static-libs' phase.
* gnu/packages/commencement.scm (static-bash-for-glibc): Augment
#:configure-flags to pass "-L LIBC:STATIC". Add the "static" output of
GLIBC-FINAL to 'inputs'.
(%boot2-inputs, %final-inputs): Likewise.
(canonical-package): Adjust to deal with multiple-output packages.
* gnu/packages/cross-base.scm (cross-gcc): Add the "static" output of
LIBC to 'native-inputs'.
Previously:
./pre-inst-env guile -c '(use-modules (gnu packages gcc))'
would fail due to circular dependencies.
* gnu/packages/cross-base.scm (%xgcc): Turn into a macro.
This is a followup to commit 7b3318e34f.
* gnu/packages/make-bootstrap.scm (package-with-relocatable-glibc)
[native-inputs]: Fix 'cross-gcc' call.
* gnu/packages/cross-base.scm: Fix example 'cross-gcc' call in a comment.
* gnu/packages/linux.scm (system->defconfig): New procedure.
(linux-libre-headers)[arguments]: Use it in 'build' phase to determine
the target name.
* gnu/packages/cross-base.scm (cross-kernel-headers)[xlinux-headers]
(arguments): Likewise.
* gnu/packages/cross-base.scm (cross-gcc-arguments) <#:phases>: Use
'cross-gcc-build-phases', and move body cross-toolchain.scm.
(cross-gcc): Add #:imported-modules. Add (gnu build cross-toolchain) to
#:modules.
* gnu/build/cross-toolchain.scm: New file, with code from
'cross-gcc-arguments'.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/cross-base.scm (cross-libc): Replace literal list of
environment variable names with %GCC-CROSS-INCLUDE-PATHS.
(cross-kernel-headers): Likewise.
* guix/utils.scm (mingw-target?): New function.
* gnu/packages/cross-base.scm (cross-gcc-snippet): New procedure
(cross-gcc): Use it.
(cross-gcc-arguments, cross-gcc-patches, cross-gcc): Support MinGW.
(native-libc, cross-newlib?): New functions.
(cross-libc): Use cross-newlib? to support MinGW.
(%gcc-include-paths, %gcc-cross-include-paths): New variables.
They were never really needed and caused troubles in the presence of
circular module dependencies as reported by
Danny Milosavljevic <dannym@scratchpost.org> at
<https://lists.gnu.org/archive/html/guix-devel/2016-11/msg00144.html>.
* gnu/packages/cross-base.scm (xgcc-mips64el, xgcc-xtensa, xgcc-armhf):
Remove.
* gnu/packages/firmware.scm (ath9k-htc-firmware)[native-inputs]: Use
'cross-gcc' instead of XGCC-XTENSA.
Due to circular dependencies, referring to bindings exported by other
modules from the top level is frowned upon. This patch addresses one of
the remaining cases.
* gnu/packages/base.scm (%final-inputs): New procedure.
* gnu/packages/cross-base.scm: Remove (gnu packages commencement) import.
(cross-gcc): Use the new '%final-inputs'.
* gnu/packages/make-bootstrap.scm: Remove (gnu packages commencement) import.
(package-with-relocatable-glibc): Use the new '%final-inputs'.
Reported by Mark H Weaver <mhw@netris.org>
Partly fixes <http://bugs.gnu.org/24832>.
'ld-wrapper-boot0' was evaluating strictly instead of lazily, leading to
invalid system types.
* gnu/packages/base.scm (make-ld-wrapper): Turn #:target into a
one-argument procedure. Honor it.
* gnu/packages/commencement.scm (ld-wrapper-boot0): Fix 'name' argument
to 'make-ld-wrapper'. Make #:target argument a procedure.
* gnu/packages/cross-base.scm (cross-gcc): Adjust #:target argument.
* gnu/packages/cross-base.scm (cross-kernel-headers): Add new variable.
Add xgnumach-headers, xmig, xhurd-headers, xglibc/hurd-headers,
xhurd-minimal, xhurd-core-headers.
(cross-libc): Add cross-libc-for-target.
[arguments]: Set "CROSS_LIBRARY_PATH".
[propagated-inputs]: Use "cross-kernel-headers" to determine the correct headers.
[native-inputs]: Use "cross-mig" when target is GNU/Hurd.
* gnu/packages/cross-base.scm (cross-gcc-arguments)[arguments]: Add
"--disable-libitm", "--disable-libvtv" and "--disable-libsanitizer"
when libc is not present.
We now have a dedicated package module for the AVR toolchain with
important modifications on top of what cross-gcc produces.
* gnu/packages/cross-base.scm (xgcc-avr): Delete.
* gnu/packages/patches/gcc-cross-environment-variables.patch: Also use CROSS_
variants: CROSS_C_INCLUDE_PATH, CROSS_CPLUS_INCLUDE_PATH,
CROSS_OBJC_INCLUDE_PATH, CROSS_OBJCPLUS_INCLUDE_PATH to be used for system
libraries, see
https://lists.gnu.org/archive/html/guix-devel/2016-04/msg00620.html.
* gnu/packages/cross-base.scm (cross-gcc, cross-gcc-arguments, cross-libc):
Use CROSS_*_INCLUDE_PATH (WAS: CPATH).
Signed-off-by: Ludovic Courtès <ludo@gnu.org>