php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70641 Compile fails for ext/standard/random.c
Submitted: 2015-10-05 12:07 UTC Modified: 2015-10-05 15:15 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: sascha dot pfalz at ivz dot de Assigned:
Status: Closed Package: Compile Failure
PHP Version: 7.0.0RC4 OS: RHEL 5.7
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: sascha dot pfalz at ivz dot de
New email:
PHP Version: OS:

 

 [2015-10-05 12:07 UTC] sascha dot pfalz at ivz dot de
Description:
------------
Trying to compile the sources gave the following error:

In file included from /usr/src/php-7.0.0RC4/ext/standard/random.c:35:
/usr/include/linux/random.h:38: error: expected specifier-qualifier-list before ‘__u32’
/usr/include/linux/random.h:42: error: expected specifier-qualifier-list before ‘__u32’
make: *** [ext/standard/random.lo] Error 1

Looking at the source, there is  the following include part:

#ifdef __linux__
# include <linux/random.h>
#endif

I've commented the whole section and the code compiles. 
Uncommented it again and got the described error. The compile works with this section commented out.

My configure line:

CFLAGS="-m64 -O3 -pipe" CXXFLAGS="${CFLAGS}" ./configure \
--with-libdir=lib64 \
--with-apxs2=/opt/apache22/bin/apxs \
--enable-fpm \
--enable-phpdbg \
--enable-phpdbg-webhelper \
--with-config-file-path=/opt/apache22/conf/php70 \
--with-config-file-scan-dir=/opt/apache22/conf/php70/php.d \
--enable-sigchild \
--with-libxml-dir=/usr \
--with-openssl=/opt/openssl \
--with-system-ciphers \
--with-pcre-regex \
--with-zlib=/usr \
--enable-bcmath \
--with-bz2=/usr \
--enable-calendar \
--with-curl=/usr \
--enable-dba \
--with-gdbm=/usr \
--with-db4=/usr \
--with-libxml-dir=/usr \
--enable-exif \
--enable-ftp \
--with-openssl-dir=/opt/openssl \
--with-gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-xpm-dir=/usr \
--with-freetype-dir=/usr \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-gettext=/usr \
--with-gmp=/opt/gmp6 \
--with-mhash \
--with-imap=/usr/local/php-imap \
--without-kerberos \
--with-imap-ssl=/opt/openssl \
--enable-intl \
--with-icu-dir=/opt/icu \
--with-ldap \
--with-ldap-sasl \
--enable-mbstring \
--with-libmbfl \
--with-mcrypt \
--with-mysqli=mysqlnd \
--with-mysql-sock=/var/lib/mysql/mysql.sock \
--with-oci8 \
--enable-pcntl \
--with-pdo-mysql=mysqlnd \
--with-zlib-dir=/usr \
--with-pdo-oci \
--with-readline=/usr \
--enable-shmop \
--with-libxml-dir=/usr \
--without-snmp \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-libxml-dir=/usr \
--enable-zip \
--with-pear=/opt/apache22/PEAR \
--with-xsl \
--enable-mysqlnd \
--with-xmlrpc

On this box I've had PHP 5.6.x series compiled so far without any problems.


Patches

add-identifier__u32-define (last revision 2015-10-06 11:30 UTC by zhangji_361 at 163 dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-05 15:05 UTC] security at paragonie dot com
As someone who doesn't own an RHEL license, I can't say I know what their copy of /usr/include/linux/random.h is doing. Could you pastebin it for me?
 [2015-10-05 15:15 UTC] security at paragonie dot com
https://github.com/torvalds/linux/blob/master/include/linux/random.h

https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/vmwgfx/device_include/vm_basic_types.h#L5

Actually, it looks like this header file isn't at all necessary for getrandom(2).
 [2015-10-05 15:15 UTC] tyrael@php.net
usually you can repro rhel specific problems on centos too.
 [2015-10-05 15:41 UTC] security at paragonie dot com
https://github.com/php/php-src/pull/1550

This should address compatibility issues.
 [2015-10-05 23:03 UTC] bwoebi@php.net
Automatic comment on behalf of scott@paragonie.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=63617a678f51d07d7e1843221afffe9a8b31c624
Log: Fixed bug #70641 (Random_* - Better compatibility on Linux distros)
 [2015-10-05 23:03 UTC] bwoebi@php.net
-Status: Open +Status: Closed
 [2015-10-05 23:03 UTC] bwoebi@php.net
Automatic comment on behalf of scott@paragonie.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=63617a678f51d07d7e1843221afffe9a8b31c624
Log: Fixed bug #70641 (Random_* - Better compatibility on Linux distros)
 [2015-10-06 11:28 UTC] jimmyjzhang at tencent dot com
just modify random.c and add <linux/types.h> would fix this bug
 [2015-10-13 10:12 UTC] ab@php.net
Automatic comment on behalf of scott@paragonie.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=63617a678f51d07d7e1843221afffe9a8b31c624
Log: Fixed bug #70641 (Random_* - Better compatibility on Linux distros)
 [2016-07-20 11:36 UTC] davey@php.net
Automatic comment on behalf of scott@paragonie.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=63617a678f51d07d7e1843221afffe9a8b31c624
Log: Fixed bug #70641 (Random_* - Better compatibility on Linux distros)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 07 12:01:35 2025 UTC