Skip to content

Conversation

@native-api
Copy link
Member

Citing https://www.postgrespro.ru/list/id/E1kfzRR-0001EH-Ph@gemulon.postgresql.org fixing the same problem:
We previously put the -isysroot switch only into CPPFLAGS, theorizing that it was only needed to find the right copies of include files. However, it seems that we also need to use it while linking programs, to find the right stub ".tbd" files for libraries. We got away without that up to now, but apparently that was mostly luck. It may also be that failures are only observed when the Xcode version is noticeably out of sync with the host macOS version; the case that's prompting action right now is that builds fail when using latest Xcode (12.2) on macOS Catalina, even though it's fine on Big Sur.

Specifically, the problem arises for preadv' and pwritev' (new in MacOS 11 Big Sur) when building with XCode 12.4 (supporting Big Sur) in MacOS 10.15 Catalina.

Make sure you have checked all steps below.

Prerequisite

  • Please consider implementing the feature as a hook script or plugin as a first step.
    • pyenv has some powerful support for plugins and hook scripts. Please refer to Authoring plugins for details and try to implement it as a plugin if possible.
  • Please consider contributing the patch upstream to rbenv, since we have borrowed most of the code from that project.
    • We occasionally import the changes from rbenv. In general, you can expect changes made in rbenv will be imported to pyenv too, eventually.
    • Generally speaking, we prefer not to make changes in the core in order to keep compatibility with rbenv.
  • My PR addresses the following pyenv issue (if any)

Description

  • Here are some details about my PR
    see above

Tests

  • My PR adds the following unit tests (if any)
    N/A

…de is for a newer major MacOS version

Citing https://www.postgrespro.ru/list/id/E1kfzRR-0001EH-Ph@gemulon.postgresql.org
fixing the same problem:
We previously put the -isysroot switch only into CPPFLAGS, theorizing
that it was only needed to find the right copies of include files.
However, it seems that we also need to use it while linking programs,
to find the right stub ".tbd" files for libraries.  We got away
without that up to now, but apparently that was mostly luck.  It may
also be that failures are only observed when the Xcode version is
noticeably out of sync with the host macOS version; the case that's
prompting action right now is that builds fail when using latest Xcode
(12.2) on macOS Catalina, even though it's fine on Big Sur.

Specifically, the problem arises for `preadv' and `pwritev' (new in MacOS 11 Big Sur) when building with XCode 12.4 (supporting Big Sur) in MacOS 10.15 Catalina.
@native-api native-api requested review from a team as code owners December 1, 2025 18:52
@native-api native-api changed the title Fix "ld: symbol(s) not found" in MacOS if XCode is for a newer major MacOS version Fix "ld: symbol(s) not found" in some MacOS versions if XCode is for a newer major MacOS version Dec 1, 2025
@native-api native-api merged commit 94e4bf0 into pyenv:master Dec 1, 2025
19 checks passed
@native-api native-api deleted the xcode_newer_macos branch December 1, 2025 19:01
@native-api native-api changed the title Fix "ld: symbol(s) not found" in some MacOS versions if XCode is for a newer major MacOS version Fix "ld: symbol(s) not found" for C system calls in some MacOS versions if XCode is for a newer major MacOS version Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyenv 2.6.8 (PR #3301) breaks builds on OSX Catalina CLT only

1 participant