php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70204 CPU lacks SSE2 instructions, scrypt won't compile
Submitted: 2015-08-06 17:06 UTC Modified: 2015-08-09 20:02 UTC
From: a dot mad dot coder at gmail dot com Assigned: dom (profile)
Status: Closed Package: PECL (PECL)
PHP Version: 5.6.11 OS: i686 GNU/Linux 4.0.5-1
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: a dot mad dot coder at gmail dot com
New email:
PHP Version: OS:

 

 [2015-08-06 17:06 UTC] a dot mad dot coder at gmail dot com
Description:
------------
I'm trying to install scrypt support for my php server via `pecl install scrypt`.

Note that the CPU doesn't support SSE2 instructions.

I've also tried:

git clone https://github.com/DomBlack/php-scrypt
cd php-scrypt
phpize
./configure --enable-scrypt
make
make test

The tests fails. but I believe it may be relevant to sse2. The logs can be pasted here if needed.

Test script:
---------------
#using a cpu without sse2 support, run:
pecl install scrypt

Actual result:
--------------
# pecl install scrypt
downloading scrypt-1.2.tgz ...
Starting to download scrypt-1.2.tgz (20,361 bytes)
.......done: 20,361 bytes
17 source files, building
running: phpize
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
whether to enable scrypt support [yes] : yes
building in /tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2
running: /tmp/pear/temp/scrypt/configure --enable-scrypt=yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable scrypt support... yes, shared
checking for clock_gettime in -lrt... yes
checking for library containing clock_gettime... none required
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for struct sysinfo.uptime... no
checking for struct sysinfo.totalram... no
checking emmintrin.h usability... yes
checking emmintrin.h presence... yes
checking for emmintrin.h... yes
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/libtool --mode=compile cc  -I. -I/tmp/pear/temp/scrypt -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/include -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/main -I/tmp/pear/temp/scrypt -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/crypto  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/scrypt/php_scrypt.c -o php_scrypt.lo
mkdir .libs
 cc -I. -I/tmp/pear/temp/scrypt -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/include -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/main -I/tmp/pear/temp/scrypt -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/crypto -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/scrypt/php_scrypt.c  -fPIC -DPIC -o .libs/php_scrypt.o
/bin/sh /tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/libtool --mode=compile cc  -I. -I/tmp/pear/temp/scrypt -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/include -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/main -I/tmp/pear/temp/scrypt -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/crypto  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/scrypt/php_scrypt_utils.c -o php_scrypt_utils.lo
 cc -I. -I/tmp/pear/temp/scrypt -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/include -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/main -I/tmp/pear/temp/scrypt -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/crypto -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/scrypt/php_scrypt_utils.c  -fPIC -DPIC -o .libs/php_scrypt_utils.o
/bin/sh /tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/libtool --mode=compile cc  -I. -I/tmp/pear/temp/scrypt -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/include -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/main -I/tmp/pear/temp/scrypt -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/crypto  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/scrypt/crypto/sha256.c -o crypto/sha256.lo
mkdir crypto/.libs
 cc -I. -I/tmp/pear/temp/scrypt -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/include -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/main -I/tmp/pear/temp/scrypt -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/crypto -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/scrypt/crypto/sha256.c  -fPIC -DPIC -o crypto/.libs/sha256.o
/bin/sh /tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/libtool --mode=compile cc  -I. -I/tmp/pear/temp/scrypt -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/include -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/main -I/tmp/pear/temp/scrypt -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/crypto  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/scrypt/crypto/crypto_scrypt-sse.c -o crypto/crypto_scrypt-sse.lo
 cc -I. -I/tmp/pear/temp/scrypt -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/include -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/main -I/tmp/pear/temp/scrypt -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/tmp/pear/temp/pear-build-rootELnQEw/scrypt-1.2/crypto -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/scrypt/crypto/crypto_scrypt-sse.c  -fPIC -DPIC -o crypto/.libs/crypto_scrypt-sse.o
/tmp/pear/temp/scrypt/crypto/crypto_scrypt-sse.c: In function ‘smix’:
/tmp/pear/temp/scrypt/crypto/crypto_scrypt-sse.c:216:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
         blkcpy((void *)((uintptr_t)(V) + i * 128 * r), X, 128 * r);
                ^
/tmp/pear/temp/scrypt/crypto/crypto_scrypt-sse.c:222:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
         blkcpy((void *)((uintptr_t)(V) + (i + 1) * 128 * r),
                ^
/tmp/pear/temp/scrypt/crypto/crypto_scrypt-sse.c:235:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
         blkxor(X, (void *)((uintptr_t)(V) + j * 128 * r), 128 * r);
                   ^
/tmp/pear/temp/scrypt/crypto/crypto_scrypt-sse.c:242:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
         blkxor(Y, (void *)((uintptr_t)(V) + j * 128 * r), 128 * r);
                   ^
/tmp/pear/temp/scrypt/crypto/crypto_scrypt-sse.c: In function ‘blkxor’:
/tmp/pear/temp/scrypt/crypto/crypto_scrypt-sse.c:76:14: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi]
         D[i] = _mm_xor_si128(D[i], S[i]);
              ^
In file included from /tmp/pear/temp/scrypt/crypto/crypto_scrypt-sse.c:37:0:
/usr/lib/gcc/i686-pc-linux-gnu/5.2.0/include/emmintrin.h:1286:1: error: inlining failed in call to always_inline ‘_mm_xor_si128’: target specific option mismatch
 _mm_xor_si128 (__m128i __A, __m128i __B)
 ^
/tmp/pear/temp/scrypt/crypto/crypto_scrypt-sse.c:76:16: error: called from here
         D[i] = _mm_xor_si128(D[i], S[i]);
                ^
Makefile:187: recipe for target 'crypto/crypto_scrypt-sse.lo' failed
make: *** [crypto/crypto_scrypt-sse.lo] Error 1
ERROR: `make' failed


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-08-06 17:50 UTC] cmb@php.net
-Package: Compile Failure +Package: PECL
 [2015-08-06 17:50 UTC] cmb@php.net
Um, the package should be "scrypt", but this is not available from the select element. It might be best to report this issue directly to <https://github.com/DomBlack/php-scrypt/> anyway.
 [2015-08-06 18:04 UTC] a dot mad dot coder at gmail dot com
Alright. I'll send the bug report to scrypt. Should I close this ticket for now?
 [2015-08-06 20:23 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2015-08-06 20:23 UTC] cmb@php.net
For reference: <https://github.com/DomBlack/php-scrypt/issues/37>.

I'm suspending this ticket for now.
 [2015-08-09 20:02 UTC] dom@php.net
-Status: Suspended +Status: Closed -Assigned To: +Assigned To: dom
 [2015-08-09 20:02 UTC] dom@php.net
Fixed and released in Scrypt v1.3
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 11:01:30 2024 UTC