Bug#1027168: onetbb: Please add patch to fix FTBFS on sh4
John Paul Adrian Glaubitz <[email protected]> Wed, 28 Dec 2022 20:18:04 +0100
| Newsgroups | gmane.linux.debian.ports.superh |
|---|---|
| Message-ID | <167225508443.1841813.5576364075384099823.reportbug__34392.711606209$1672255296$gmane$org@nofan.physik.fu-berlin.de> |
Source: onetbb Version: 2021.8.0-1 Severity: normal Tags: patch User: [email protected] Usertags: sh4 X-Debbugs-Cc: [email protected] Hi! onetbb currently FTBFS on sh4 because the source code assumes that the target FPU supports all four rounding modes (FE_TONEAREST, FE_DOWNWARD, FE_UPWARD and FE_TOWARDZERO) which is not the case on sh4 which supports FE_TONEAREST and FE_TOWARDZERO only [1]. The attached patch fixes these assumptions for sh4 and makes the code build. I have already patched and uploaded the package to the unreleased distribution so that the mold linker can build on sh4 as well. I will forward the patch later after reformating it. Thanks, Adrian > [1] https://sourceware.org/pipermail/libc-alpha/2012-May/031608.html -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
sh4-support.patch
(text/plain, 888 B)
--- onetbb-2021.8.0.orig/test/common/fp_control.h
+++ onetbb-2021.8.0/test/common/fp_control.h
@@ -112,7 +112,11 @@ inline void SetRoundingMode ( int mode )
#include <fenv.h>
+#if defined(__sh__)
+const int RND_MODE_MASK = FE_TONEAREST | FE_TOWARDZERO;
+#else
const int RND_MODE_MASK = FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO;
+#endif
const int NumSseModes = 1;
const int SseModes[NumSseModes] = { 0 };
@@ -125,8 +129,13 @@ inline void SetSseMode ( int ) {}
#endif /* Other archs */
+#if defined(__sh__)
+const int NumRoundingModes = 2;
+const int RoundingModes[NumRoundingModes] = { FE_TONEAREST, FE_TOWARDZERO };
+#else
const int NumRoundingModes = 4;
const int RoundingModes[NumRoundingModes] = { FE_TONEAREST, FE_DOWNWARD, FE_UPWARD, FE_TOWARDZERO };
+#endif
const int numFPModes = NumRoundingModes*NumSseModes;
inline void SetFPMode( int mode ) {