|  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
 [2014-11-14 09:15 UTC] petr at jisa dot eu
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)
                gmp_randinit_lc_2exp(GMPG(rand_state), 32L);   << this line

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’


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-14 09:53 UTC]
-Assigned To: +Assigned To: remi
 [2014-11-14 09:53 UTC]
-Status: Assigned +Status: Closed
 [2014-11-14 09:53 UTC]
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

 For Windows:
Thank you for the report, and for helping us make PHP better.

 [2014-11-19 18:50 UTC]
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Feb 23 18:01:28 2024 UTC