Skip to content

Commit ec85971

Browse files
committed
Merge remote-tracking branch 'upstream/master' into fix-stackage
2 parents ea72ac5 + 5240aeb commit ec85971

File tree

18 files changed

+1455
-50
lines changed

18 files changed

+1455
-50
lines changed

builder/comp-builder.nix

+1-10
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,7 @@ let
179179
[ "--with-gcc=${stdenv.cc.targetPrefix}cc"
180180
] ++
181181
# BINTOOLS
182-
(if stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAndroid # might be better check to see if cc is clang/llvm?
183-
# use gold as the linker on linux to improve link times
184-
then [
185-
"--with-ld=${stdenv.cc.bintools.targetPrefix}ld.gold"
186-
"--ghc-option=-optl-fuse-ld=gold"
187-
"--ld-option=-fuse-ld=gold"
188-
] else [
189-
"--with-ld=${stdenv.cc.bintools.targetPrefix}ld"
190-
]
191-
) ++ [
182+
[
192183
"--with-ar=${stdenv.cc.bintools.targetPrefix}ar"
193184
"--with-strip=${stdenv.cc.bintools.targetPrefix}strip"
194185
]

compiler/ghc/default.nix

+14-2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ let self =
6565
# necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
6666
disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64
6767

68+
, useLdGold ?
69+
# might be better check to see if cc is clang/llvm?
70+
# use gold as the linker on linux to improve link times
71+
# do not use it on musl due to a ld.gold bug. See: <https://sourceware.org/bugzilla/show_bug.cgi?id=22266>.
72+
(stdenv.targetPlatform.isLinux && !stdenv.targetPlatform.isAndroid && !stdenv.targetPlatform.isMusl)
73+
|| stdenv.targetPlatform.isAarch32
74+
6875
, ghc-version ? src-spec.version
6976
, ghc-version-date ? null
7077
, src-spec
@@ -187,10 +194,11 @@ let
187194
"--enable-bootstrap-with-devel-snapshot"
188195
] ++ lib.optionals (disableLargeAddressSpace) [
189196
"--disable-large-address-space"
190-
] ++ lib.optionals (targetPlatform.isAarch32) [
197+
] ++ lib.optionals useLdGold [
191198
"CFLAGS=-fuse-ld=gold"
192199
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
193200
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
201+
"CONF_LD_LINKER_OPTS_STAGE2=-fuse-ld=gold" # See: <https://gitlab.haskell.org/ghc/ghc/-/issues/22550#note_466656>
194202
] ++ lib.optionals enableDWARF [
195203
"--enable-dwarf-unwind"
196204
"--with-libdw-includes=${lib.getDev elfutils}/include"
@@ -285,13 +293,17 @@ stdenv.mkDerivation (rec {
285293
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
286294
export CXX="${targetCC}/bin/${targetCC.targetPrefix}c++"
287295
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
288-
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString targetPlatform.isAarch32 ".gold"}"
296+
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
289297
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
290298
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
291299
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
292300
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
293301
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
294302
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
303+
'' + lib.optionalString (targetPlatform == hostPlatform && useLdGold)
304+
# set LD explicitly if we want gold even if we aren't cross compiling
305+
''
306+
export LD="${targetCC.bintools}/bin/ld.gold"
295307
'' + lib.optionalString (targetPlatform.isWindows) ''
296308
export DllWrap="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}dllwrap"
297309
export Windres="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}windres"

flake.lock

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/pkgconf-nixpkgs-map.nix

-6
Original file line numberDiff line numberDiff line change
@@ -4119,12 +4119,6 @@ pkgs:
41194119
"ply-boot-client" = [ "plymouth" ];
41204120
"ply-splash-core" = [ "plymouth" ];
41214121
"ply-splash-graphics" = [ "plymouth" ];
4122-
"libpmem2" = [ "pmdk" ];
4123-
"libpmemblk" = [ "pmdk" ];
4124-
"libpmemlog" = [ "pmdk" ];
4125-
"libpmemobj" = [ "pmdk" ];
4126-
"libpmem" = [ "pmdk" ];
4127-
"libpmempool" = [ "pmdk" ];
41284122
"pmix" = [ "pmix" ];
41294123
"pm-utils" = [ "pmutils" ];
41304124
"libpodofo" = [ "podofo" ];

materialized/dummy-ghc/x86_64-w64-mingw32-x86_64-w64-mingw32-ghc-8.10.7-x86_64-darwin/ghc-pkg/dump-global

+124
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materialized/dummy-ghc/x86_64-w64-mingw32-x86_64-w64-mingw32-ghc-8.10.7-x86_64-linux/ghc-pkg/dump-global

+124
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)