avy: fix build on aarch64-linux

+31 -50
-3
pkgs/applications/science/logic/avy/default.nix
··· 43 43 license = lib.licenses.mit; 44 44 maintainers = with lib.maintainers; [ thoughtpolice ]; 45 45 platforms = lib.platforms.linux; 46 - # See pkgs/applications/science/logic/glucose/default.nix 47 - # (The error is different due to glucose-fenv.patch, but the same) 48 - badPlatforms = [ "aarch64-linux" ]; 49 46 }; 50 47 }
+16 -24
pkgs/applications/science/logic/avy/glucose-fenv.patch
··· 1 - From d6e0cb60270e8653bda3f339e3a07ce2cd2d6eb0 Mon Sep 17 00:00:00 2001 2 - From: Will Dietz <w@wdtz.org> 3 - Date: Tue, 17 Oct 2017 23:01:36 -0500 4 - Subject: [PATCH] glucose: use fenv to set double precision 5 - 6 - --- 7 - core/Main.cc | 8 ++++++-- 8 - simp/Main.cc | 8 ++++++-- 9 - utils/System.h | 2 +- 10 - 3 files changed, 13 insertions(+), 5 deletions(-) 11 - 12 1 diff --git a/core/Main.cc b/core/Main.cc 13 - index c96aadd..994132b 100644 2 + index fd8fca1..37d2ed5 100644 14 3 --- a/core/Main.cc 15 4 +++ b/core/Main.cc 16 - @@ -96,8 +96,12 @@ int main(int argc, char** argv) 5 + @@ -95,9 +95,13 @@ int main(int argc, char** argv) 6 + setUsageHelp("c USAGE: %s [options] <input-file> <result-output-file>\n\n where input may be either in plain or gzipped DIMACS.\n"); 17 7 // printf("This is MiniSat 2.0 beta\n"); 18 - 19 - #if defined(__linux__) 8 + 9 + -#if defined(__linux__) 20 10 - fpu_control_t oldcw, newcw; 21 11 - _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw); 12 + +#if defined(__linux__) && defined(__x86_64__) 22 13 + fenv_t fenv; 23 14 + 24 15 + fegetenv(&fenv); ··· 29 20 #endif 30 21 // Extra options: 31 22 diff --git a/simp/Main.cc b/simp/Main.cc 32 - index 4f4772d..70c2e4b 100644 23 + index 4f4772d..c605f6e 100644 33 24 --- a/simp/Main.cc 34 25 +++ b/simp/Main.cc 35 - @@ -97,8 +97,12 @@ int main(int argc, char** argv) 26 + @@ -96,9 +96,13 @@ int main(int argc, char** argv) 27 + setUsageHelp("c USAGE: %s [options] <input-file> <result-output-file>\n\n where input may be either in plain or gzipped DIMACS.\n"); 36 28 37 29 38 - #if defined(__linux__) 30 + -#if defined(__linux__) 39 31 - fpu_control_t oldcw, newcw; 40 32 - _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw); 33 + +#if defined(__linux__) && defined(__x86_64__) 41 34 + fenv_t fenv; 42 35 + 43 36 + fegetenv(&fenv); ··· 48 41 #endif 49 42 // Extra options: 50 43 diff --git a/utils/System.h b/utils/System.h 51 - index 004d498..a768e99 100644 44 + index 004d498..2f6d922 100644 52 45 --- a/utils/System.h 53 46 +++ b/utils/System.h 54 - @@ -22,7 +22,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA 47 + @@ -21,8 +21,8 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA 48 + #ifndef Glucose_System_h 55 49 #define Glucose_System_h 56 50 57 - #if defined(__linux__) 51 + -#if defined(__linux__) 58 52 -#include <fpu_control.h> 53 + +#if defined(__linux__) && defined(__x86_64__) 59 54 +#include <fenv.h> 60 55 #endif 61 56 62 57 #include "glucose/mtl/IntTypes.h" 63 - -- 64 - 2.14.2 65 -
+15 -23
pkgs/applications/science/logic/avy/minisat-fenv.patch
··· 1 - From 7f1016ceab9b0f57a935bd51ca6df3d18439b472 Mon Sep 17 00:00:00 2001 2 - From: Will Dietz <w@wdtz.org> 3 - Date: Tue, 17 Oct 2017 22:57:02 -0500 4 - Subject: [PATCH] use fenv instead of non-standard fpu_control 5 - 6 - --- 7 - core/Main.cc | 8 ++++++-- 8 - simp/Main.cc | 8 ++++++-- 9 - utils/System.h | 2 +- 10 - 3 files changed, 13 insertions(+), 5 deletions(-) 11 - 12 1 diff --git a/core/Main.cc b/core/Main.cc 13 - index 2b0d97b..8ad95fb 100644 2 + index 2b0d97b..9ba985d 100644 14 3 --- a/core/Main.cc 15 4 +++ b/core/Main.cc 16 - @@ -78,8 +78,12 @@ int main(int argc, char** argv) 5 + @@ -77,9 +77,13 @@ int main(int argc, char** argv) 6 + setUsageHelp("USAGE: %s [options] <input-file> <result-output-file>\n\n where input may be either in plain or gzipped DIMACS.\n"); 17 7 // printf("This is MiniSat 2.0 beta\n"); 18 8 19 - #if defined(__linux__) 9 + -#if defined(__linux__) 20 10 - fpu_control_t oldcw, newcw; 21 11 - _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw); 12 + +#if defined(__linux__) && defined(__x86_64__) 22 13 + fenv_t fenv; 23 14 + 24 15 + fegetenv(&fenv); ··· 29 20 #endif 30 21 // Extra options: 31 22 diff --git a/simp/Main.cc b/simp/Main.cc 32 - index 2804d7f..39bfb71 100644 23 + index 2804d7f..7fbdb33 100644 33 24 --- a/simp/Main.cc 34 25 +++ b/simp/Main.cc 35 - @@ -79,8 +79,12 @@ int main(int argc, char** argv) 26 + @@ -78,9 +78,13 @@ int main(int argc, char** argv) 27 + setUsageHelp("USAGE: %s [options] <input-file> <result-output-file>\n\n where input may be either in plain or gzipped DIMACS.\n"); 36 28 // printf("This is MiniSat 2.0 beta\n"); 37 29 38 - #if defined(__linux__) 30 + -#if defined(__linux__) 39 31 - fpu_control_t oldcw, newcw; 40 32 - _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw); 33 + +#if defined(__linux__) && defined(__x86_64__) 41 34 + fenv_t fenv; 42 35 + 43 36 + fegetenv(&fenv); ··· 48 41 #endif 49 42 // Extra options: 50 43 diff --git a/utils/System.h b/utils/System.h 51 - index 1758192..c0ad13a 100644 44 + index 1758192..840bee5 100644 52 45 --- a/utils/System.h 53 46 +++ b/utils/System.h 54 - @@ -22,7 +22,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA 47 + @@ -21,8 +21,8 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA 48 + #ifndef Minisat_System_h 55 49 #define Minisat_System_h 56 50 57 - #if defined(__linux__) 51 + -#if defined(__linux__) 58 52 -#include <fpu_control.h> 53 + +#if defined(__linux__) && defined(__x86_64__) 59 54 +#include <fenv.h> 60 55 #endif 61 56 62 57 #include "mtl/IntTypes.h" 63 - -- 64 - 2.14.2 65 -