Opened 7 months ago

Last modified 4 months ago

#68163 assigned defect

lldb-12 @12.0.1: error: 'ptsname_r' is only available on macOS 10.13.4 or newer

Reported by: mascguy (Christopher Nielsen) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: highsierra Cc: cjones051073 (Chris Jones), kencu (Ken)
Port: lldb-12

Description

Details:

.../lldb-12/work/llvm-project-12.0.1.src/lldb/source/Host/common/PseudoTerminal.cpp:108:11:
error: 'ptsname_r' is only available on macOS 10.13.4 or newer [-Werror,-Wunguarded-availability-new]
  int r = ptsname_r(m_primary_fd, buf, sizeof(buf));
          ^~~~~~~~~

/usr/include/stdlib.h:229:5: note: 'ptsname_r' has been marked as being introduced in macOS 10.13.4 here, but the deployment target is macOS 10.13.0

int ptsname_r(int fildes, char *buffer, size_t buflen) __API_AVAILABLE(macos(10.13.4), ios(11.3), tvos(11.3), watchos(4.3));
    ^

.../lldb-12/work/llvm-project-12.0.1.src/lldb/source/Host/common/PseudoTerminal.cpp:108:11:
note: enclose 'ptsname_r' in a __builtin_available check to silence this warning
  int r = ptsname_r(m_primary_fd, buf, sizeof(buf));
          ^~~~~~~~~

1 error generated.

Is this simply a matter of updating the deployment target to 10.13.4+...?

Change History (2)

comment:1 Changed 7 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: highsierra added
Summary: lldb-12: build fails for 10.13 buildbot:lldb-12 @12.0.1: error: 'ptsname_r' is only available on macOS 10.13.4 or newer

Here is how we worked around this in another port:

comment:ticket:59921:14

I'm not sure if that was the right fix, whether it would work for this port, or whether changing the deployment target instead would have worked. I don't know whether deployment targets having more than two dot-separated numbers are possible, but I think maybe they are? Obviously, setting the deployment target to 10.13.4 on macOS 10.13.x would make the port not work on 10.13.0–10.13.3, but it may be that that is already the case, and we probably don't need to care about outdated macOS versions; anyone running 10.13.x should be running it fully updated.

comment:2 Changed 4 months ago by tomio-arisaka (Tomio Arisaka)

On macOS 10.13.6, I tried to install LLDB-12, then I got the same error. The error is caused due to the option -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" of cmake in the configure phase.

So here is my workaround:

$ sudo port install lldb-12 macosx_deployment_target=10.13.6
Note: See TracTickets for help on using tickets.