Opened 4 years ago

Closed 4 years ago

#61168 closed defect (duplicate)

php72-apache2handler 7.2.33_0 does not build

Reported by: josephsacco Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: Cc:
Port: php

Description (last modified by ryandesign (Ryan Carsten Schmidt))

There is a problem building the latest upgrades for php-apache2hander [php72 & php73; php74 is OK] under OS X 10.15.6:

/main/reentrancy.c:139:23: error: too few arguments to function call, expected 3, have 2
        readdir_r(dirp, entry);
        ~~~~~~~~~            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/dirent.h:110:1: note: 'readdir_r' declared here
int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r);
^
1 error generated.

Looking at the source code, the problem is here:

#if !defined(HAVE_POSIX_READDIR_R)

PHPAPI int php_readdir_r(DIR *dirp, struct dirent *entry,
        struct dirent **result)
{
#if defined(HAVE_OLD_READDIR_R)
    int ret = 0;

    /* We cannot rely on the return value of readdir_r
       as it differs between various platforms
       (HPUX returns 0 on success whereas Solaris returns non-zero)
     */
    entry->d_name[0] = '\0';
    readdir_r(dirp, entry);

    if (entry->d_name[0] == '\0') {
        *result = NULL;
        ret = errno;
    } else {
        *result = entry;
    }
    return ret;
#else
    struct dirent *ptr;
    int ret = 0;

    local_lock(READDIR_R);

    errno = 0;

    ptr = readdir(dirp);

    if (!ptr && errno != 0)
        ret = errno;

    if (ptr)
        memcpy(entry, ptr, sizeof(*ptr));

    *result = ptr;

    local_unlock(READDIR_R);

    return ret;
#endif

-Joseph

Change History (6)

comment:1 Changed 4 years ago by mf2k (Frank Schima)

Keywords: apache2handler removed
Owner: set to ryandesign
Port: php added; php-apache2handler removed
Status: newassigned

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

As I recall this is specific to using the Xcode 12 command line tools. I intend to fix that but until then, use the Xcode 11 command line tools.

comment:3 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

comment:4 Changed 4 years ago by josephsacco

Maybe the choice of Xcode version is more fine grained:

cavandish:~ jsacco$ xcodebuild -version
Xcode 11.7
Build version 11E801a

-Joseph

comment:5 Changed 4 years ago by josephsacco

The culprit is the choice of command line tools:

cavandish:SDKs jsacco$ ls -l
total 0
lrwxr-xr-x  1 root  wheel   11 Sep 13 16:12 MacOSX.sdk -> MacOSX10.15.sdk
drwxr-xr-x  7 root  wheel  224 Aug 14 16:25 MacOSX10.14.sdk
drwxr-xr-x  8 root  wheel  256 Aug 19 09:42 MacOSX10.15.sdk
drwxr-xr-x  8 root  wheel  256 Sep 13 16:11 MacOSX11.0.sdk

Redirecting the link to point at MacOS10.15.sdk rather than MacOS11.0.sdk resolves the build problem for php72 & php73.

-Joseph

comment:6 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: duplicate
Status: assignedclosed

Don't redirect any links.

The MacOSX11.0.sdk is only included in beta versions of Xcode and its command line tools at this point. The final release of Xcode 12 and its command line tools does not contain it.

Duplicate of #60988.

Note: See TracTickets for help on using tickets.