On Monday, May 18th, 2026 at 4:10 AM, Jacob Bachmeyer <[email protected]> 
wrote:

> On 5/17/26 06:02, mintsuki wrote:
> > The main/official Gloire distro of the Ironclad kernel project has
> > moved to using glibc as its C library instead of mlibc, therefore,
> > default to that.
> 
> In the interest of making config.guess maximally useful, could this be
> probed in some way instead of simply assuming?
> 
> For example, on GNU/Linux, executing the glibc shared object
> (/lib{,64}/libc.so.6 on common systems) as a program yields a version
> message that contains "(GNU libc)".  Could this behavior of GNU libc be
> used to detect this change, instead of simply assuming that the system
> has it?
> 
> 
> -- Jacob
> 
> 

Thanks for the swift reply. Would this be better?
From 49f9d6a643151d86be25d08e9e7afbbff6f40a58 Mon Sep 17 00:00:00 2001
From: Mintsuki <[email protected]>
Date: Sun, 17 May 2026 12:57:28 +0200
Subject: [PATCH] ironclad: Default *-ironclad-mlibc to *-ironclad-gnu

The main/official Gloire distro of the Ironclad kernel project has
moved to using glibc as its C library instead of mlibc, therefore,
default to that.

Also add support for autodetecting the Managarm C Library using the
__mlibc__ default macro, as a nice bonus, to keep supporting it for
Ironclad in config.guess.
---
 config.guess                | 8 +++++---
 config.sub                  | 4 ++--
 testsuite/config-guess.data | 2 +-
 testsuite/config-sub.data   | 3 +++
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/config.guess b/config.guess
index a9d01fd..0765f4b 100755
--- a/config.guess
+++ b/config.guess
@@ -150,7 +150,7 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
 case $UNAME_SYSTEM in
-Linux|GNU|GNU/*)
+Ironclad|Linux|GNU|GNU/*)
 	LIBC=unknown
 
 	set_cc_for_build
@@ -167,6 +167,8 @@ Linux|GNU|GNU/*)
 	LIBC=gnu
 	#elif defined(__LLVM_LIBC__)
 	LIBC=llvm
+	#elif defined(__mlibc__)
+	LIBC=mlibc
 	#else
 	#include <stdarg.h>
 	/* First heuristic to detect musl libc.  */
@@ -1598,10 +1600,10 @@ EOF
 	GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
 	;;
     x86_64:[Ii]ronclad:*:*|i?86:[Ii]ronclad:*:*)
-	GUESS=$UNAME_MACHINE-pc-ironclad-mlibc
+	GUESS=$UNAME_MACHINE-pc-ironclad-$LIBC
 	;;
     *:[Ii]ronclad:*:*)
-	GUESS=$UNAME_MACHINE-unknown-ironclad-mlibc
+	GUESS=$UNAME_MACHINE-unknown-ironclad-$LIBC
 	;;
 esac
 
diff --git a/config.sub b/config.sub
index 3d35cde..bb96e0e 100755
--- a/config.sub
+++ b/config.sub
@@ -1525,7 +1525,7 @@ EOF
 		;;
 	ironclad*)
 		kernel=ironclad
-		os=`echo "$basic_os" | sed -e 's|ironclad|mlibc|'`
+		os=`echo "$basic_os" | sed -e 's|ironclad|gnu|'`
 		;;
 	linux*)
 		kernel=linux
@@ -2220,7 +2220,7 @@ case $kernel-$os-$obj in
 		;;
 	uclinux-uclibc*- | uclinux-gnu*- )
 		;;
-	ironclad-mlibc*-)
+	ironclad-gnu*- | ironclad-mlibc*- )
 		;;
 	managarm-mlibc*- | managarm-kernel*- )
 		;;
diff --git a/testsuite/config-guess.data b/testsuite/config-guess.data
index b968943..2f08b84 100644
--- a/testsuite/config-guess.data
+++ b/testsuite/config-guess.data
@@ -148,6 +148,6 @@ x86_64 | 2.0.0(0.271/5/3) | MSYS_NT-6.1 | ignored | ignored | x86_64-pc-msys
 x86_64 | 2.6.32 | Linux | ignored | ignored | x86_64-pc-linux-gnu
 x86_64 | 2.6.32 | VMkernel | ignored | ignored | x86_64-unknown-esx
 x86_64 | 8.0 | OS108 | ignored | ignored | x86_64-unknown-os108_8.0
-x86_64 | ignored | Ironclad | ignored | ignored | x86_64-pc-ironclad-mlibc
+x86_64 | ignored | Ironclad | ignored | ignored | x86_64-pc-ironclad-gnu
 x86_64 | ignored | Managarm | ignored | ignored | x86_64-pc-managarm-mlibc
 xtensa | 2.6.15 | Linux | ignored | ignored | xtensa-unknown-linux-gnu
diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data
index 93b403c..c0f8cd2 100644
--- a/testsuite/config-sub.data
+++ b/testsuite/config-sub.data
@@ -888,6 +888,8 @@ riscv64-company-elf				riscv64-company-elf
 riscv64-company-none-elf			riscv64-company-none-elf
 riscv64-elf					riscv64-unknown-elf
 riscv64-hcos					riscv64-unknown-hcos
+riscv64-ironclad				riscv64-unknown-ironclad-gnu
+riscv64-ironclad-mlibc				riscv64-unknown-ironclad-mlibc
 riscv64-linux					riscv64-unknown-linux-gnu
 riscv64-tock					riscv64-unknown-tock
 riscv64-wrs-vxworks				riscv64-wrs-vxworks
@@ -1129,6 +1131,7 @@ x86_64-ericsson-dicos				x86_64-ericsson-dicos
 x86_64-fuchsia					x86_64-pc-fuchsia
 x86_64-genode					x86_64-pc-genode
 x86_64-glidix					x86_64-pc-glidix
+x86_64-ironclad				x86_64-pc-ironclad-gnu
 x86_64-ironclad-mlibc				x86_64-pc-ironclad-mlibc
 x86_64-l4re					x86_64-pc-l4re
 x86_64-linux-llvm				x86_64-pc-linux-llvm
-- 
2.54.0

Reply via email to