With the introduction of GCC 14 as the default compiler, compilation of
libstdc++ of all previous versions would fail due to a different
signature for ‘__cxa_call_terminate’ (a builtin in GCC 14). This fixes it.
* gnu/packages/patches/gcc-libstdc++-newer-gcc.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/gcc.scm (gcc-7, gcc-8, gcc-9, gcc-10)
(gcc-11, gcc-12, gcc-13): Use it.
Change-Id: I84dc26e46d56259d7d610f19b0521fa9c5499d5e
After the "hack" introduced for <https://issues.guix.gnu.org/42392>, all GCCs
are built with the current GCC's libstdc++ headers. This results in subtly
broken C++ headers in older versions, which aren't necessarily compatible with
libstdc++s from other versions.
For example, this test case works with GCC 11:
$ guix shell --container --emulate-fhs --pure -e '(@ (gnu packages gcc) gcc)' binutils -- sh -c 'echo -e "#include <cmath>\nint main() { return std::isnan(0); }" | g++ -x c++ -; echo $?'
0
but fails with GCC 9:
$ guix shell --container --emulate-fhs --pure -e '(@ (gnu packages gcc) gcc-9)' binutils -- sh -c 'echo -e "#include <cmath>\nint main() { return std::isnan(0); }" | g++ -x c++ -; echo $?'
In file included from /gnu/store/gkh2rljdrnj24q1q7baa6bhb119251w4-profile/include/c++/cmath:45,
from <stdin>:1:
<stdin>: In function 'int main()':
<stdin>:2:26: error: '__builtin_isnan' is not a member of 'std'; did you mean '__builtin_isnan'?
<built-in>: note: '__builtin_isnan' declared here
1
This specific error can be traced back to the GCC build, where GCC 10 and 11
are configured with:
checking for ISO C99 support in <math.h> for C++11... yes
but GCC 9 is configured with:
checking for ISO C99 support in <math.h> for C++11... no
The configure check fails due to errors like these due to the mismatched
libstdc++:
configure:17817: checking for ISO C99 support in <math.h> for C++11
[…]
In file included from /gnu/store/y3kk0ybf7hqwndl8xpm61r4a5b3lhwix-libstdc++-11.4.0/include/cmath:41,
from /gnu/store/y3kk0ybf7hqwndl8xpm61r4a5b3lhwix-libstdc++-11.4.0/include/math.h:36,
from conftest.cpp:41:
/gnu/store/y3kk0ybf7hqwndl8xpm61r4a5b3lhwix-libstdc++-11.4.0/include/bits/c++config.h:491:18: error: missing binary operator before token "("
491 | #if __has_builtin(__builtin_is_constant_evaluated)
| ^
Updating libstdc++ to reference each GCC works around this.
* gnu/packages/gcc.scm (libstdc++, libstdc++-headers): Remove variables.
(make-libstdc++-headers): New procedure.
(gcc-6)[native-inputs]: Use it with `this-package'.
Change-Id: Ie05878c83860c4ccc29d66b916d11613e367e142
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Modified-by: Ludovic Courtès <ludo@gnu.org>
These prefixes must have a trailing slash. When this slash is
omitted, gcc fails to find ?crt*.o files when LIBRARY_PATH is not set.
Fixes#75483, see <https://issues.guix.gnu.org/75483>.
* gnu/packages/gcc.scm (gcc-4.7): Fix replaced startfile prefix.
[arguments]: <#:phases>: Fix it.
Change-Id: I1988e0bf98b0002e83e0c0233310d05b72644ac9
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* gnu/packages/gcc.scm (gcc): Define as gcc-14 for all.
(libgccjit): Define as libgccjit-14.
* gnu/packages/commencement.scm (gcc-toolchain): Define as gcc-toolchain-14
for all.
* gnu/packages/gcc.scm
Change-Id: Iaac983da8acbbb2fd1088a0469d6115b7d424dbb
* gnu/packages/gcc.scm (make-libstdc++)[arguments]: Rename stage "patch-hurd64
to "patch-tzdb.cc and use for gcc >= 14 unrestrictedly.
Change-Id: Icaf0a31744dc6102d96444f531f3ba1878a61b6c
* gnu/packages/gcc.scm (isl)[arguments]: When target is loongarch64, Add
update-config-scripts phase.
[native-inputs]: When target is loongarch64, Add config.
Change-Id: If60b28f64dd3285f5b89000c42e714be07876400
This enables building packages in a 64bit childhurd. It will not enable
offloading to a childhurd.
* guix/utils.scm (host-hurd?, host-x86-64, host-hurd64?): New procedures.
* gnu/packages/commencement.scm (gcc-toolchain): Use them to determine if the
host is a 64bit Hurd, and use gcc-toolchain-14.
* gnu/packages/gcc.scm (gcc): Likewise, to use gcc-14.
Change-Id: I55e43fdc61e3ea5fc13065fc7ca854b951c94930
* gnu/packages/gcc.scm (make-libstdc++)[arguments]: When building for the
64bit Hurd, add stage patch-hurd64.
Change-Id: I795a591ef8282ee5b760fec43bd4ad849007f602
Since newer glibc version there is a conflict in names between kernel
module and glibc module. This uses a patch that was used upstream in
llvm to bypass it. Without this, the build fails with a redefinition
error.
* gnu/packages/gcc.scm (gcc-9)[source]: Add
‘gcc-7-libsanitizer-fsconfig-command.patch’.
Change-Id: Ibb8446b7bba52f72d82fcf69804cae09215daeed
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* gnu/packages/gcc.scm (%gcc-14-x86_64-micro-architectures): New
variable.
(gcc-14)[properties]: Use it.
Change-Id: I00f9e2a4c9d590f97977275b157002ac330b895b
Since iberty is a static library, linking a PIC-enabled target to it
requires it to also have been built with PIC. (The target is Dyninst
in this case.)
This `-fPIC' flag is appended to the default CFLAGS of `-O2 -g'.
* gnu/packages/gcc.scm (make-libiberty)[arguments]:
Adjust make-flags to add -fPIC to CFLAGS.
Change-Id: I155045d05f4434cb68be933a95b7bc9fdec98818
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This header is wanted by Dyninst.
* gnu/packages/gcc.scm (make-libiberty):
Add include/demangle.h to install phase.
Change-Id: I01235071b75b412f55785d240cda248315b7a93e
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Fixes a regression introduced in
bfeccd3db9 and caught by
‘tests/packages.scm’, whereby two equivalent but not ‘eq?’ libgccjit@11
packages would be exported.
* gnu/packages/gcc.scm (libgccjit): Make an alias for ‘libgccjit-11’.
Change-Id: I9aeacb7588af5f78af0941e80715665572567958
* gnu/packages/patches/gcc-7-libsanitizer-fsconfig-command.patch: New
file.
* gnu/packages/gcc.scm (gcc-7)[source]: Use it.
* gnu/local.mk (dist_patch_DATA): Add it.
Change-Id: Ifa273b92573281c34d83e5fb8cd68734ef02c7fd
Until now users would have to cargo cult or inspect the private
%default-modules variable of (guix build-systems gnu) to discover which
modules to include when extending the used modules via the #:modules argument.
The renaming was automated via the command:
$ git grep -l %gnu-build-system-modules
| xargs sed 's/%gnu-build-system-modules/%default-gnu-imported-modules/' -i
* guix/build-system/gnu.scm (%gnu-build-system-modules): Rename to...
(%default-gnu-imported-modules): ... this.
(%default-modules): Rename to...
(%default-gnu-modules): ... this. Export.
(dist-package, gnu-build, gnu-cross-build): Adjust accordingly.
Change-Id: Idef307fff13cb76f3182d782b26e1cd3a5c757ee
* gnu/packages/patches/gcc-13.2.0-libstdc++-docbook-xsl-uri.patch: New file.
* gnu/packages/patches/gcc-13.2.0-libstdc++-info-install-fix.patch: Ditto.
* gnu/packages/patches/gcc-5.5.0-libstdc++-xmlcatalog.patch: Ditto.
* gnu/local.mk: Register them.
* gnu/packages/gcc.scm
(gcc-5)[source]: Use gcc-5.5.0-libstdc++-xmlcatalog.patch,
gcc-13.2.0-libstdc++-docbook-xsl-uri.patch and
gcc-13.2.0-libstdc++-info-install-fix.patch.
(gcc-9)[source]: Use gcc-13.2.0-libstdc++-docbook-xsl-uri.patch and
gcc-13.2.0-libstdc++-info-install-fix.patch.
(make-libstdc++-doc)[arguments]<#:phases>: Remove 'set-xsl-directory.
Adjust 'build and 'install for info documentation and to respect make-flags.
[native-inputs]: Add docbook2x.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Change-Id: Ie3b9de0328a10efadb28d211c3fe03f9b7aaf87f
* gnu/packages/gcc.scm (gcc-13)[arguments]: When building for i586-gnu
delete the inherited phase 'patch-hurd-libpthread as it exists upstream.
Change-Id: I0837dcff325b15b6975b34dbd7268faaa223ecdd
* gnu/packages/gcc.scm (make-gccgo)[arguments]: When building gccgo-12
for riscv64-linux don't add a phase to adjust the order of libgo
dependencies.
Change-Id: I600c744ce33ad802a5c466c19df41dcbb29a2be0
Previously the phase would fail when cross-compiling because the patch
could not be found in ‘inputs’.
* gnu/packages/gcc.scm (make-libstdc++): Add alternative ‘patch-powerpc’
phase for when (%current-target-system) is true.
Change-Id: Ia503d761d34596d95cc9d33edd911cebcc2e0d9e