From 22b3a581a87bf079203302e732008219531ad36b Mon Sep 17 00:00:00 2001 From: Rowan Goemans Date: Sun, 4 Feb 2024 22:31:12 +0100 Subject: [PATCH] cabal: Make `workaround-ghc-mmap-crash` a noop on non-x86_64. (#2657) Fixes #2656 --- ...24-02-04T21_34_25+01_00_x86_workaround-ghc-mmap-crash_noop | 1 + clash-ghc/clash-ghc.cabal | 2 +- clash-lib/clash-lib.cabal | 2 +- clash-prelude/clash-prelude.cabal | 4 ++-- tests/clash-testsuite.cabal | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 changelog/2024-02-04T21_34_25+01_00_x86_workaround-ghc-mmap-crash_noop diff --git a/changelog/2024-02-04T21_34_25+01_00_x86_workaround-ghc-mmap-crash_noop b/changelog/2024-02-04T21_34_25+01_00_x86_workaround-ghc-mmap-crash_noop new file mode 100644 index 0000000000..5f3871bd53 --- /dev/null +++ b/changelog/2024-02-04T21_34_25+01_00_x86_workaround-ghc-mmap-crash_noop @@ -0,0 +1 @@ +* cabal: Make `workaround-ghc-mmap-crash` a noop on non-x86_64. Fixes [#2656](https://github.com/clash-lang/clash-compiler/issues/2656) diff --git a/clash-ghc/clash-ghc.cabal b/clash-ghc/clash-ghc.cabal index f2fb9770dd..d05ebaded6 100644 --- a/clash-ghc/clash-ghc.cabal +++ b/clash-ghc/clash-ghc.cabal @@ -79,7 +79,7 @@ executable clash GHC-Options: -dynamic -- Note that multiple -with-rtsopts are not cumulative, so we can't add the -- common RTS options in the unconditional GHC-Options - if flag(workaround-ghc-mmap-crash) + if arch(x86_64) && flag(workaround-ghc-mmap-crash) GHC-Options: "-with-rtsopts=-A128m -xm20000000" else GHC-Options: -with-rtsopts=-A128m diff --git a/clash-lib/clash-lib.cabal b/clash-lib/clash-lib.cabal index c0799ed463..3172ba6faa 100644 --- a/clash-lib/clash-lib.cabal +++ b/clash-lib/clash-lib.cabal @@ -389,7 +389,7 @@ test-suite unittests ghc-options: -Wall -Wcompat -threaded -- Note that multiple -with-rtsopts are not cumulative, so we can't add the -- common RTS options in the unconditional GHC-Options - if flag(workaround-ghc-mmap-crash) + if arch(x86_64) && flag(workaround-ghc-mmap-crash) GHC-Options: "-with-rtsopts=-N -xm20000000" else GHC-Options: -with-rtsopts=-N diff --git a/clash-prelude/clash-prelude.cabal b/clash-prelude/clash-prelude.cabal index 625c69d5fa..b52dfda8b6 100644 --- a/clash-prelude/clash-prelude.cabal +++ b/clash-prelude/clash-prelude.cabal @@ -388,7 +388,7 @@ test-suite doctests doctest-parallel >= 0.3.1 && < 0.4, filepath - if flag(workaround-ghc-mmap-crash) + if arch(x86_64) && flag(workaround-ghc-mmap-crash) ghc-options: -with-rtsopts=-xm20000000 if flag(multiple-hidden) @@ -401,7 +401,7 @@ test-suite unittests main-is: unittests.hs ghc-options: -Wall -Wcompat -threaded -- Note that multiple -with-rtsopts are not cumulative - if flag(workaround-ghc-mmap-crash) + if arch(x86_64) && flag(workaround-ghc-mmap-crash) ghc-options: "-with-rtsopts=-N -xm20000000" else ghc-options: -with-rtsopts=-N diff --git a/tests/clash-testsuite.cabal b/tests/clash-testsuite.cabal index 5c7aca3f75..03f2c267c5 100644 --- a/tests/clash-testsuite.cabal +++ b/tests/clash-testsuite.cabal @@ -92,7 +92,7 @@ common basic-config if flag(multiple-hidden) cpp-options: -DCLASH_MULTIPLE_HIDDEN - if flag(workaround-ghc-mmap-crash) + if arch(x86_64) && flag(workaround-ghc-mmap-crash) cpp-options: -DCLASH_WORKAROUND_GHC_MMAP_CRASH library