Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 696220 - dev-haskell/cryptonite CPU_FLAGS_X86=sse - In file included from cbits/blake2/sse/blake2b.c:21:0: error: cbits/blake2/sse/blake2-config.h:68:2: error: #error "This code requires at least SSE2."
Summary: dev-haskell/cryptonite CPU_FLAGS_X86=sse - In file included from cbits/blake2...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Gentoo's Haskell Language team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-04 14:17 UTC by Thomas Kahle
Modified: 2019-10-13 14:13 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,5.78 KB, text/plain)
2019-10-04 14:17 UTC, Thomas Kahle
Details
build.log (build.log,17.90 KB, text/plain)
2019-10-04 14:17 UTC, Thomas Kahle
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Kahle 2019-10-04 14:17:05 UTC
Created attachment 591796 [details]
emerge --info

It builds just fine with CPU_FLAGS_X86="" and with 
CPU_FLAGS_X86="sse" I get:

[111 of 111] Compiling Crypto.Cipher.AES ( Crypto/Cipher/AES.hs, dist/build/Crypto/Cipher/AES.o )

In file included from cbits/blake2/sse/blake2b.c:21:0: error:

cbits/blake2/sse/blake2-config.h:68:2: error:
     error: #error "This code requires at least SSE2."
     #error "This code requires at least SSE2."
      ^~~~~
cbits/blake2/sse/blake2b.c: In function ‘blake2b_compress’:

cbits/blake2/sse/blake2b.c:291:9: error:
     warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi]
       row1l = LOADU( &S->h[0] );
`i686-pc-linux-gnu-gcc' failed in phase `C Compiler'. (Exit code: 1)
Comment 1 Thomas Kahle 2019-10-04 14:17:58 UTC
Created attachment 591798 [details]
build.log
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2019-10-13 13:43:06 UTC
Oh, looks like that flag should have been sse2. Looking.
Comment 3 Larry the Git Cow gentoo-dev 2019-10-13 14:13:03 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d6567635185b785cd4e0c2763d4707402e3beb5

commit 7d6567635185b785cd4e0c2763d4707402e3beb5
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2019-10-13 14:12:41 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2019-10-13 14:12:55 +0000

    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 <slyfox@gentoo.org>

 dev-haskell/cryptonite/cryptonite-0.21.ebuild           | 10 +++++++---
 dev-haskell/cryptonite/files/cryptonite-0.21-sse2.patch | 11 +++++++++++
 2 files changed, 18 insertions(+), 3 deletions(-)