public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [edk2-libc Patch 0/1] fix missing nanf definition in StdLib
@ 2023-10-26 15:29 Jayaprakash, N
  2023-10-26 15:29 ` [edk2-devel] [edk2-libc Patch 1/1] ek2-libc: " Jayaprakash, N
  0 siblings, 1 reply; 2+ messages in thread
From: Jayaprakash, N @ 2023-10-26 15:29 UTC (permalink / raw)
  To: devel; +Cc: Jayaprakash N

This patch fixes the issue of missing definition of nanf in StdLib.
This has been extracted from the below PR submitted on edk2-libc.
https://github.com/tianocore/edk2-libc/pull/9

Jayaprakash N (1):
  ek2-libc: fix missing nanf definition in StdLib

 StdLib/LibC/LibC.inf            |  1 +
 StdLib/LibC/Main/nanf_ieee754.c | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 StdLib/LibC/Main/nanf_ieee754.c

-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110118): https://edk2.groups.io/g/devel/message/110118
Mute This Topic: https://groups.io/mt/102202278/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [edk2-devel] [edk2-libc Patch 1/1] ek2-libc: fix missing nanf definition in StdLib
  2023-10-26 15:29 [edk2-devel] [edk2-libc Patch 0/1] fix missing nanf definition in StdLib Jayaprakash, N
@ 2023-10-26 15:29 ` Jayaprakash, N
  0 siblings, 0 replies; 2+ messages in thread
From: Jayaprakash, N @ 2023-10-26 15:29 UTC (permalink / raw)
  To: devel; +Cc: Jayaprakash N, Rebecca Cran, Michael D Kinney, Kloper Dimitry

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4576

File StdLib/Include/math.h:406 defines NAN constant as __nanf.__val.
The problem is that __nanf is never defined.
Fix is simple: define __nanf in similar way as __infinityf

This fix has been provided through the below PR on edk2-libc repo
https://github.com/tianocore/edk2-libc/pull/9.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jayaprakash N <n.jayaprakash@intel.com>
Signed-off-by: Kloper Dimitry <dimitry.kloper@intel.com>
---
 StdLib/LibC/LibC.inf            |  1 +
 StdLib/LibC/Main/nanf_ieee754.c | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 StdLib/LibC/Main/nanf_ieee754.c

diff --git a/StdLib/LibC/LibC.inf b/StdLib/LibC/LibC.inf
index ad6a117..93e32e8 100644
--- a/StdLib/LibC/LibC.inf
+++ b/StdLib/LibC/LibC.inf
@@ -34,6 +34,7 @@
   Main/isnand_ieee754.c
   Main/isnanf_ieee754.c
   Main/infinityf_ieee754.c
+  Main/nanf_ieee754.c
   Main/Main.c
   Main/HtoNtoH.c
   Main/ByteSwap.c
diff --git a/StdLib/LibC/Main/nanf_ieee754.c b/StdLib/LibC/Main/nanf_ieee754.c
new file mode 100644
index 0000000..8e56d32
--- /dev/null
+++ b/StdLib/LibC/Main/nanf_ieee754.c
@@ -0,0 +1,15 @@
+/*
+ * IEEE-compatible nanf.c -- public domain.
+ */
+#include  <LibConfig.h>
+#include <sys/EfiCdefs.h>
+
+#include <math.h>
+#include <machine/endian.h>
+
+const union __float_u __nanf =
+#if BYTE_ORDER == BIG_ENDIAN
+  { { 0x7f, 0xc0,     0,    0 } };
+#else
+  { {    0,    0,  0xc0, 0x7f } };
+#endif
-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110117): https://edk2.groups.io/g/devel/message/110117
Mute This Topic: https://groups.io/mt/102202277/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-26 15:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-26 15:29 [edk2-devel] [edk2-libc Patch 0/1] fix missing nanf definition in StdLib Jayaprakash, N
2023-10-26 15:29 ` [edk2-devel] [edk2-libc Patch 1/1] ek2-libc: " Jayaprakash, N

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox