|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesphp-5.4.21.patch.solaris_atomic (last revision 2013-11-04 14:57 UTC by Pete_Wall at Symantec dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-11-03 11:42 UTC] felipe@php.net
-Status: Open
+Status: Feedback
-Package: *Encryption and hash functions
+Package: Compile Failure
[2013-11-03 11:42 UTC] felipe@php.net
[2013-11-04 14:59 UTC] Pete_Wall at Symantec dot com
[2014-12-30 10:42 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 04:00:02 2025 UTC |
Description: ------------ I'm trying to build PHP 5.4.21 on my Solaris 10 SPARC box, but it's failing when it tries to link in atomic_add_int and membar_producer. Both of those functions are used in ext/standard/php_crypt_r.c: 80 void _crypt_extended_init_r(void) 81 { 82 #ifdef PHP_WIN32 83 LONG volatile initialized = 0; 84 #elif defined(HAVE_ATOMIC_H) /* Solaris 10 defines atomic API within */ 85 volatile unsigned int initialized = 0; 86 #else 87 static volatile sig_atomic_t initialized = 0; 88 #endif 89 90 #ifdef ZTS 91 tsrm_mutex_lock(php_crypt_extended_init_lock); 92 #endif 93 94 if (!initialized) { 95 #ifdef PHP_WIN32 96 InterlockedIncrement(&initialized); 97 #elif defined(HAVE_SYNC_FETCH_AND_ADD) 98 __sync_fetch_and_add(&initialized, 1); 99 #elif defined(HAVE_ATOMIC_H) /* Solaris 10 defines atomic API within */ 100 membar_producer(); 101 atomic_add_int(&initialized, 1); 102 #endif 103 _crypt_extended_init(); 104 } 105 #ifdef ZTS 106 tsrm_mutex_unlock(php_crypt_extended_init_lock); 107 #endif 108 } On my version of glibc, atomic_add_int() and membar_producer aren't defined. $ nm -g /lib/libc.so.1 | grep atomic_add_int $ nm -g /lib/libc.so.1 | grep membar_producer Compiler and configuration info: CFLAGS="" CPPFLAGS=" -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" ./configure --disable-cgi --enable-cli --prefix="/path/to/php" --with-libxml-dir="/path/to/libxml" --with-openssl=shared,"/path/to/openssl" --with-zlib="/path/to/zlib" --with-curl=shared,"/path/to/curl" --with-config-file-path=/path/to/cfgfile --with-layout=GNU --with-regex=php --with-tsrm-pthreads --disable-rpath --disable-sysvsem --disable-sysvshm --disable-sysvmsg --disable-bcmath --disable-ctype --disable-exif --disable-spl --disable-ftp --disable-shmop --enable-tokenizer --disable-static --enable-posix=shared --enable-session=shared --enable-sockets=shared --enable-xml=shared --enable-pcntl=shared --enable-dom --without-mm --without-gettext --without-iconv --without-sqlite --without-mime-magic --without-mysql --without-sybase-ct --without-gdbm --without-db4 --without-cdb --without-pear --without-xsl --disable-debug --with-pcre-dir="/path/to/pcre" --with-pcre-regex $ gcc -v Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++,f77 Thread model: posix gcc version 3.4.6 $ uname -a SunOS grampa 5.10 Generic sun4u sparc SUNW,Sun-Fire-V210 Snippet from configure output: checking atomic.h usability... yes checking atomic.h presence... yes checking for atomic.h... yes Expected result: ---------------- Successful linking Actual result: -------------- Undefined first referenced symbol in file atomic_add_int ext/standard/.libs/php_crypt_r.o membar_producer ext/standard/.libs/php_crypt_r.o ld: fatal: Symbol referencing errors. No output written to sapi/cli/php collect2: ld returned 1 exit status make: *** [sapi/cli/php] Error 1