From 42e78cc389f6630d713f8ed808927b2d665569da Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 1 Feb 2025 20:23:24 +0800 Subject: [PATCH] mips64el: Fix nan encoding probe impreciseness with ieee754=emulated The ieee754=emulated option was added in Linux 6.11, and with Linux >= 5.16 we can get the hardware nan encoding from /proc/cpuinfo. So we prefer the cpuinfo report, and only use the custom probe code if cpuinfo does not have the info (indicating an old kernel which cannot support ieee754=emulated). --- chapter05/gcc-pass1.xml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/chapter05/gcc-pass1.xml b/chapter05/gcc-pass1.xml index 4afe2cdc9..cf305fdb0 100644 --- a/chapter05/gcc-pass1.xml +++ b/chapter05/gcc-pass1.xml @@ -86,7 +86,8 @@ int main() } EOF gcc nan2008.c -o nan2008 -if ./nan2008; then +if ! grep -q nan_legacy /proc/cpuinfo && + (grep -q nan_2008 /proc/cpuinfo || ./nan2008) then NAN_SWITCH=--with-nan=2008 fi @@ -226,13 +227,6 @@ fi to fail), or produce bad results (causing test failures building some packages, for example Glibc and Python). -