rpm rebuild php5.4.20 with --enable-maintainer-zts failed

Hello

i tried to rebuild the src.rpm from OpenSuSE 13.1 php.5.4.20 to enable zts to build php with phtreads.
But it fails with:

/usr/src/packages/BUILD/php-5.4.20/ext/standard/crypt.c: In function ‘zif_crypt’:
/usr/src/packages/BUILD/php-5.4.20/ext/standard/crypt.c:292:6: error: #error Data struct used by crypt_r() is unknown. Please report.

error Data struct used by crypt_r() is unknown. Please report.

  ^

/usr/src/packages/BUILD/php-5.4.20/ext/standard/crypt.c:294:35: error: ‘buffer’ undeclared (first use in this function)
crypt_res = crypt_r(str, salt, &buffer);
^
/usr/src/packages/BUILD/php-5.4.20/ext/standard/crypt.c:294:35: note: each undeclared identifier is reported only once for each function it appears in
make: *** [ext/standard/crypt.lo] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.mEFB53 (%build)

how can i fix this ?
without --enable-maintainer-zts build runs ok.

Best Regards
Torsten

Older openSUSE src rpm’s of php5 used to fail compilation with it. Have you tried grabbing the 5.4.37 src from dev repo, I would recommend running it anyway since it contains patches that the 5.4.20 does not and it’s pretty much a drop-in replacement (I run it on some older installations with zero issues).

http://download.opensuse.org/repositories/devel:/languages:/php:/php54/openSUSE_13.1/

i also tried with php-5.6.5 from devel:languages:php with no luck
and know with 5.4.37 the same

/usr/src/packages/BUILD/php-5.4.37/ext/standard/crypt.c: In function ‘zif_crypt’:
/usr/src/packages/BUILD/php-5.4.37/ext/standard/crypt.c:291:6: error: #error Data struct used by crypt_r() is unknown. Please report.

error Data struct used by crypt_r() is unknown. Please report.

  ^

/usr/src/packages/BUILD/php-5.4.37/ext/standard/crypt.c:293:35: error: ‘buffer’ undeclared (first use in this function)
crypt_res = crypt_r(str, salt, &buffer);
^
/usr/src/packages/BUILD/php-5.4.37/ext/standard/crypt.c:293:35: note: each undeclared identifier is reported only once for each function it appears in
make: *** [ext/standard/crypt.lo] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.LiVU9t (%build)

is it a SuSE problem ?

BR/Torsten

i know build from original php 5.4.37 source from php.net
and build is ok.

So there must some patches in the rpm to make this error

Most likely due to the openssl patches included - unfortunately I’m not at home and I’m “on the road” so I can’t debug the issue further until monday.

If you want a “thread safe” php, you should really use nginx+php-fpm if you ask me :slight_smile:

i know remove
#Patch16: php5-crypt-tests.patch
from the OpenSuSE php5.4.37src.rpm
then i also have to remove the
#Patch23: php5-custom-tmp-dir.patch

know the build runs, but rpm can not pack because #Patch15: php5-gcc_builtins.patch file is missing
in the SOURCE aaaaahhahaahahhahahaha, how SuSE have build this ? There is a missing file.

So hopefully it know works.

I will build the php cli with the pecl pthreads extension to run a robo script
to control Bluetooth, Speech and Gamepade for steering the tank, i don’t need it for the webserver.

Thank your for your help!

BR/Torsten

If you remove Patch:'s from the .spec, you also need to remove the patch application later on in the .spec file, usually %patchxx or %patchxx -p1.

If you can’t get it to compile, I can provide you with binary files for 5.6.5 which I compiled in a VM to test it.


magellan:~ # php -v
PHP 5.6.5 (cli) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
    with Suhosin v0.9.36, Copyright (c) 2007-2014, by SektionEins GmbH


magellan:~ # php -i | grep -i thread
Thread Safety => enabled