From 1cf9de4c8b224a3e0ac332628ea2af87be867db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Oth=C3=B3n=20Mart=C3=ADnez=20Vera?= Date: Tue, 27 Jun 2023 13:33:28 -0600 Subject: [PATCH] Fix build with i386 and musl libc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current code asumes glibc == linux. This patch extends support to all non-glibc Linux systems. Signed-off-by: Cristian Othón Martínez Vera --- src/lib/Iex/IexMathFpu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Iex/IexMathFpu.cpp b/src/lib/Iex/IexMathFpu.cpp index 4eba0895f4..7876d8a014 100644 --- a/src/lib/Iex/IexMathFpu.cpp +++ b/src/lib/Iex/IexMathFpu.cpp @@ -243,14 +243,14 @@ restoreControlRegs (const ucontext_t& ucon, bool clearExceptions) inline void restoreControlRegs (const ucontext_t& ucon, bool clearExceptions) { -# if (defined(__GLIBC__) && defined(__i386__)) || defined(__ANDROID_API__) +# if (defined(__linux__) && defined(__i386__)) || defined(__ANDROID_API__) setCw ((ucon.uc_mcontext.fpregs->cw & cwRestoreMask) | cwRestoreVal); # else setCw ((ucon.uc_mcontext.fpregs->cwd & cwRestoreMask) | cwRestoreVal); # endif _fpstate* kfp = reinterpret_cast<_fpstate*> (ucon.uc_mcontext.fpregs); -# if defined(__GLIBC__) && defined(__i386__) +# if defined(__linux__) && defined(__i386__) setMxcsr (kfp->magic == 0 ? kfp->mxcsr : 0, clearExceptions); # else setMxcsr (kfp->mxcsr, clearExceptions);