Skip to content

Build fixes for macOS#133

Open
nGoline wants to merge 4 commits into
rustyrussell:masterfrom
nGoline:macos-build-support
Open

Build fixes for macOS#133
nGoline wants to merge 4 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 added 4 commits July 3, 2026 14:41
Apple clang does not accept -Wshadow=local, so `make` fails immediately
on macOS. Probe the compiler and add the flag only when it is accepted,
keeping the warning on GCC/newer clang.
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.
@nGoline nGoline requested review from ddustin and rustyrussell July 3, 2026 17:54
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.

1 participant