Skip to content

Build fixes for macOS - #133

Merged
rustyrussell merged 3 commits into
rustyrussell:masterfrom
nGoline:macos-build-support
Aug 19, 2026
Merged

rustyrussell merged 3 commits into
rustyrussell:masterfrom
nGoline:macos-build-support

Conversation

@nGoline

@nGoline nGoline commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Four independent fixes so ccan builds on macOS with Apple clang. Each is a separate commit.

  • build: probe for -Wshadow=local — Apple clang rejects this flag, so make fails immediately. Add it only when the compiler accepts it (kept on GCC/newer clang).
  • coroutine: runtime MINSIGSTKSZ on macOS 14+ — on macOS 14+ MINSIGSTKSZ expands to a runtime value, not a compile-time constant, so it can't be used in BUILD_ASSERT. Use a runtime check on Apple platforms; keep the compile-time assertion elsewhere.
  • create-ccan-tree: use GNU getopt — macOS ships BSD getopt, which lacks --long. Prefer a Homebrew gnu-getopt if present, else detect GNU getopt via its --test exit code and fail with a helpful message.
  • gitignore: ignore *.dSYM — macOS/clang emits .dSYM debug-symbol bundles next to built binaries.

No functional change on Linux.

@nGoline
nGoline requested review from ddustin and rustyrussell July 3, 2026 17:54
On macOS 14+ MINSIGSTKSZ expands to a runtime value, not a compile-time
constant, so it cannot be used in BUILD_ASSERT. Fall back to a runtime
check on Apple platforms while keeping the compile-time assertion
elsewhere.
macOS ships BSD getopt, which lacks the --long option this script relies
on. Prefer a Homebrew gnu-getopt if present, otherwise detect GNU getopt
via its --test exit code and fail with a helpful message if unavailable.
macOS/clang emits .dSYM debug-symbol bundles next to built binaries.
@rustyrussell

Copy link
Copy Markdown
Owner

This is great! I ended up with the same fix for the -Wshadow issue as you already merged, so I dropped that and merging the rest.

@rustyrussell
rustyrussell merged commit e97650d into rustyrussell:master Aug 19, 2026
4 checks passed
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.

2 participants