From: "himura467 (Akito Shitara) via ruby-core" Date: 2026-09-13T21:57:33+00:00 Subject: [ruby-core:126678] [Ruby Bug#22311] Build crashes on macOS 26 with the macOS 27 SDK because pipe2() and dup3() are unavailable Issue #22311 has been reported by himura467 (Akito Shitara). ---------------------------------------- Bug #22311: Build crashes on macOS 26 with the macOS 27 SDK because pipe2() and dup3() are unavailable https://bugs.ruby-lang.org/issues/22311 * Author: himura467 (Akito Shitara) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- ## Environment - macOS 26.6.2 - Command Line Tools with MacOSX27.0.sdk (default `MacOSX.sdk`) - Apple clang version 21.0.0 (clang-2100.3.34.2) ## Steps to reproduce ./autogen.sh mkdir build && cd build ../configure make ## Result The build warns about `dup3` and `pipe2`, and then miniruby crashes: ../io.c:389:19: warning: 'dup3' is only available on macOS 27.0 or newer [-Wunguarded-availability-new] ../io.c:432:18: warning: 'pipe2' is only available on macOS 27.0 or newer [-Wunguarded-availability-new] ../io.c:8141:18: warning: 'pipe2' is only available on macOS 27.0 or newer [-Wunguarded-availability-new] ... make: *** [uncommon.mk:1331: builtin_binary.rbbin] Segmentation fault: 11 ## Cause The macOS 27 SDK declares `dup3()` and `pipe2()` as available since macOS 27.0. `AC_CHECK_FUNCS` links them without including headers, so configure defines `HAVE_DUP3` and `HAVE_PIPE2`. In io.c, they are weakly linked through the header and are NULL at runtime on macOS 26. $ nm -m miniruby | grep -E '_(pipe2|dup3) ' (undefined) weak external _dup3 (from libSystem) (undefined) weak external _pipe2 (from libSystem) ## Notes Autoconf 2.73 makes `AC_CHECK_DECL` report "no" for such functions on macOS. https://github.com/autotools-mirror/autoconf/blob/0a51305fff8847edd3e9da9e538e40c539027aed/NEWS#L125-L126 -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/