willysr / slackbuilds

Mirror of SlackBuilds.org Repository
https://git.slackbuilds.org/slackbuilds/
27 stars 16 forks source link

blake2 package broken on AMD #37

Closed rversteegen closed 6 years ago

rversteegen commented 6 years ago

I hope this is an appropriate place to report problems.

blake2 doesn't install. Firstly, the blake2.SlackBuild tries to untar the wrong filename. Fix:

diff -u /var/lib/sbopkg/SBo/14.2/system/blake2/blake2.SlackBuild /var/lib/sbopkg/SBo/14.2/system/blake2/blake2.SlackBuild.sbopkg
--- /var/lib/sbopkg/SBo/14.2/system/blake2/blake2.SlackBuild    2016-08-20 12:57:34.000000000 +1200
+++ /var/lib/sbopkg/SBo/14.2/system/blake2/blake2.SlackBuild.sbopkg 2018-03-02 17:53:45.490819308 +1300
@@ -61,7 +61,7 @@
 mkdir -p $TMP $PKG $OUTPUT
 cd $TMP
 rm -rf $SRCNAM-$VERSION
-tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
+tar xvf $CWD/$VERSION.tar.gz
 cd $SRCNAM-$VERSION
 chown -R root:root .
 find -L . \

But that's not enough, it doesn't compile, at least with gcc 7.3.0, because that version of the code contains illegal nested / / comments (it turns out this bug was introduced while fixing support for Visual C++... typical). Unfortunately there is no other "release" on the blake2 github: https://github.com/BLAKE2/BLAKE2/releases

FWIW, this is the git commit that fixed this bug: https://github.com/BLAKE2/BLAKE2/commit/259e61dedee5383eac1a90db6ef88f9ccdcf6002#diff-ac1a341ec0ed38dc5d219572f4282287

I built the package using git master instead.

willysr commented 6 years ago

Hi,

thanks for reporting. I have fixed the download url on my branch and it will be part of the next public update which should be tomorrow.

I also tested on -current where i had GCC 7.3.0 but it build properly

BLAKE2-20160619/
BLAKE2-20160619/.gitignore
BLAKE2-20160619/COPYING
BLAKE2-20160619/README.md
BLAKE2-20160619/b2sum/
BLAKE2-20160619/b2sum/b2sum.1
BLAKE2-20160619/b2sum/b2sum.c
BLAKE2-20160619/b2sum/makefile
BLAKE2-20160619/bench/
BLAKE2-20160619/bench/amd64cpuinfo.c
BLAKE2-20160619/bench/bench.c
BLAKE2-20160619/bench/do.gplot
BLAKE2-20160619/bench/makefile
BLAKE2-20160619/bench/md5.c
BLAKE2-20160619/bench/x86cpuinfo.c
BLAKE2-20160619/csharp/
BLAKE2-20160619/csharp/Blake2Sharp.CompressionCodeGen/
BLAKE2-20160619/csharp/Blake2Sharp.CompressionCodeGen/Blake2Sharp.CompressionCodeGen.csproj
BLAKE2-20160619/csharp/Blake2Sharp.CompressionCodeGen/Program.cs
BLAKE2-20160619/csharp/Blake2Sharp.CompressionCodeGen/Properties/
BLAKE2-20160619/csharp/Blake2Sharp.CompressionCodeGen/Properties/AssemblyInfo.cs
BLAKE2-20160619/csharp/Blake2Sharp.Tests/
BLAKE2-20160619/csharp/Blake2Sharp.Tests/Blake2Sharp.Tests.csproj
BLAKE2-20160619/csharp/Blake2Sharp.Tests/DebugNodeHasher.cs
BLAKE2-20160619/csharp/Blake2Sharp.Tests/Properties/
BLAKE2-20160619/csharp/Blake2Sharp.Tests/Properties/AssemblyInfo.cs
BLAKE2-20160619/csharp/Blake2Sharp.Tests/SequentialTests.cs
BLAKE2-20160619/csharp/Blake2Sharp.Tests/TestVectors.cs
BLAKE2-20160619/csharp/Blake2Sharp.sln
BLAKE2-20160619/csharp/Blake2Sharp/
BLAKE2-20160619/csharp/Blake2Sharp/Blake2B.cs
BLAKE2-20160619/csharp/Blake2Sharp/Blake2BConfig.cs
BLAKE2-20160619/csharp/Blake2Sharp/Blake2BCore-FullyUnrolled.cs
BLAKE2-20160619/csharp/Blake2Sharp/Blake2BCore-Inline.cs
BLAKE2-20160619/csharp/Blake2Sharp/Blake2BCore-Simple.cs
BLAKE2-20160619/csharp/Blake2Sharp/Blake2BCore.cs
BLAKE2-20160619/csharp/Blake2Sharp/Blake2BHasher.cs
BLAKE2-20160619/csharp/Blake2Sharp/Blake2BNodeHasher.cs
BLAKE2-20160619/csharp/Blake2Sharp/Blake2BTreeConfig.cs
BLAKE2-20160619/csharp/Blake2Sharp/Blake2IvBuilder.cs
BLAKE2-20160619/csharp/Blake2Sharp/Blake2Sharp.csproj
BLAKE2-20160619/csharp/Blake2Sharp/Hasher.cs
BLAKE2-20160619/csharp/Blake2Sharp/NodeHasher.cs
BLAKE2-20160619/csharp/Blake2Sharp/Properties/
BLAKE2-20160619/csharp/Blake2Sharp/Properties/AssemblyInfo.cs
BLAKE2-20160619/csharp/Blake2Sharp/TreeHasher.cs
BLAKE2-20160619/csharp/Blake2Sharp/compression.c
BLAKE2-20160619/ref/
BLAKE2-20160619/ref/blake2-impl.h
BLAKE2-20160619/ref/blake2.h
BLAKE2-20160619/ref/blake2b-ref.c
BLAKE2-20160619/ref/blake2bp-ref.c
BLAKE2-20160619/ref/blake2s-ref.c
BLAKE2-20160619/ref/blake2sp-ref.c
BLAKE2-20160619/ref/genkat-c.c
BLAKE2-20160619/ref/genkat-json.c
BLAKE2-20160619/ref/makefile
BLAKE2-20160619/sse/
BLAKE2-20160619/sse/blake2-config.h
BLAKE2-20160619/sse/blake2-impl.h
BLAKE2-20160619/sse/blake2.h
BLAKE2-20160619/sse/blake2b-load-sse2.h
BLAKE2-20160619/sse/blake2b-load-sse41.h
BLAKE2-20160619/sse/blake2b-round.h
BLAKE2-20160619/sse/blake2b.c
BLAKE2-20160619/sse/blake2bp.c
BLAKE2-20160619/sse/blake2s-load-sse2.h
BLAKE2-20160619/sse/blake2s-load-sse41.h
BLAKE2-20160619/sse/blake2s-load-xop.h
BLAKE2-20160619/sse/blake2s-round.h
BLAKE2-20160619/sse/blake2s.c
BLAKE2-20160619/sse/blake2sp.c
BLAKE2-20160619/sse/genkat-c.c
BLAKE2-20160619/sse/genkat-json.c
BLAKE2-20160619/sse/makefile
BLAKE2-20160619/testvectors/
BLAKE2-20160619/testvectors/blake2-kat.h
BLAKE2-20160619/testvectors/blake2-kat.json
BLAKE2-20160619/testvectors/blake2b-kat.txt
BLAKE2-20160619/testvectors/blake2bp-kat.txt
BLAKE2-20160619/testvectors/blake2s-kat.txt
BLAKE2-20160619/testvectors/blake2sp-kat.txt
cc b2sum.c ../sse/blake2b.c ../sse/blake2s.c ../sse/blake2bp.c ../sse/blake2sp.c  -O3 -march=native -Werror=declaration-after-statement -std=c99 -I../sse -fopenmp  -o b2sum

Slackware package maker, version 3.1415927.

Searching for symbolic links:

No symbolic links were found, so we won't make an installation script.
You can make your own later in ./install/doinst.sh and rebuild the
package if you like.

This next step is optional - you can set the directories in your package
to some sane permissions. If any of the directories in your package have
special permissions, then DO NOT reset them here!

Would you like to reset all directory permissions to 755 (drwxr-xr-x) and
directory ownerships to root.root ([y]es, [n]o)? n

Creating Slackware package:  /build/output/blake2-20160619-x86_64-1_SBo.tgz

./
usr/
usr/bin/
usr/bin/b2sum
usr/doc/
usr/doc/blake2-20160619/
usr/doc/blake2-20160619/README.md
usr/doc/blake2-20160619/COPYING
usr/doc/blake2-20160619/blake2.SlackBuild
install/
install/slack-desc

Slackware package /build/output/blake2-20160619-x86_64-1_SBo.tgz created.
rversteegen commented 6 years ago

Thanks.

I also tested on -current where i had GCC 7.3.0 but it failed properly

I assume you mean it compiled properly?

I had another look at the code, and the header containing the broken code is only included #ifdef HAVE_XOP. This is defined if your CPU has the XOP instructions (lscpu|grep xop), which is AMD CPUs since Bulldozer (2011) until but not including Zen.

willysr commented 6 years ago

yes, i compiled it on my Ryzen machine

willysr commented 6 years ago

yeah, it was supposed to be "build properly" not "failed properly" :)