git: 448c505c33cc - main - libm: Add feenableexcept and fedisableexcept to library on powerpc

From: Justin Hibbits <jhibbits_at_FreeBSD.org>
Date: Sat, 14 May 2022 01:26:07 UTC
The branch main has been updated by jhibbits:

URL: https://cgit.FreeBSD.org/src/commit/?id=448c505c33cc334193590f3844406d6a74f26e2a

commit 448c505c33cc334193590f3844406d6a74f26e2a
Author:     Justin Hibbits <jhibbits@FreeBSD.org>
AuthorDate: 2022-05-13 22:18:25 +0000
Commit:     Justin Hibbits <jhibbits@FreeBSD.org>
CommitDate: 2022-05-14 01:24:22 +0000

    libm: Add feenableexcept and fedisableexcept to library on powerpc
    
    Summary:
    These functions are missing from the library itself, and exist solely in
    the header.  This breaks a few ports that expect libm to have the
    symbols in the library itself.
    
    Questions on MFC-ability: Can this be MFC'd to 13.2, and how?
    
    Reviewers: imp, emaste, kib
    
    Reviewed By: kib
    
    Differential Revision: https://reviews.freebsd.org/D35204
---
 lib/msun/powerpc/Symbol.map | 5 +++++
 lib/msun/powerpc/fenv.c     | 2 ++
 lib/msun/powerpc/fenv.h     | 7 +++----
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/lib/msun/powerpc/Symbol.map b/lib/msun/powerpc/Symbol.map
index 971112e30c8a..47eca6f99f31 100644
--- a/lib/msun/powerpc/Symbol.map
+++ b/lib/msun/powerpc/Symbol.map
@@ -11,3 +11,8 @@ FBSD_1.3 {
 	feholdexcept;
 	feupdateenv;
 };
+
+FBSD_1.7 {
+	feenableexcept;
+	fedisableexcept;
+};
diff --git a/lib/msun/powerpc/fenv.c b/lib/msun/powerpc/fenv.c
index 1a5644547958..7dc186a1d9e5 100644
--- a/lib/msun/powerpc/fenv.c
+++ b/lib/msun/powerpc/fenv.c
@@ -58,6 +58,8 @@ extern inline int fegetenv(fenv_t *__envp);
 extern inline int feholdexcept(fenv_t *__envp);
 extern inline int fesetenv(const fenv_t *__envp);
 extern inline int feupdateenv(const fenv_t *__envp);
+extern inline int feenableexcept(int __mask);
+extern inline int fedisableexcept(int __mask);
 
 #ifdef __SPE__
 #define	PMAX	0x7f7fffff
diff --git a/lib/msun/powerpc/fenv.h b/lib/msun/powerpc/fenv.h
index 21a70df3d104..83ba6b356af5 100644
--- a/lib/msun/powerpc/fenv.h
+++ b/lib/msun/powerpc/fenv.h
@@ -264,9 +264,7 @@ feupdateenv(const fenv_t *__envp)
 
 #if __BSD_VISIBLE
 
-/* We currently provide no external definitions of the functions below. */
-
-static inline int
+__fenv_static inline int
 feenableexcept(int __mask)
 {
 	union __fpscr __r;
@@ -279,7 +277,7 @@ feenableexcept(int __mask)
 	return ((__oldmask & _ENABLE_MASK) << _FPUSW_SHIFT);
 }
 
-static inline int
+__fenv_static inline int
 fedisableexcept(int __mask)
 {
 	union __fpscr __r;
@@ -292,6 +290,7 @@ fedisableexcept(int __mask)
 	return ((__oldmask & _ENABLE_MASK) << _FPUSW_SHIFT);
 }
 
+/* We currently provide no external definition of fegetexcept(). */
 static inline int
 fegetexcept(void)
 {