Re: [PATCH 1/1] Fix compilation on mac with Xcode >= 11.4.

From: James Hilliard <james(dot)hilliard1(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH 1/1] Fix compilation on mac with Xcode >= 11.4.
Date: 2020-11-20 01:55:18
Message-ID: CADvTj4rUUeonoofadhhBo9b9TV3DDqQEg9n1NOfWP4V80PqK4Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 19, 2020 at 6:04 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> James Hilliard <james(dot)hilliard1(at)gmail(dot)com> writes:
> > Hmm, maybe it's a more recent issue then, I took the version number
> > from the qt patch assuming it was the same issue, I hit it trying to build
> > master on Xcode 12.2 Build version 12B45b on Catalina version 10.15.7.
>
> Hm, maybe you're using some unusual configure options or weird build
> environment?
>
> The cases we've got in the buildfarm are Xcode 12.0 on Catalina (10.15.7)
> and Xcode 12.2 on Big Sur (11.0.1 ... although that one is ARM not Intel).
> Maybe you're found some corner case in between those, but I guess it's
> more likely due to a configuration choice.
I guess to verify one could try compiling with Xcode 12.2 on catalina 10.15.7.

This looks to be the function using the missing symbols, called by
FD_SET in postgres:

__header_always_inline int
__darwin_check_fd_set(int _a, const void *_b)
{
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability-new"
#endif
if ((uintptr_t)&__darwin_check_fd_set_overflow != (uintptr_t) 0) {
#if defined(_DARWIN_UNLIMITED_SELECT) || defined(_DARWIN_C_SOURCE)
return __darwin_check_fd_set_overflow(_a, _b, 1);
#else
return __darwin_check_fd_set_overflow(_a, _b, 0);
#endif
} else {
return 1;
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
}

Which is located here:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/usr/include/sys/_types/_fd_def.h

The header file indicates the missing symbols are only available in 11.0 and up:
int __darwin_check_fd_set_overflow(int, const void *, int)
__API_AVAILABLE(macosx(11.0), ios(14.0), tvos(14.0), watchos(7.0));

So I think it's fairly clear what's happening now, the linker would normally use
the system libraries to determine that those missing symbols are
weakly linked, but since
the base OS is too old that fails unless we tell the linker where to
look(in the SDK).
>
> regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2020-11-20 01:57:49 Re: xid wraparound danger due to INDEX_CLEANUP false
Previous Message Nail Carpenter 2020-11-20 01:50:46 Re: BUG #16663: DROP INDEX did not free up disk space: idle connection hold file marked as deleted