php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68419 build error with gmp 4.1
Submitted: 2014-11-14 09:15 UTC Modified: 2014-11-19 18:50 UTC
From: petr at jisa dot eu Assigned: remi (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.6.3 OS: centos5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: petr at jisa dot eu
New email:
PHP Version: OS:

 

 [2014-11-14 09:15 UTC] petr at jisa dot eu
Description:
------------
Can't build --with-gmp on centos5. There is gmp.x86_64 4.1.4-10.el5

build error: too few arguments to function ‘__gmp_randinit_lc_2exp’

static void gmp_init_random(TSRMLS_D)
...
#if GMP_42_OR_NEWER
                gmp_randinit_mt(GMPG(rand_state));
#else
                gmp_randinit_lc_2exp(GMPG(rand_state), 32L);   << this line
#endif
...

last 5.4.35 5.5.19 and previous PHP 5.6.2 versions are ok

centos6 (gmp-4.3.1-7.el6_2.2.x86_64) builds without problem



Test script:
---------------
./configure ... --with-gmp ... && make
....
/usr/src/php-5.6.3/ext/gmp/gmp.c: In function ‘gmp_init_random’:
/usr/src/php-5.6.3/ext/gmp/gmp.c:1779: warning: passing argument 2 of ‘__gmp_randinit_lc_2exp’ makes pointer from integer without a cast
/usr/src/php-5.6.3/ext/gmp/gmp.c:1779: error: too few arguments to function ‘__gmp_randinit_lc_2exp’


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-14 09:53 UTC] remi@php.net
-Assigned To: +Assigned To: remi
 [2014-11-14 09:53 UTC] remi@php.net
-Status: Assigned +Status: Closed
 [2014-11-14 09:53 UTC] remi@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

See http://git.php.net/?p=php-src.git;a=commitdiff;h=1b156207446e0c5ec8a9476ad0966b5daa82f516
 [2014-11-19 18:50 UTC] leigh@php.net
Hi, this was my fault, and yes it was completely by accident.

I originally changed the default RNG to MT, without realising I had to cater for pre-4.2

When I added the conditional to use the LCG for pre-4.2 I missed the _size off. 

Sorry! Thanks for the patch Remi.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Feb 02 17:01:31 2025 UTC