Skip to content

Commit ac635ef

Browse files
authored
Suppress cc-wrapper --target mismatch warning on aarch64-darwin (#237)
GNU config.sub normalises to "aarch64-apple-darwin" while Apple's LLVM toolchain (and nix cc-wrapper's @defaultTarget@) uses "arm64-apple-darwin". Older GHC versions pass --target=aarch64-apple-darwin which triggers a noisy warning from the cc-wrapper's add-clang-cc-cflags-before hook on every compiler invocation. The warning is harmless — clang handles both triples identically — but it pollutes stderr and causes thousands of GHC testsuite failures due to unexpected compiler output. Set NIX_CC_WRAPPER_SUPPRESS_TARGET_WARNING=1 in the env script before sourcing stdenv/setup to suppress this warning.
1 parent 10726b9 commit ac635ef

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

flake.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,16 @@
369369
# ''${NIX_ENFORCE_PURITY-1} keep the empty value instead of defaulting.
370370
export NIX_ENFORCE_PURITY=
371371
372+
# Suppress the cc-wrapper --target mismatch warning on aarch64-darwin.
373+
# GNU config.sub normalises to "aarch64-apple-darwin" while Apple's
374+
# LLVM toolchain (and nix cc-wrapper's @defaultTarget@) uses
375+
# "arm64-apple-darwin". GHC passes --target=aarch64-apple-darwin which
376+
# triggers a noisy warning from cc-wrapper's add-clang-cc-cflags-before
377+
# hook. The warning itself is harmless — clang handles both triples
378+
# identically — but it pollutes stderr and causes thousands of GHC
379+
# testsuite failures via unexpected compiler output.
380+
export NIX_CC_WRAPPER_SUPPRESS_TARGET_WARNING=1
381+
372382
# Source stdenv's setup.sh to initialize the development
373383
# environment. This runs all setup hooks (cc-wrapper,
374384
# pkg-config-wrapper, etc.) and populates NIX_CFLAGS_COMPILE,

0 commit comments

Comments
 (0)