From e0c8341b3e4e13778bcde00d477e461ea8e94306 Mon Sep 17 00:00:00 2001 From: Stefan Westerfeld Date: Fri, 22 Apr 2016 18:03:37 +0200 Subject: [PATCH 031/176] RCORE: compile fixes for KUbuntu 16.04/gcc 5.3.1-14ubuntu2 Rapicorn uses isnan(...) and isinf(...) from cmath.h, however on KUbuntu 16.04 it should use std::isnan(...) and std::isinf(...) instead. Patch below. Acked-by: Tim Janik --- rcore/strings.cc | 10 +++++----- rcore/tests/benchrcore.cc | 4 ++-- rcore/tests/strings.cc | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/rcore/strings.cc b/rcore/strings.cc index d5b0216..8b3bc3f 100644 --- a/rcore/strings.cc +++ b/rcore/strings.cc @@ -437,7 +437,7 @@ static long double libc_strtold (const char *nptr, char **endptr) { const long double result = strtold (nptr, endptr); - if (isnan (result) && std::signbit (result) == 0) + if (std::isnan (result) && std::signbit (result) == 0) { const char *p = nptr; while (isspace (*p)) @@ -500,9 +500,9 @@ string_to_double (const char *dblstring, const char **endptr) String string_from_float (float value) { - if (isnan (value)) + if (std::isnan (value)) return std::signbit (value) ? "-NaN" : "+NaN"; - if (isinf (value)) + if (std::isinf (value)) return std::signbit (value) ? "-Infinity" : "+Infinity"; return string_format ("%.7g", value); } @@ -511,9 +511,9 @@ string_from_float (float value) String string_from_double (double value) { - if (isnan (value)) + if (std::isnan (value)) return std::signbit (value) ? "-NaN" : "+NaN"; - if (isinf (value)) + if (std::isinf (value)) return std::signbit (value) ? "-Infinity" : "+Infinity"; return string_format ("%.17g", value); } diff --git a/rcore/tests/benchrcore.cc b/rcore/tests/benchrcore.cc index 3899a08..12fde16 100644 --- a/rcore/tests/benchrcore.cc +++ b/rcore/tests/benchrcore.cc @@ -188,8 +188,8 @@ test_random_numbers() const double rf = random_frange (989617512, 9876547656); TASSERT (rf >= 989617512 && rf < 9876547656); } - TASSERT (isnan (random_frange (NAN, 1))); - TASSERT (isnan (random_frange (0, NAN))); + TASSERT (std::isnan (random_frange (NAN, 1))); + TASSERT (std::isnan (random_frange (0, NAN))); #if 0 // example penalty paid in random_int64() size_t i, j = 0; for (i = 0; i < 100; i++) diff --git a/rcore/tests/strings.cc b/rcore/tests/strings.cc index 468a6e6..dae3e3d 100644 --- a/rcore/tests/strings.cc +++ b/rcore/tests/strings.cc @@ -311,9 +311,9 @@ string_conversions (void) TCMP (string_to_double ("-0.5"), ==, -0.5); double tfloat; tfloat = string_to_double ("+NAN"); - assert (isnan (tfloat) && std::signbit (tfloat) == 0); + assert (std::isnan (tfloat) && std::signbit (tfloat) == 0); tfloat = string_to_double ("-NAN"); - assert (isnan (tfloat) && std::signbit (tfloat) == 1); + assert (std::isnan (tfloat) && std::signbit (tfloat) == 1); TCMP (string_capitalize ("fOO bar"), ==, "Foo Bar"); TCMP (string_capitalize ("foo BAR BAZ", 2), ==, "Foo Bar BAZ"); } -- 2.9.1 with a kernel panic is not a reasonable reaction to loading valid modules on unsupported hardware. The kernel should log an error, which the user is expected to see. Bogus module names will still be fatally reported by linux-modules.drv. * gnu/build/linux-modules.scm (load-linux-module*): Ignore EINVAL errors when operating recursively. Tobias Geerinckx-Rice via Guix-patches via 2020-08-25linux-libre: Support module compression....This commit adds support for GZIP compression for linux-libre kernel modules. The initrd modules are kept uncompressed as the initrd is already compressed as a whole. The linux-libre kernel also supports XZ compression, but as Guix does not have any available bindings for now, and the compression time is far more significant, GZIP seems to be a better option. * gnu/build/linux-modules.scm (modinfo-section-contents): Use 'call-with-gzip-input-port' to read from a module file using '.gz' extension, (strip-extension): new procedure, (dot-ko): adapt to support compression, (ensure-dot-ko): ditto, (file-name->module-name): ditto, (find-module-file): ditto, (load-linux-module*): ditto, (module-name->file-name/guess): ditto, (module-name-lookup): ditto, (write-module-name-database): ditto, (write-module-alias-database): ditto, (write-module-device-database): ditto. * gnu/installer.scm (installer-program): Add "guile-zlib" to the extensions. * gnu/machine/ssh.scm (machine-check-initrd-modules): Ditto. * gnu/services.scm (activation-script): Ditto. * gnu/services/base.scm (default-serial-port): Ditto, (agetty-shepherd-service): ditto, (udev-service-type): ditto. * gnu/system/image.scm (gcrypt-sqlite3&co): Ditto. * gnu/system/linux-initrd.scm (flat-linux-module-directory): Add "guile-zlib" to the extensions and make sure that the initrd only contains uncompressed module files. * gnu/system/shadow.scm (account-shepherd-service): Add "guile-zlib" to the extensions. * guix/profiles.scm (linux-module-database): Ditto. Mathieu Othacehe 2020-03-22system: Add kernel-loadable-modules to operating-system....* gnu/system.scm (<operating-system>): Add kernel-loadable-modules. (operating-system-directory-base-entries): Use it. * doc/guix.texi (operating-system Reference): Document KERNEL-LOADABLE-MODULES. * gnu/build/linux-modules.scm (depmod): New procedure. (make-linux-module-directory): New procedure. Export it. * guix/profiles.scm (linux-module-database): New procedure. Export it. * gnu/tests/linux-modules.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/linux.scm (make-linux-libre*)[arguments]<#:phases>[install]: Disable depmod. Remove "build" and "source" symlinks. [native-inputs]: Remove kmod. Danny Milosavljevic