Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#54875 closed defect (fixed)

Building with cmake on Xcode 9: Symbol not found: _utimensat

Reported by: mf2k (Frank Schima) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version:
Keywords: sierra Cc: toby@…
Port: cmake cmake-devel libarchive

Description

I'm seeing a build error with glfw-devel. Maybe related to the recent cmake update?

:info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_graphics_glfw/glfw-devel/work/build/src && /opt/local/bin/cmake -E cmake_symlink_library libglfw.3.3.dylib libglfw.3.dylib libglfw.dylib
:info:build dyld: lazy symbol binding failed: Symbol not found: _utimensat
:info:build   Referenced from: /opt/local/bin/cmake
:info:build   Expected in: /usr/lib/libSystem.B.dylib
:info:build dyld: Symbol not found: _utimensat
:info:build   Referenced from: /opt/local/bin/cmake
:info:build   Expected in: /usr/lib/libSystem.B.dylib
:info:build make[2]: *** [src/libglfw.dylib] Abort trap: 6
:info:build make[2]: *** Deleting file `src/libglfw.dylib'
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_graphics_glfw/glfw-devel/work/build'
:info:build make[1]: *** [src/CMakeFiles/glfw.dir/all] Error 2

Attachments (1)

main.log (39.6 KB) - added by mf2k (Frank Schima) 7 years ago.

Download all attachments as: .zip

Change History (19)

Changed 7 years ago by mf2k (Frank Schima)

Attachment: main.log added

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

Port: glfw added; glfw-devel removed

comment:2 Changed 7 years ago by mf2k (Frank Schima)

Summary: glfw-devel: Build errorglfw-devel: Symbol not found: _utimensat

comment:3 Changed 7 years ago by michaelld (Michael Dickens)

Did you update to Xcode 9.0? Which cmake is installed (cmake or cmake-devel)? cmake-devel works for me, using Xcode 9.0.

comment:4 Changed 7 years ago by Schamschula (Marius Schamschula)

comment:5 Changed 7 years ago by mf2k (Frank Schima)

I did install Xcode 9.0. Using only cmake however. I will install cmake-devel now and try with that. Thanks for the suggestion!

comment:6 Changed 7 years ago by raimue (Rainer Müller)

Note the problem will only appear if you rebuild libarchive/cmake from source after installing Xcode 9 with the macOS 10.13 SDK.

comment:7 Changed 7 years ago by mf2k (Frank Schima)

I confirm that using cmake-devel works! Note that I am on 10.12 (Sierra) with Xcode 9.0.

Feel free to close this ticket.

comment:8 in reply to:  6 Changed 7 years ago by michaelld (Michael Dickens)

Replying to raimue:

Note the problem will only appear if you rebuild libarchive/cmake from source after installing Xcode 9 with the macOS 10.13 SDK.

I find it on 10.12 when using CMake 3.9.2 and Xcode 9.0; not cmake-devel 20170919 though. Nothing else changed, just moved from cmake-devel to cmake. I'm updating cmake to 3.9.3 (just released a little bit ago) to see if that fixes the issue (at least for me). I'm betting it will, since the fixes were pushed to it not long ago & should have been in cmake-devel for a while.

comment:9 Changed 7 years ago by raimue (Rainer Müller)

Cc: toby@… added
Keywords: sierra added
Port: cmake cmake-devel libarchive added; glfw removed
Summary: glfw-devel: Symbol not found: _utimensatBuilding with cmake on Xcode 9: Symbol not found: _utimensat

The issue only occurs if cmake was built with Xcode 9 on macOS 10.12. If you get a binary archive from the buildbots, they have been built with Xcode 8 and they will not show this problem.

I doubt cmake 3.9.3 will resolve this, as the merge requests in the cmake upstream ticket have not been merged yet. Also, we are using the external libarchive and not the one bundled with cmake. As I understand this bug we will need to patch libarchive to resolve it completely.

Please mark other reports for the same issue in other ports using cmake as duplicate of this one as it has the most informative discussion.

comment:10 Changed 7 years ago by michaelld (Michael Dickens)

Resolution: duplicate
Status: newclosed

Duplicate of #54875.

comment:11 Changed 7 years ago by michaelld (Michael Dickens)

Resolution: duplicate
Status: closedreopened

comment:12 Changed 7 years ago by michaelld (Michael Dickens)

Oops. Didn't see the title renaming. My bad. I'm working on patches right now.

comment:13 Changed 7 years ago by michaelld (Michael Dickens)

Has duplicate #54876.

comment:14 Changed 7 years ago by michaelld (Michael Dickens)

In 14ca1ce6b3014ab09bf948bf5152e611a95d8696/macports-ports:

libarchive and cmake: add temporary patch to fix building using Xcode 9.0

addresses MacPorts ticket: #54875
see also: https://gitlab.kitware.com/cmake/cmake/issues/17101
and: https://github.com/libarchive/libarchive/pull/953

comment:15 Changed 7 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: reopenedclosed

Done. glfw-devel and gr-lora (from #54876) now build cleanly for me using the latest cmake. Yay!

I'm going to close this ticket as fixed, but if other ports come up with this issue then please list them here & with the log file.

comment:16 Changed 7 years ago by tobypeterson

cmake-devel as well?

comment:17 Changed 7 years ago by tobypeterson

Ah, cmake-devel is a subport, not a separate port.

comment:18 Changed 7 years ago by michaelld (Michael Dickens)

Yup. Both cmake and cmake-devel are covered & both work now in my testing.

Note: See TracTickets for help on using tickets.