From: Pádraig Brady
Date: Tue, 16 Sep 2025 16:38:57 +0000 (+0100)
Subject: cpu-supports: remove assert dependency
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0184d73eb46dacdd410d1dde8a6ef70470a8ccf;p=thirdparty%2Fgnulib.git
cpu-supports: remove assert dependency
Avoid LGPL incompatibility issues by removing assert.
* lib/cpu-supports.c (hwcaps_allowed): Replace assert()s
with defensive returns allowing the passed hwcap.
* modules/cpu-supports: Remove the dependency.
---
diff --git a/ChangeLog b/ChangeLog
index d6a4df6cd0..58e2bde025 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-09-16 Pádraig Brady
+
+ cpu-supports: remove assert dependency
+ Avoid LGPL incompatibility issues by removing assert.
+ * lib/cpu-supports.c (hwcaps_allowed): Replace assert()s
+ with defensive returns allowing the passed hwcap.
+ * modules/cpu-supports: Remove the dependency.
+
2025-09-16 Bruno Haible
Document msvcrt (native Windows) bugs regarding console output.
diff --git a/lib/cpu-supports.c b/lib/cpu-supports.c
index 94b7c4d7bf..887c394ecb 100644
--- a/lib/cpu-supports.c
+++ b/lib/cpu-supports.c
@@ -16,7 +16,6 @@
along with this program. If not, see . */
#include
-#include
#include
#include
@@ -31,7 +30,8 @@ hwcap_allowed (char const *glibc_hwcap)
if (! glibc_hwcap)
return true;
- assert (*glibc_hwcap == '-'); /* Pass HWCAP with a leading - */
+ if (*glibc_hwcap != '-') /* Need to pass HWCAP with a leading - */
+ return true;
/* Match how GLIBC parses tunables as indicated with:
GLIBC_TUNABLES=glibc.cpu.hwcaps=... ld.so --list-tunables | grep hwcaps
@@ -58,7 +58,8 @@ hwcap_allowed (char const *glibc_hwcap)
hwcaps = "";
}
- assert (hwcaps);
+ if (! hwcaps) /* Shouldn't happen. */
+ return true;
if (! *hwcaps)
return true;
diff --git a/modules/cpu-supports b/modules/cpu-supports
index dcb07df8c3..448eb2a902 100644
--- a/modules/cpu-supports
+++ b/modules/cpu-supports
@@ -6,7 +6,6 @@ lib/cpu-supports.h
lib/cpu-supports.c
Depends-on:
-assert
attribute
bool
c99