php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52620 PHP fails to link as gethostuuid(2) does not exist on MacOS 10.4.11
Submitted: 2010-08-16 17:17 UTC Modified: 2010-08-16 21:37 UTC
From: tonywalton at btconnect dot com Assigned: kalle (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.3.3 OS: Mac OS X 10.4.11
Private report: No CVE-ID: None
 [2010-08-16 17:17 UTC] tonywalton at btconnect dot com
Description:
------------
$ uname -a
Darwin Tony-Waltons-MacBook.local 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386
$ './configure' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-ldap=/usr' '--with-kerberos=/usr' '--enable-cli' '--with-zlib-dir=/usr' '--enable-exif' '--enable-ftp' '--enable-mbstring' '--enable-mbregex' '--enable-sockets' '--with-iodbc=/usr' '--with-curl=/usr' '--with-config-file-path=/etc' '--sysconfdir=/private/etc' '--without-pear' '--with-mysql=/usr/local/mysql' '--with-apxs' '--with-jpeg-dir' '--with-gd' '--enable-calendar' 
$ make
(lots of make, some non-fatal errors mainly regarding pointer signedness. Full make output is available if required)


The final link phase fails with

/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols:
_gethostuuid
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1


It seems that the call to gethostuuid() was introduced in PHP 5.3.3  in ext/sqlite3/libsqlite/sqlite3.3 (at line 26934):

/* get the host ID via gethostuuid(), pHostID must point to PROXY_HOSTIDLEN 
** bytes of writable memory.
*/
static int proxyGetHostID(unsigned char *pHostID, int *pError){
  struct timespec timeout = {1, 0}; /* 1 sec timeout */
  
  assert(PROXY_HOSTIDLEN == sizeof(uuid_t));
  memset(pHostID, 0, PROXY_HOSTIDLEN);
  if( gethostuuid(pHostID, &timeout) ){
    int err = errno;
    if( pError ){
      *pError = err;
    }
    return SQLITE_IOERR;
  }

MacOSX 10.4.11 has no gethostuuid(2) call; perhaps configure is at fault and should sense the availability/nonavailability of the system call and fall back to the PHP 5.3.2 behaviour if necessary (5.3.2 compiles and links with no problem on this MacOSX release)

Expected result:
----------------
Clean compile/link

Actual result:
--------------
Link phase fails

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-16 18:22 UTC] tonywalton at btconnect dot com
According to this log from the OpenNMS project, this appears to be a generic 
sqlite3 problem. http://www.opennms.org/~ranger/irc_logs/public/fink-2010-04-
12.log

gethostuuid(2) was introduced in MacOS 10.6 (Snow Leopard). This appears to limit 
PHP to 5.2.2 or below on MacOS X below 10.6
 [2010-08-16 21:37 UTC] kalle@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: kalle
 [2010-08-16 21:37 UTC] kalle@php.net
Please report this upstream to the SQLite project, once a fix is out, the bundled sqlite will be updated
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Dec 06 07:00:02 2025 UTC