git: e09d209d1a74 - stable/13 - libm: Add feenableexcept and fedisableexcept to library on powerpc

From: Justin Hibbits <jhibbits_at_FreeBSD.org>
Date: Thu, 24 Nov 2022 15:39:39 UTC
The branch stable/13 has been updated by jhibbits:

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

commit e09d209d1a74a3caca95dea303db9bc605fce1a7
Author:     Justin Hibbits <jhibbits@FreeBSD.org>
AuthorDate: 2022-05-13 22:18:25 +0000
Commit:     Justin Hibbits <jhibbits@FreeBSD.org>
CommitDate: 2022-11-24 15:42:09 +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.
    
    Reviewers: imp, emaste, kib
    
    Reviewed By: kib
    
    Differential Revision: https://reviews.freebsd.org/D35204
    
    (cherry picked from commit 448c505c33cc334193590f3844406d6a74f26e2a)
---
 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 7f7d98515995..f33493a5df2b 100644
--- a/lib/msun/powerpc/fenv.c
+++ b/lib/msun/powerpc/fenv.c
@@ -54,6 +54,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)
 {