gnu: gcc-muslboot: Backport c++ builtin values.

* gnu/packages/commencement.scm (gcc-muslboot)[arguments]: Add a custom
phase backporting the correct definitions for __cplusplus.

Change-Id: I64a77dc4d4cb5936e650d37585145f171adc8572
This commit is contained in:
Efraim Flashner 2024-12-17 09:24:12 +02:00
parent 741dc04c0c
commit 96c2dacf44
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -2031,6 +2031,19 @@ (define gcc-muslboot
#$configure-flags)))) #$configure-flags))))
((#:phases phases) ((#:phases phases)
#~(modify-phases #$phases #~(modify-phases #$phases
(add-after 'unpack 'adjust-builtin-cplusplus-variable
(lambda _
;; These values are backported from later releases of GCC.
;; See gcc commit 1fb80b0c5359f696aa61d537e25b7901d8b56ff7.
(substitute* "libcpp/init.c"
(("_cpp_define_builtin \\(pfile, \"__cplusplus 1\"\\);")
(string-append "{
if (CPP_OPTION (pfile, lang) == CLK_CXX0X
|| CPP_OPTION (pfile, lang) == CLK_GNUCXX0X)
_cpp_define_builtin (pfile, \"__cplusplus 201103L\");
else
_cpp_define_builtin (pfile, \"__cplusplus 199711L\");
}")))))
(add-after 'apply-riscv64-patch 'apply-second-riscv64-patch (add-after 'apply-riscv64-patch 'apply-second-riscv64-patch
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let ((patch-file (let ((patch-file