ghc: fix c++ linkage and c standard for < 9.10 on darwin

This commit is contained in:
Kirill Radzikhovskyy
2026-05-08 11:06:42 +10:00
parent 42812103a7
commit 94fda3c5d0
2 changed files with 10 additions and 0 deletions

View File

@@ -696,6 +696,11 @@ stdenv.mkDerivation (
configureFlags = [
"--datadir=$doc/share/doc/ghc"
]
# ghc 9.10 and later use c17 by default. we use gnu17 on darwin for older
# ghc versions to match this and fix build issues with newer clang.
++ lib.optionals (hostPlatform.isDarwin && lib.versionOlder version "9.10") [
"CFLAGS=-std=gnu17"
]
++ lib.optionals enableTerminfo [
"--with-curses-includes=${lib.getDev targetLibs.ncurses}/include"
"--with-curses-libraries=${lib.getLib targetLibs.ncurses}/lib"

View File

@@ -501,6 +501,11 @@ stdenv.mkDerivation (
configureFlags = [
"--datadir=$doc/share/doc/ghc"
]
# ghc 9.10 and later use c17 by default. we use gnu17 on darwin for older
# ghc versions to match this and fix build issues with newer clang.
++ lib.optionals (hostPlatform.isDarwin && lib.versionOlder version "9.10") [
"CFLAGS=-std=gnu17"
]
++ lib.optionals enableTerminfo [
"--with-curses-includes=${lib.getDev targetLibs.ncurses}/include"
"--with-curses-libraries=${lib.getLib targetLibs.ncurses}/lib"