php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45907 undefined reference to `PHP_SHA512Init'
Submitted: 2008-08-25 10:13 UTC Modified: 2008-10-09 00:52 UTC
From: olivier at ajeux dot com Assigned: cellog (profile)
Status: Closed Package: PHAR related
PHP Version: 5.3CVS-2008-09-29 (snap) OS: Linux i686 2.6.17
Private report: No CVE-ID: None
 [2008-08-25 10:13 UTC] olivier at ajeux dot com
Description:
------------
When compiling php5.3-200808250830:

ext/phar/.libs/util.o: In function `phar_create_signature':
/source/php/php5.3-200808250830/ext/phar/util.c:2046: undefined reference to `PHP_SHA512Init'
/source/php/php5.3-200808250830/ext/phar/util.c:2049: undefined reference to `PHP_SHA512Update'
/source/php/php5.3-200808250830/ext/phar/util.c:2052: undefined reference to `PHP_SHA512Final'
/source/php/php5.3-200808250830/ext/phar/util.c:2061: undefined reference to `PHP_SHA256Init'
/source/php/php5.3-200808250830/ext/phar/util.c:2064: undefined reference to `PHP_SHA256Update'
/source/php/php5.3-200808250830/ext/phar/util.c:2067: undefined reference to `PHP_SHA256Final'
ext/phar/.libs/util.o: In function `phar_verify_signature':
/source/php/php5.3-200808250830/ext/phar/util.c:1915: undefined reference to `PHP_SHA256Init'
/source/php/php5.3-200808250830/ext/phar/util.c:1925: undefined reference to `PHP_SHA256Update'
/source/php/php5.3-200808250830/ext/phar/util.c:1882: undefined reference to `PHP_SHA512Init'
/source/php/php5.3-200808250830/ext/phar/util.c:1892: undefined reference to `PHP_SHA512Update'
/source/php/php5.3-200808250830/ext/phar/util.c:1899: undefined reference to `PHP_SHA512Final'
/source/php/php5.3-200808250830/ext/phar/util.c:1932: undefined reference to `PHP_SHA256Final'
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1

Same result with php5.3-200808211030 and all releases since (don't know if it happened before).


Configure line :
./configure  --prefix=/usr --sysconfdir=/etc/php53 --libdir=/usr/lib/php53 --mandir=/usr/share/man --program-suffix=53 --with-layout=GNU --enable-sigchild --disable-rpath --enable-libxml --enable-bcmath=shared --enable-calendar=shared --enable-ctype=shared --enable-dom=shared --enable-exif=shared --enable-filter --enable-ftp=shared --enable-gd-native-ttf --enable-gd-jis-conv --enable-hash=shared --enable-json=shared --enable-mbstring=shared --enable-pcntl=shared --enable-posix=shared --enable-shmop=shared --enable-simplexml --enable-soap=shared --enable-sockets=shared --enable-sqlite-utf8 --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared --enable-tokenizer=shared --enable-wddx=shared --enable-xml --enable-xmlreader=shared --enable-xmlwriter=shared --enable-zip=shared --enable-zend-multibyte --disable-static --with-libdir=lib --with-openssl=shared --with-pcre-regex=/usr --with-zlib=shared --with-bz2=shared --with-curl=shared --with-curlwrappers --with-pcre-dir --with-gd=shared --with-jpeg-dir --with-png-dir --with-freetype-dir --with-t1lib --with-gettext=shared --with-iconv=shared --with-imap=shared --with-imap-ssl --with-ldap=shared --with-ldap-sasl --with-mcrypt=shared --with-mhash=shared --with-ming=shared --with-mssql=shared --with-mysql=shared --with-mysqli=shared --enable-pdo=shared --with-pdo-dblib=shared --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-pspell=shared --with-readline=shared --with-sqlite=shared --with-xmlrpc=shared --with-xsl=shared --with-pic




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-01 12:50 UTC] webmaster at ajeux dot com
Hello,

Same bug with php5.3-200809011230 (different line number though).

ext/phar/.libs/util.o: In function `phar_create_signature':
/source/php/php5.3-200809011230/ext/phar/util.c:2047: undefined reference to `PHP_SHA512Init'
/source/php/php5.3-200809011230/ext/phar/util.c:2050: undefined reference to `PHP_SHA512Update'

[...]
 [2008-09-06 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2008-09-29 10:36 UTC] olivier at ajeux dot com
Tested again with php5.3 200809290830

Same bug.

ext/phar/.libs/util.o: In function `phar_create_signature':
/usr/src/php5.3-200809290830/ext/phar/util.c:2047: undefined reference to `PHP_SHA512Init'
/usr/src/php5.3-200809290830/ext/phar/util.c:2050: undefined reference to `PHP_SHA512Update'
/usr/src/php5.3-200809290830/ext/phar/util.c:2053: undefined reference to `PHP_SHA512Final'
/usr/src/php5.3-200809290830/ext/phar/util.c:2062: undefined reference to `PHP_SHA256Init'
/usr/src/php5.3-200809290830/ext/phar/util.c:2065: undefined reference to `PHP_SHA256Update'
/usr/src/php5.3-200809290830/ext/phar/util.c:2068: undefined reference to `PHP_SHA256Final'
ext/phar/.libs/util.o: In function `phar_verify_signature':
/usr/src/php5.3-200809290830/ext/phar/util.c:1916: undefined reference to `PHP_SHA256Init'
/usr/src/php5.3-200809290830/ext/phar/util.c:1926: undefined reference to `PHP_SHA256Update'
/usr/src/php5.3-200809290830/ext/phar/util.c:1883: undefined reference to `PHP_SHA512Init'
/usr/src/php5.3-200809290830/ext/phar/util.c:1893: undefined reference to `PHP_SHA512Update'
/usr/src/php5.3-200809290830/ext/phar/util.c:1900: undefined reference to `PHP_SHA512Final'
/usr/src/php5.3-200809290830/ext/phar/util.c:1933: undefined reference to `PHP_SHA256Final'
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1
 [2008-09-29 12:04 UTC] sfox@php.net
Can someone please confirm that this occurs only when ext/hash is built as shared?
 [2008-09-29 12:44 UTC] olivier at ajeux dot com
New configure/make without "--enable-hash=shared" (replaced with "--enable-hash"): OK
Build complete.
 [2008-09-29 14:31 UTC] johannes@php.net
Greg, please have a look. Phar should properly check for the existence of hash imo.
 [2008-09-29 23:57 UTC] cellog@php.net
I think we can fix this by using php_hash_sha256_ops and php_hash_sha512_ops to extract the actual address of PHP_SHA512Init and company, will try a fix later if I have time, otherwise tomorrow.  Unless Steph beats me to it (check php_hash.h and hash_sha.c, searching for php_hash_sha256_ops to see what I'm talking about)
 [2008-09-30 00:02 UTC] cellog@php.net
another update: this should be completely unnecessary as we include ext/hash/php_hash_sha.h which has:

PHP_HASH_API void PHP_SHA256Init(PHP_SHA256_CTX *);

all defined properly

I wonder if building hash shared prevents the proper export of this function?
 [2008-09-30 11:25 UTC] sfox@php.net
Sorry Greg, would if I could but still have no way to build 5.3. I'll poke Marcus.
 [2008-10-09 00:52 UTC] cellog@php.net
This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.

Unfortunately, the fix is removing support for ext/hash if it is built shared.  This could be revisited in a future release, but would involve extensive code changes to call the PHP versions of hash_init() rather than the C versions, something I don't want to do until 5.3.0 is released.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 05:01:29 2024 UTC