JayDDee / cpuminer-opt

Optimized multi algo CPU miner
Other
765 stars 543 forks source link

Fails to compile with gcc 11: error: size of array element is not a multiple of its alignment #313

Closed candrews closed 3 years ago

candrews commented 3 years ago

Trying to compile cpuminer-opt 3.16.2 with gcc-11 results in this build failure:

x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I.  -Iyes/include -Iyes/include -fno-strict-aliasing  -I. -Iyes/include -Iyes/include -Wno-pointer-sign -Wno-pointer-to-int-cast   -O2 -march=native -pipe -fuse-linker-plugin -flto -Wl,-flto -ftree-vectorize -falign-functions=32 -fgraphite-identity -floop-nest-optimize -fno-common -fno-lto -fno-use-linker-plugin  -Iyes/include -Iyes/include -c -o algo/blake/cpuminer-blake2b-hash-4way.o `test -f 'algo/blake/blake2b-hash-4way.c' || echo './'`algo/blake/blake2b-hash-4way.c
algo/blake/sph-blake2s.c: In function ‘blake2s’:
algo/blake/sph-blake2s.c:326:9: error: size of array element is not a multiple of its alignment
  326 |         blake2s_state S[1];
      |         ^~~~~~~~~~~~~
make[2]: *** [Makefile:3158: algo/blake/cpuminer-sph-blake2s.o] Error 1

Originally reported at https://bugs.gentoo.org/787230

JayDDee commented 3 years ago

It appears to be a problem with the location of the alignment attribute in the typedef as described here: https://bugzilla.redhat.com/show_bug.cgi?id=1937076

The same error was found in a few other places. They will be fixed in the next release.

JayDDee commented 3 years ago

cpuminer-opt-3.16.3 is released, please retest.

candrews commented 3 years ago

It now builds - thank you!