#66590 closed defect (fixed)

zig @0.10.0_0 : Failed to build zig - command execution failed

Reported by: dfousek Owned by: felix
Priority: Normal Milestone:
Component: ports Version: 2.8.0
Keywords: Cc: felix@…
Port: zig

Description (last modified by dfousek)

:info:build [100%] Linking CXX executable zig2
:info:build /opt/local/bin/cmake -E cmake_link_script CMakeFiles/zig2.dir/link.txt --verbose=ON
:info:build /opt/local/bin/clang++-mp-15 -pipe -Os -DNDEBUG -I/opt/local/include -stdlib=libc++ -arch x86_64 -mmacosx-version-min=1$
:info:build ld: warning: directory not found for option '-L/opt/local/share/cmake/Modules'
:info:build Undefined symbols for architecture x86_64:
:info:build   "___ulock_wait2", referenced from:
:info:build       _std.Thread.Futex.DarwinImpl.wait in zig2.o
:info:build   "__availability_version_check", referenced from:
:info:build       ___isPlatformVersionAtLeast in zig2.o
:info:build   "_posix_spawn_file_actions_addchdir_np", referenced from:
:info:build       _posix_spawn.Actions.chdirZ in zig2.o
:info:build   "_posix_spawn_file_actions_addfchdir_np", referenced from:
:info:build       _posix_spawn.Actions.fchdir in zig2.o
:info:build ld: symbol(s) not found for architecture x86_64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build make[2]: *** [zig2] Error 1

Change History (5)

comment:1 Changed 23 months ago by dfousek

Description: modified (diff)
Summary: Failed to build zig: command execution failedzig @0.10.0_0 : Failed to build zig - command execution failed

comment:2 Changed 23 months ago by jmroot (Joshua Root)

Cc: felix@… added
Owner: set to felix
Status: newassigned

comment:3 Changed 22 months ago by ylluminarious (George Plymale II)

Similar error occurring on M1 / ARM architectures:

:info:build Undefined symbols for architecture arm64:
:info:build   "_panic_stage", referenced from:
:info:build       _std.debug.panicImpl in zig2.o
:info:build   "_panic_state_raw", referenced from:
:info:build       _crash_report.PanicSwitch.preDispatch in zig2.o
:info:build       _crash_report.PanicSwitch.dispatch in zig2.o
:info:build   "_zir_state", referenced from:
:info:build       _crash_report.AnalyzeBody.push in zig2.o
:info:build       _crash_report.AnalyzeBody.pop in zig2.o
:info:build       _crash_report.dumpStatusReport in zig2.o
:info:build ld: symbol(s) not found for architecture arm64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build make[2]: *** [zig2] Error 1

Also, this affects the ncdu port which relies on Zig as a build dependency.

comment:4 Changed 21 months ago by raxod502 (Radon Rosborough)

I see (a subset of) this error on macOS 10.15 Catalina, specifically:

:info:build Undefined symbols for architecture x86_64:
:info:build   "___ulock_wait2", referenced from:
:info:build       _std.Thread.Futex.DarwinImpl.wait in zig2.o
:info:build ld: symbol(s) not found for architecture x86_64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)

I found an upstream bug report (closed as wontfix) which suggests the observed behavior is by design as support for 10.15 has been dropped: https://github.com/ziglang/zig/issues/13313

comment:5 Changed 20 months ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In 64fb69ba7dfea00c8e9613d8b2a79a6b011e2114/macports-ports (master):

zig: Requires macOS 11 or later

See: ziglang/zig@2d03f389

Closes: #59774
Closes: #64658
Closes: #66590
Closes: #66919

Note: See TracTickets for help on using tickets.