diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2024-08-22 13:56:21 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2024-08-31 10:45:48 +0200 |
| commit | 2c51202a2a803853cf9844c6169087628d098955 (patch) | |
| tree | dbdf88059a03a8b19418287476cf421ce314a421 /gnu | |
| parent | 7cedba32486677ecace9fab3194917719b7438be (diff) | |
gnu: make-bootstrap: Ensure libm.a provides ‘fmod’ on i686.
Fixes <https://issues.guix.gnu.org/72725>.
* gnu/packages/make-bootstrap.scm (glibc-for-bootstrap)[arguments]: Add
‘apply-libm-patch’ on i686.
* gnu/packages/patches/glibc-2.39-fmod-libm-a.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
Reported-by: Ricardo Wurmus <rekado@elephly.net>
Change-Id: Iaffba0a9f424d8d80a8a5611df2d285d7d632d99
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/local.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/make-bootstrap.scm | 13 | ||||
| -rw-r--r-- | gnu/packages/patches/glibc-2.39-fmod-libm-a.patch | 98 |
3 files changed, 111 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 4998db682c0..0c4ab96bf36 100644 --- a/gnu/local.mk +++ b/gnu/local.mk | |||
| @@ -1394,6 +1394,7 @@ dist_patch_DATA = \ | |||
| 1394 | %D%/packages/patches/glib-skip-failing-test.patch \ | 1394 | %D%/packages/patches/glib-skip-failing-test.patch \ |
| 1395 | %D%/packages/patches/glibc-2.33-riscv64-miscompilation.patch \ | 1395 | %D%/packages/patches/glibc-2.33-riscv64-miscompilation.patch \ |
| 1396 | %D%/packages/patches/glibc-2.39-git-updates.patch \ | 1396 | %D%/packages/patches/glibc-2.39-git-updates.patch \ |
| 1397 | %D%/packages/patches/glibc-2.39-fmod-libm-a.patch \ | ||
| 1397 | %D%/packages/patches/glibc-CVE-2019-7309.patch \ | 1398 | %D%/packages/patches/glibc-CVE-2019-7309.patch \ |
| 1398 | %D%/packages/patches/glibc-CVE-2019-9169.patch \ | 1399 | %D%/packages/patches/glibc-CVE-2019-9169.patch \ |
| 1399 | %D%/packages/patches/glibc-CVE-2019-19126.patch \ | 1400 | %D%/packages/patches/glibc-CVE-2019-19126.patch \ |
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index 679aa46d605..91796efd0f2 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm | |||
| @@ -85,7 +85,18 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." | |||
| 85 | ;; and can use statically-linked NSS modules. | 85 | ;; and can use statically-linked NSS modules. |
| 86 | `(cons* "--disable-nscd" "--disable-build-nscd" | 86 | `(cons* "--disable-nscd" "--disable-build-nscd" |
| 87 | "--enable-static-nss" | 87 | "--enable-static-nss" |
| 88 | ,flags)))) | 88 | ,flags)) |
| 89 | ((#:phases phases #~%standard-phases) | ||
| 90 | ;; Apply i686-linux-specific patch. | ||
| 91 | (if (target-x86-32?) | ||
| 92 | #~(modify-phases #$phases | ||
| 93 | (add-after 'unpack 'apply-libm-patch | ||
| 94 | (lambda _ | ||
| 95 | (define patch | ||
| 96 | #$(local-file | ||
| 97 | (search-patch "glibc-2.39-fmod-libm-a.patch"))) | ||
| 98 | (invoke "patch" "--force" "-p1" "-i" patch)))) | ||
| 99 | phases)))) | ||
| 89 | 100 | ||
| 90 | ;; Remove the 'debug' output to allow bit-reproducible builds (when the | 101 | ;; Remove the 'debug' output to allow bit-reproducible builds (when the |
| 91 | ;; 'debug' output is used, ELF files end up with a .gnu_debuglink, which | 102 | ;; 'debug' output is used, ELF files end up with a .gnu_debuglink, which |
diff --git a/gnu/packages/patches/glibc-2.39-fmod-libm-a.patch b/gnu/packages/patches/glibc-2.39-fmod-libm-a.patch new file mode 100644 index 00000000000..91b1871beee --- /dev/null +++ b/gnu/packages/patches/glibc-2.39-fmod-libm-a.patch | |||
| @@ -0,0 +1,98 @@ | |||
| 1 | Fixes lack of 'fmod' in libm.a on i686-linux: | ||
| 2 | |||
| 3 | https://sourceware.org/bugzilla/show_bug.cgi?id=31488 | ||
| 4 | https://issues.guix.gnu.org/72725 | ||
| 5 | |||
| 6 | commit 0b716305dfb48c2d13ed4f7d06c082b90c1d226f | ||
| 7 | Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> | ||
| 8 | Date: Thu Mar 14 14:59:35 2024 -0300 | ||
| 9 | |||
| 10 | math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488) | ||
| 11 | |||
| 12 | diff --git a/sysdeps/i386/fpu/w_fmod_compat.c b/sysdeps/i386/fpu/w_fmod_compat.c | ||
| 13 | index 5ac9995ffd..528bfc2a13 100644 | ||
| 14 | --- a/sysdeps/i386/fpu/w_fmod_compat.c | ||
| 15 | +++ b/sysdeps/i386/fpu/w_fmod_compat.c | ||
| 16 | @@ -7,8 +7,9 @@ | ||
| 17 | # define LIBM_SVID_COMPAT 1 | ||
| 18 | # undef compat_symbol | ||
| 19 | # define compat_symbol(a, b, c, d) | ||
| 20 | -#endif | ||
| 21 | -#include <math/w_fmod_compat.c> | ||
| 22 | -#ifdef SHARED | ||
| 23 | +# include <math/w_fmod_compat.c> | ||
| 24 | libm_alias_double (__fmod_compat, fmod) | ||
| 25 | +#else | ||
| 26 | +#include <math-type-macros-double.h> | ||
| 27 | +#include <w_fmod_template.c> | ||
| 28 | #endif | ||
| 29 | diff --git a/sysdeps/i386/fpu/w_fmodf_compat.c b/sysdeps/i386/fpu/w_fmodf_compat.c | ||
| 30 | index cc417e07d3..5a61693e51 100644 | ||
| 31 | --- a/sysdeps/i386/fpu/w_fmodf_compat.c | ||
| 32 | +++ b/sysdeps/i386/fpu/w_fmodf_compat.c | ||
| 33 | @@ -7,8 +7,9 @@ | ||
| 34 | # define LIBM_SVID_COMPAT 1 | ||
| 35 | # undef compat_symbol | ||
| 36 | # define compat_symbol(a, b, c, d) | ||
| 37 | -#endif | ||
| 38 | -#include <math/w_fmodf_compat.c> | ||
| 39 | -#ifdef SHARED | ||
| 40 | +# include <math/w_fmodf_compat.c> | ||
| 41 | libm_alias_float (__fmod_compat, fmod) | ||
| 42 | +#else | ||
| 43 | +#include <math-type-macros-float.h> | ||
| 44 | +#include <w_fmod_template.c> | ||
| 45 | #endif | ||
| 46 | diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c | ||
| 47 | index 1afbe7d8ad..932cc4341c 100644 | ||
| 48 | --- a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c | ||
| 49 | +++ b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c | ||
| 50 | @@ -17,13 +17,13 @@ | ||
| 51 | License along with the GNU C Library; if not, see | ||
| 52 | <https://www.gnu.org/licenses/>. */ | ||
| 53 | |||
| 54 | -#if IS_IN (libc) | ||
| 55 | +#if IS_IN (libc) && defined SHARED | ||
| 56 | # define declare_mgen_alias(f,t) | ||
| 57 | #endif | ||
| 58 | #include <math-type-macros-ldouble.h> | ||
| 59 | #include <s_ldexp_template.c> | ||
| 60 | |||
| 61 | -#if IS_IN (libc) | ||
| 62 | +#if IS_IN (libc) && defined SHARED | ||
| 63 | long_double_symbol (libc, __ldexpl, ldexpl); | ||
| 64 | long_double_symbol (libc, __wrap_scalbnl, scalbnl); | ||
| 65 | #endif | ||
| 66 | diff --git a/sysdeps/m68k/m680x0/fpu/w_fmod_compat.c b/sysdeps/m68k/m680x0/fpu/w_fmod_compat.c | ||
| 67 | index 527d4fbed2..57f38091e6 100644 | ||
| 68 | --- a/sysdeps/m68k/m680x0/fpu/w_fmod_compat.c | ||
| 69 | +++ b/sysdeps/m68k/m680x0/fpu/w_fmod_compat.c | ||
| 70 | @@ -7,8 +7,9 @@ | ||
| 71 | # define LIBM_SVID_COMPAT 1 | ||
| 72 | # undef compat_symbol | ||
| 73 | # define compat_symbol(a, b, c, d) | ||
| 74 | -#endif | ||
| 75 | #include <math/w_fmod_compat.c> | ||
| 76 | -#ifdef SHARED | ||
| 77 | libm_alias_double (__fmod_compat, fmod) | ||
| 78 | +#else | ||
| 79 | +#include <math-type-macros-double.h> | ||
| 80 | +#include <w_fmod_template.c> | ||
| 81 | #endif | ||
| 82 | diff --git a/sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c b/sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c | ||
| 83 | index 5043586b91..88db07f443 100644 | ||
| 84 | --- a/sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c | ||
| 85 | +++ b/sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c | ||
| 86 | @@ -7,8 +7,9 @@ | ||
| 87 | # define LIBM_SVID_COMPAT 1 | ||
| 88 | # undef compat_symbol | ||
| 89 | # define compat_symbol(a, b, c, d) | ||
| 90 | -#endif | ||
| 91 | -#include <math/w_fmodf_compat.c> | ||
| 92 | -#ifdef SHARED | ||
| 93 | +# include <math/w_fmodf_compat.c> | ||
| 94 | libm_alias_float (__fmod_compat, fmod) | ||
| 95 | +#else | ||
| 96 | +#include <math-type-macros-float.h> | ||
| 97 | +#include <w_fmod_template.c> | ||
| 98 | #endif | ||
