Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPAN Digest::BLAKE2 not compatible with gcc11 / Ubuntu22 #1112

Closed
laemtl opened this issue Apr 19, 2024 · 2 comments · Fixed by #1135
Closed

CPAN Digest::BLAKE2 not compatible with gcc11 / Ubuntu22 #1112

laemtl opened this issue Apr 19, 2024 · 2 comments · Fixed by #1135

Comments

@laemtl
Copy link
Contributor

laemtl commented Apr 19, 2024

While trying to install Digest::BLAKE2
sudo -S cpan install Digest::BLAKE2

I got the following error:

In file included from src/../blake2/sse/blake2b.c:18,
                 from lib/Digest/BLAKE2b.xs:10:
src/../blake2/sse/blake2.h:101:5: error: size of array element is not a multiple of its alignment
  101 |     blake2s_state S[8][1];
      |     ^~~~~~~~~~~~~
src/../blake2/sse/blake2.h:102:5: error: size of array element is not a multiple of its alignment
  102 |     blake2s_state R[1];
      |     ^~~~~~~~~~~~~
src/../blake2/sse/blake2.h:109:5: error: size of array element is not a multiple of its alignment
  109 |     blake2b_state S[4][1];
      |     ^~~~~~~~~~~~~
src/../blake2/sse/blake2.h:110:5: error: size of array element is not a multiple of its alignment
  110 |     blake2b_state R[1];
      |     ^~~~~~~~~~~~~
In file included from lib/Digest/BLAKE2b.xs:10:
src/../blake2/sse/blake2b.c: In function ‘blake2b’:
src/../blake2/sse/blake2b.c:371:3: error: size of array element is not a multiple of its alignment
  371 |   blake2b_state S[1];
      |   ^~~~~~~~~~~~~
lib/Digest/BLAKE2b.c: In function ‘XS_Digest__BLAKE2b_new’:
lib/Digest/BLAKE2b.c:242:17: warning: unused variable ‘class’ [-Wunused-variable]
  242 |         SV *    class = ST(0)

This package is a dependency of the PET pipeline.

@gsch-cmi
Copy link

You can patch a local version of Digest::BLAKE2 that can be installed locally, the fix is quite minor, and is detailed here: Raptor3um/raptoreum#48 (comment)

effectively all lines that begin with ALIGNME( 64 ) in blake2.h need ALIGNME(64) moved to the middle of the line, e.g.
typedef struct ALIGNME( 64 ) __blake2s_state

i've attached the a tar.gz of the patch i made by making the above change throughout in case it is helpful. it installs in ubuntu 22 and 24 docker containers using cpanm.
Digest-BLAKE2-0.02.tar.gz

@laemtl
Copy link
Contributor Author

laemtl commented May 31, 2024

Thank you @gsch-cmi , I have implemented your fix in #1135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants