--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: libime: FTBFs on hppa architecture (with patch)
- From: Helge Deller <deller@gmx.de>
- Date: Wed, 24 Aug 2022 08:48:25 +0200
- Message-id: <39e53e4b-30b2-324f-d533-0b7becac98fa@gmx.de>
Package: libime
Version: 1.0.13-1
Severity: important
Tags: hppa, patch
libmime fails to build on the hppa (PA-RISC) architecture because of
the check in ./test/testtrie.cpp:
auto nan1 = std::nanf("1");
...
// NaN != NaN, we must use memcmp to do this.
FCITX_ASSERT(memcmp(&nan1, &result, sizeof(float)) == 0);
This is basically the same problem as reported for the mips platform:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973576
The problem is, that hppa and (older) mips use a different encoding for NaNs than
all other platforms. See: https://en.wikipedia.org/wiki/NaN
The attached patch is from John David Anglin <dave.anglin@bell.net>
and fixed the problem for hppa.
I assume that if the:
#ifdef __hppa__
is changed to
#if defined(__hppa__) || (defined(__mips__) && !defined(__LP64__))
then it probably fixes the debian bug report 973576 as well.
Thanks,
Helge
Index: libime-1.0.13/src/libime/core/datrie.h
===================================================================
--- libime-1.0.13.orig/src/libime/core/datrie.h
+++ libime-1.0.13/src/libime/core/datrie.h
@@ -34,8 +34,13 @@ struct NaN {
};
template <>
struct NaN<float> {
+#ifdef __hppa__
+ static constexpr auto N1 = 0x7f800001;
+ static constexpr auto N2 = 0x7f800002;
+#else
static constexpr auto N1 = 0x7fc00001;
static constexpr auto N2 = 0x7fc00002;
+#endif
};
/**
--- End Message ---