From 7d6567635185b785cd4e0c2763d4707402e3beb5 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 13 Oct 2019 15:12:41 +0100 Subject: [PATCH] dev-haskell/cryptonite: pass -msse2 for blake2, bug #696220 Fixed two problems here: - blake2 code assumes SSE2, not just SSE - x86 needs -msse2 to be passed explicitly (as opposed to amd64) Otherwise compiler does not attempt to emit sse2 primitives and build fails as: ``` cbits/blake2/sse/blake2-config.h:68:2: error: error: #error "This code requires at least SSE2." #error "This code requires at least SSE2." ^~~~~ ``` Reported-by: Thomas Kahle Closes: https://bugs.gentoo.org/696220 Package-Manager: Portage-2.3.76, Repoman-2.3.17 Signed-off-by: Sergei Trofimovich --- dev-haskell/cryptonite/cryptonite-0.21.ebuild | 10 +++++++--- .../cryptonite/files/cryptonite-0.21-sse2.patch | 11 +++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 dev-haskell/cryptonite/files/cryptonite-0.21-sse2.patch diff --git a/dev-haskell/cryptonite/cryptonite-0.21.ebuild b/dev-haskell/cryptonite/cryptonite-0.21.ebuild index ee4e621ff8f7..c7d05d15f68b 100644 --- a/dev-haskell/cryptonite/cryptonite-0.21.ebuild +++ b/dev-haskell/cryptonite/cryptonite-0.21.ebuild @@ -4,7 +4,7 @@ EAPI=7 # ebuild generated by hackport 0.6.9999 -#hackport: flags: -check_alignment,-old_toolchain_inliner,+support_deepseq,support_aesni:cpu_flags_x86_aes,support_pclmuldq:cpu_flags_x86_sse4_1,support_sse:cpu_flags_x86_sse,support_rdrand:cpu-flags-x86-rdrand,support_blake2_sse:cpu_flags_x86_sse +#hackport: flags: -check_alignment,-old_toolchain_inliner,+support_deepseq,support_aesni:cpu_flags_x86_aes,support_pclmuldq:cpu_flags_x86_sse4_1,support_rdrand:cpu-flags-x86-rdrand,support_blake2_sse:cpu_flags_x86_sse2 CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite" inherit haskell-cabal @@ -16,7 +16,7 @@ SRC_URI="mirror://hackage/packages/archive/${PN}/${PV}/${P}.tar.gz" LICENSE="BSD" SLOT="0/${PV}" KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux" -IUSE="cpu-flags-x86-rdrand cpu_flags_x86_aes cpu_flags_x86_sse cpu_flags_x86_sse4_1 +integer-gmp" +IUSE="cpu-flags-x86-rdrand cpu_flags_x86_aes cpu_flags_x86_sse2 cpu_flags_x86_sse4_1 +integer-gmp" RDEPEND=">=dev-haskell/memory-0.8:=[profile?] >=dev-lang/ghc-7.4.1:= @@ -30,13 +30,17 @@ DEPEND="${RDEPEND} dev-haskell/tasty-quickcheck ) " +PATCHES=( + "${FILESDIR}"/${P}-sse2.patch +) + src_configure() { haskell-cabal_src_configure \ --flag=-check_alignment \ $(cabal_flag integer-gmp integer-gmp) \ --flag=-old_toolchain_inliner \ $(cabal_flag cpu_flags_x86_aes support_aesni) \ - $(cabal_flag cpu_flags_x86_sse support_blake2_sse) \ + $(cabal_flag cpu_flags_x86_sse2 support_blake2_sse) \ --flag=support_deepseq \ $(cabal_flag cpu_flags_x86_sse4_1 support_pclmuldq) \ $(cabal_flag cpu-flags-x86-rdrand support_rdrand) diff --git a/dev-haskell/cryptonite/files/cryptonite-0.21-sse2.patch b/dev-haskell/cryptonite/files/cryptonite-0.21-sse2.patch new file mode 100644 index 000000000000..02d2069cfd20 --- /dev/null +++ b/dev-haskell/cryptonite/files/cryptonite-0.21-sse2.patch @@ -0,0 +1,11 @@ +https://bugs.gentoo.org/696220 +--- a/cryptonite.cabal ++++ b/cryptonite.cabal +@@ -276,6 +276,7 @@ Library + , cbits/cryptonite_aes.c + + if arch(x86_64) || flag(support_blake2_sse) ++ CC-options: -msse2 + C-sources: cbits/blake2/sse/blake2s.c + , cbits/blake2/sse/blake2sp.c + , cbits/blake2/sse/blake2b.c -- 2.26.2